Remove tracing
This commit is contained in:
@@ -6,7 +6,7 @@
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
<Platforms>x64</Platforms>
|
||||
<Configurations>Debug;Release;Trace</Configurations>
|
||||
<Configurations>Debug;Release</Configurations>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
@@ -32,10 +32,5 @@
|
||||
<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>
|
||||
|
||||
@@ -8,12 +8,8 @@ internal static class Program
|
||||
{
|
||||
private static Task Main(string[] args)
|
||||
{
|
||||
#if !IS_TRACE
|
||||
RunBench(args);
|
||||
return Task.CompletedTask;
|
||||
#else
|
||||
return RunTrace();
|
||||
#endif
|
||||
// return RunOther();
|
||||
}
|
||||
|
||||
|
||||
@@ -4,11 +4,10 @@
|
||||
<TargetFramework>net7.0</TargetFramework>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
|
||||
<IsPackable>false</IsPackable>
|
||||
<IsTestProject>true</IsTestProject>
|
||||
<Platforms>x64</Platforms>
|
||||
<Configurations>Debug;Release;Trace</Configurations>
|
||||
<Configurations>Debug;Release</Configurations>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
@@ -27,9 +26,4 @@
|
||||
<DefineConstants>$(DefineConstants);IS_DETERMINISTIC</DefineConstants>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup Condition="'$(Configuration)'=='Trace'">
|
||||
<Optimize>True</Optimize>
|
||||
<DefineConstants>$(DefineConstants);IS_DETERMINISTIC;IS_TRACE</DefineConstants>
|
||||
</PropertyGroup>
|
||||
|
||||
</Project>
|
||||
|
||||
@@ -89,31 +89,18 @@ 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]
|
||||
|
||||
@@ -23,38 +23,28 @@ Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|x64 = Debug|x64
|
||||
Release|x64 = Release|x64
|
||||
Trace|x64 = Trace|x64
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{13C812E9-0D42-4B95-8646-40EEBF30636F}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{13C812E9-0D42-4B95-8646-40EEBF30636F}.Debug|x64.Build.0 = Debug|x64
|
||||
{13C812E9-0D42-4B95-8646-40EEBF30636F}.Release|x64.ActiveCfg = Release|x64
|
||||
{13C812E9-0D42-4B95-8646-40EEBF30636F}.Release|x64.Build.0 = Release|x64
|
||||
{13C812E9-0D42-4B95-8646-40EEBF30636F}.Trace|x64.ActiveCfg = Release|x64
|
||||
{057C4B64-4D99-4847-9BCF-966571CAE57C}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{057C4B64-4D99-4847-9BCF-966571CAE57C}.Debug|x64.Build.0 = Debug|x64
|
||||
{057C4B64-4D99-4847-9BCF-966571CAE57C}.Release|x64.ActiveCfg = Release|x64
|
||||
{057C4B64-4D99-4847-9BCF-966571CAE57C}.Release|x64.Build.0 = Release|x64
|
||||
{057C4B64-4D99-4847-9BCF-966571CAE57C}.Trace|x64.ActiveCfg = Trace|x64
|
||||
{057C4B64-4D99-4847-9BCF-966571CAE57C}.Trace|x64.Build.0 = Trace|x64
|
||||
{172EE849-AC7E-4F2A-ACAB-EF9D065523B3}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{172EE849-AC7E-4F2A-ACAB-EF9D065523B3}.Debug|x64.Build.0 = Debug|x64
|
||||
{172EE849-AC7E-4F2A-ACAB-EF9D065523B3}.Release|x64.ActiveCfg = Release|x64
|
||||
{172EE849-AC7E-4F2A-ACAB-EF9D065523B3}.Release|x64.Build.0 = Release|x64
|
||||
{172EE849-AC7E-4F2A-ACAB-EF9D065523B3}.Trace|x64.ActiveCfg = Trace|x64
|
||||
{172EE849-AC7E-4F2A-ACAB-EF9D065523B3}.Trace|x64.Build.0 = Trace|x64
|
||||
{2B0EA452-6DFC-48DB-9049-EA782E600C21}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{2B0EA452-6DFC-48DB-9049-EA782E600C21}.Debug|x64.Build.0 = Debug|x64
|
||||
{2B0EA452-6DFC-48DB-9049-EA782E600C21}.Release|x64.ActiveCfg = Release|x64
|
||||
{2B0EA452-6DFC-48DB-9049-EA782E600C21}.Release|x64.Build.0 = Release|x64
|
||||
{2B0EA452-6DFC-48DB-9049-EA782E600C21}.Trace|x64.ActiveCfg = Trace|x64
|
||||
{2B0EA452-6DFC-48DB-9049-EA782E600C21}.Trace|x64.Build.0 = Trace|x64
|
||||
{C3AEA981-9DA8-405C-995B-86528493891B}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{C3AEA981-9DA8-405C-995B-86528493891B}.Debug|x64.Build.0 = Debug|x64
|
||||
{C3AEA981-9DA8-405C-995B-86528493891B}.Release|x64.ActiveCfg = Release|x64
|
||||
{C3AEA981-9DA8-405C-995B-86528493891B}.Release|x64.Build.0 = Release|x64
|
||||
{C3AEA981-9DA8-405C-995B-86528493891B}.Trace|x64.ActiveCfg = Trace|x64
|
||||
{C3AEA981-9DA8-405C-995B-86528493891B}.Trace|x64.Build.0 = Trace|x64
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
<Platforms>x64</Platforms>
|
||||
<Configurations>Debug;Release;Trace</Configurations>
|
||||
<Configurations>Debug;Release</Configurations>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
@@ -19,9 +19,4 @@
|
||||
<DefineConstants>$(DefineConstants);IS_DETERMINISTIC</DefineConstants>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup Condition="'$(Configuration)'=='Trace'">
|
||||
<Optimize>True</Optimize>
|
||||
<DefineConstants>$(DefineConstants);IS_DETERMINISTIC;IS_TRACE</DefineConstants>
|
||||
</PropertyGroup>
|
||||
|
||||
</Project>
|
||||
|
||||
@@ -11,7 +11,6 @@ public struct ActionSet
|
||||
|
||||
public static readonly ActionType[] AcceptedActions = new[]
|
||||
{
|
||||
#if !IS_TRACE
|
||||
ActionType.StandardTouchCombo,
|
||||
ActionType.AdvancedTouchCombo,
|
||||
ActionType.FocusedTouchCombo,
|
||||
@@ -41,36 +40,6 @@ public struct ActionSet
|
||||
ActionType.Observe,
|
||||
ActionType.MastersMend,
|
||||
ActionType.BasicTouch,
|
||||
#else
|
||||
//ActionType.BasicSynthesis,
|
||||
ActionType.BasicTouch,
|
||||
ActionType.MastersMend,
|
||||
ActionType.Observe,
|
||||
ActionType.WasteNot,
|
||||
ActionType.Veneration,
|
||||
ActionType.StandardTouch,
|
||||
ActionType.GreatStrides,
|
||||
ActionType.Innovation,
|
||||
ActionType.BasicSynthesis,
|
||||
ActionType.WasteNot2,
|
||||
ActionType.ByregotsBlessing,
|
||||
ActionType.MuscleMemory,
|
||||
//ActionType.CarefulSynthesis,
|
||||
ActionType.Manipulation,
|
||||
ActionType.PrudentTouch,
|
||||
ActionType.FocusedSynthesis,
|
||||
ActionType.FocusedTouch,
|
||||
ActionType.Reflect,
|
||||
ActionType.PreparatoryTouch,
|
||||
//ActionType.Groundwork,
|
||||
ActionType.DelicateSynthesis,
|
||||
ActionType.TrainedEye,
|
||||
ActionType.CarefulSynthesis,
|
||||
ActionType.AdvancedTouch,
|
||||
ActionType.Groundwork,
|
||||
ActionType.PrudentSynthesis,
|
||||
ActionType.TrainedFinesse,
|
||||
#endif
|
||||
};
|
||||
|
||||
public static readonly int[] AcceptedActionsLUT;
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
<Nullable>enable</Nullable>
|
||||
<AllowUnsafeBlocks>True</AllowUnsafeBlocks>
|
||||
<Platforms>x64</Platforms>
|
||||
<Configurations>Debug;Release;Trace</Configurations>
|
||||
<Configurations>Debug;Release</Configurations>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
@@ -24,9 +24,4 @@
|
||||
<DefineConstants>$(DefineConstants);IS_DETERMINISTIC</DefineConstants>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup Condition="'$(Configuration)'=='Trace'">
|
||||
<Optimize>True</Optimize>
|
||||
<DefineConstants>$(DefineConstants);IS_DETERMINISTIC;IS_TRACE</DefineConstants>
|
||||
</PropertyGroup>
|
||||
|
||||
</Project>
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
using Craftimizer.Simulator;
|
||||
using Craftimizer.Simulator.Actions;
|
||||
using System.Diagnostics.Contracts;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
namespace Craftimizer.Solver;
|
||||
@@ -40,9 +42,11 @@ public struct SimulationNode
|
||||
|
||||
if (state.Input.Recipe.MaxQuality == 0)
|
||||
return 1f - ((float)(state.ActionCount + 1) / config.MaxStepCount);
|
||||
|
||||
|
||||
[Pure]
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining | MethodImplOptions.AggressiveOptimization)]
|
||||
static float Apply(float bonus, float value, float target) =>
|
||||
bonus * (target > 0 ? Math.Min(1f, value / target) : 1);
|
||||
bonus * (target > 0 ? Math.Clamp(value / target, 0, 1) : 1);
|
||||
|
||||
var progressScore = Apply(
|
||||
config.ScoreProgress,
|
||||
|
||||
@@ -1,12 +0,0 @@
|
||||
using System.Diagnostics;
|
||||
using System.Runtime.CompilerServices;
|
||||
|
||||
namespace Craftimizer.Solver;
|
||||
|
||||
internal static class Trace
|
||||
{
|
||||
[Conditional("IS_TRACE")]
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining | MethodImplOptions.AggressiveOptimization)]
|
||||
public static void Log(string msg) =>
|
||||
Console.WriteLine(msg);
|
||||
}
|
||||
Reference in New Issue
Block a user