Remove tracing

This commit is contained in:
Asriel Camora
2023-11-04 23:15:20 -07:00
parent 3167b0db44
commit e07617f1c8
10 changed files with 10 additions and 97 deletions
-31
View File
@@ -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;
+1 -6
View File
@@ -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>
+6 -2
View File
@@ -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,
-12
View File
@@ -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);
}