Remove tracing
This commit is contained in:
@@ -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