Expand macros generated by solver
This commit is contained in:
+25
-23
@@ -54,20 +54,26 @@ internal static class Program
|
|||||||
var sim = new SimulatorNoRandom(new(input));
|
var sim = new SimulatorNoRandom(new(input));
|
||||||
(_, var state) = sim.Execute(new(input), ActionType.MuscleMemory);
|
(_, var state) = sim.Execute(new(input), ActionType.MuscleMemory);
|
||||||
(_, state) = sim.Execute(state, ActionType.PrudentTouch);
|
(_, state) = sim.Execute(state, ActionType.PrudentTouch);
|
||||||
(_, state) = sim.Execute(state, ActionType.Manipulation);
|
//(_, state) = sim.Execute(state, ActionType.Manipulation);
|
||||||
(_, state) = sim.Execute(state, ActionType.Veneration);
|
//(_, state) = sim.Execute(state, ActionType.Veneration);
|
||||||
(_, state) = sim.Execute(state, ActionType.WasteNot);
|
//(_, state) = sim.Execute(state, ActionType.WasteNot);
|
||||||
(_, state) = sim.Execute(state, ActionType.Groundwork);
|
//(_, state) = sim.Execute(state, ActionType.Groundwork);
|
||||||
(_, state) = sim.Execute(state, ActionType.Groundwork);
|
//(_, state) = sim.Execute(state, ActionType.Groundwork);
|
||||||
(_, state) = sim.Execute(state, ActionType.Groundwork);
|
//(_, state) = sim.Execute(state, ActionType.Groundwork);
|
||||||
(_, state) = sim.Execute(state, ActionType.Innovation);
|
//(_, state) = sim.Execute(state, ActionType.Innovation);
|
||||||
(_, state) = sim.Execute(state, ActionType.PrudentTouch);
|
//(_, state) = sim.Execute(state, ActionType.PrudentTouch);
|
||||||
(_, state) = sim.Execute(state, ActionType.AdvancedTouchCombo);
|
//(_, state) = sim.Execute(state, ActionType.AdvancedTouchCombo);
|
||||||
(_, state) = sim.Execute(state, ActionType.Manipulation);
|
//(_, state) = sim.Execute(state, ActionType.Manipulation);
|
||||||
(_, state) = sim.Execute(state, ActionType.Innovation);
|
//(_, state) = sim.Execute(state, ActionType.Innovation);
|
||||||
(_, state) = sim.Execute(state, ActionType.PrudentTouch);
|
//(_, state) = sim.Execute(state, ActionType.PrudentTouch);
|
||||||
(_, state) = sim.Execute(state, ActionType.AdvancedTouchCombo);
|
//(_, state) = sim.Execute(state, ActionType.AdvancedTouchCombo);
|
||||||
(_, state) = sim.Execute(state, ActionType.GreatStrides);
|
//(_, state) = sim.Execute(state, ActionType.GreatStrides);
|
||||||
|
//(_, state) = sim.Execute(state, ActionType.Innovation);
|
||||||
|
//(_, state) = sim.Execute(state, ActionType.FocusedTouchCombo);
|
||||||
|
//(_, state) = sim.Execute(state, ActionType.GreatStrides);
|
||||||
|
//(_, state) = sim.Execute(state, ActionType.ByregotsBlessing);
|
||||||
|
//(_, state) = sim.Execute(state, ActionType.CarefulSynthesis);
|
||||||
|
//(_, state) = sim.Execute(state, ActionType.CarefulSynthesis);
|
||||||
|
|
||||||
Console.WriteLine($"{state.Quality} {state.CP} {state.Progress} {state.Durability}");
|
Console.WriteLine($"{state.Quality} {state.CP} {state.Progress} {state.Durability}");
|
||||||
//return;
|
//return;
|
||||||
@@ -75,21 +81,17 @@ internal static class Program
|
|||||||
Console.WriteLine($"Qual: {s.Quality}/{s.Input.Recipe.MaxQuality}");
|
Console.WriteLine($"Qual: {s.Quality}/{s.Input.Recipe.MaxQuality}");
|
||||||
return;
|
return;
|
||||||
|
|
||||||
for (var i = 0; i < 7; ++i)
|
Solver.Crafty.Solver.SearchStepwiseFurcated(config, input);
|
||||||
{
|
//Benchmark(() => );
|
||||||
Console.WriteLine($"{i + 1}");
|
|
||||||
var c = config with { FurcatedActionCount = i + 1 };
|
|
||||||
Benchmark(() => Solver.Crafty.Solver.SearchStepwiseFurcated(c, input).State);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void Benchmark(Func<SimulationState> search)
|
private static void Benchmark(Func<SolverSolution> search)
|
||||||
{
|
{
|
||||||
var s = Stopwatch.StartNew();
|
var s = Stopwatch.StartNew();
|
||||||
List<int> q = new();
|
List<int> q = new();
|
||||||
for (var i = 0; i < 60; ++i)
|
for (var i = 0; i < 15; ++i)
|
||||||
{
|
{
|
||||||
var state = search();
|
var state = search().State;
|
||||||
//Console.WriteLine($"Qual: {state.Quality}/{state.Input.Recipe.MaxQuality}");
|
//Console.WriteLine($"Qual: {state.Quality}/{state.Input.Recipe.MaxQuality}");
|
||||||
|
|
||||||
q.Add(state.Quality);
|
q.Add(state.Quality);
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
using Craftimizer.Simulator;
|
||||||
using Craftimizer.Simulator.Actions;
|
using Craftimizer.Simulator.Actions;
|
||||||
using Dalamud.Interface.Windowing;
|
using Dalamud.Interface.Windowing;
|
||||||
using System;
|
using System;
|
||||||
@@ -15,9 +16,18 @@ public sealed partial class SimulatorWindow : Window, IDisposable
|
|||||||
|
|
||||||
private void AppendGeneratedAction(ActionType action)
|
private void AppendGeneratedAction(ActionType action)
|
||||||
{
|
{
|
||||||
var tooltip = action.Base().GetTooltip(Simulator, false);
|
var actionBase = action.Base();
|
||||||
var (response, state) = Simulator.Execute(LatestState, action);
|
if (actionBase is BaseComboAction comboActionBase)
|
||||||
Actions.Add((action, tooltip, response, state));
|
{
|
||||||
|
AppendGeneratedAction(comboActionBase.ActionTypeA);
|
||||||
|
AppendGeneratedAction(comboActionBase.ActionTypeB);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
var tooltip = actionBase.GetTooltip(Simulator, false);
|
||||||
|
var (response, state) = Simulator.Execute(LatestState, action);
|
||||||
|
Actions.Add((action, tooltip, response, state));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void RemoveAction(int actionIndex)
|
private void RemoveAction(int actionIndex)
|
||||||
|
|||||||
Reference in New Issue
Block a user