Update solver scoring; remove byregot adjustment

This commit is contained in:
Asriel Camora
2023-11-04 19:40:31 -07:00
parent 5bee39678c
commit bfc8708fbd
6 changed files with 157 additions and 141 deletions
+7 -2
View File
@@ -8,7 +8,7 @@
<IsPackable>false</IsPackable>
<IsTestProject>true</IsTestProject>
<Platforms>x64</Platforms>
<Configurations>Debug;Release</Configurations>
<Configurations>Debug;Release;Trace</Configurations>
</PropertyGroup>
<ItemGroup>
@@ -22,9 +22,14 @@
<ProjectReference Include="..\Simulator\Craftimizer.Simulator.csproj" />
<ProjectReference Include="..\Solver\Craftimizer.Solver.csproj" />
</ItemGroup>
<PropertyGroup Condition="'$(IS_BENCH)'=='1'">
<DefineConstants>$(DefineConstants);IS_DETERMINISTIC</DefineConstants>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)'=='Trace'">
<Optimize>True</Optimize>
<DefineConstants>$(DefineConstants);IS_DETERMINISTIC;IS_TRACE</DefineConstants>
</PropertyGroup>
</Project>
+21 -7
View File
@@ -89,33 +89,47 @@ public class ActionSetTests
Assert.AreEqual(4, set.Count);
#if !IS_TRACE
Assert.AreEqual(ActionType.DelicateSynthesis, set.ElementAt(0));
Assert.AreEqual(ActionType.FocusedTouch, set.ElementAt(1));
Assert.AreEqual(ActionType.ByregotsBlessing, set.ElementAt(2));
Assert.AreEqual(ActionType.BasicSynthesis, set.ElementAt(3));
#else
Assert.AreEqual(ActionType.BasicSynthesis, set.ElementAt(0));
Assert.AreEqual(ActionType.ByregotsBlessing, set.ElementAt(1));
Assert.AreEqual(ActionType.FocusedTouch, set.ElementAt(2));
Assert.AreEqual(ActionType.DelicateSynthesis, set.ElementAt(3));
#endif
set.RemoveAction(ActionType.FocusedTouch);
Assert.AreEqual(3, set.Count);
#if !IS_TRACE
Assert.AreEqual(ActionType.DelicateSynthesis, set.ElementAt(0));
Assert.AreEqual(ActionType.ByregotsBlessing, set.ElementAt(1));
Assert.AreEqual(ActionType.BasicSynthesis, set.ElementAt(2));
#else
Assert.AreEqual(ActionType.BasicSynthesis, set.ElementAt(0));
Assert.AreEqual(ActionType.ByregotsBlessing, set.ElementAt(1));
Assert.AreEqual(ActionType.DelicateSynthesis, set.ElementAt(2));
#endif
}
[TestMethod]
public void TestRandomIndex()
{
#if IS_DETERMINISTIC
Assert.Inconclusive("Craftimizer is built for benchmarking; all random actions are deterministic and not actually random.");
Assert.Inconclusive("Craftimizer is currently built for determinism; all random actions are not actually random.");
#endif
var actions = new[]
{
ActionType.BasicTouch,
ActionType.BasicSynthesis,
ActionType.GreatStrides,
ActionType.TrainedFinesse,
};
{
ActionType.BasicTouch,
ActionType.BasicSynthesis,
ActionType.GreatStrides,
ActionType.TrainedFinesse,
};
var set = new ActionSet();
foreach(var action in actions)