Minor optimization
This commit is contained in:
@@ -47,10 +47,11 @@ internal static class Program
|
|||||||
|
|
||||||
var config = new SolverConfig()
|
var config = new SolverConfig()
|
||||||
{
|
{
|
||||||
Iterations = 30_000 / 8,//1_000_000
|
Iterations = 30_000 / 1,
|
||||||
ThreadCount = 8,
|
ThreadCount = 1,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Debugger.Break();
|
||||||
var s = Stopwatch.StartNew();
|
var s = Stopwatch.StartNew();
|
||||||
if (true)
|
if (true)
|
||||||
_ = Solver.Crafty.Solver.SearchStepwise(config, input, a => Console.WriteLine(a));
|
_ = Solver.Crafty.Solver.SearchStepwise(config, input, a => Console.WriteLine(a));
|
||||||
@@ -63,5 +64,6 @@ internal static class Program
|
|||||||
}
|
}
|
||||||
s.Stop();
|
s.Stop();
|
||||||
Console.WriteLine($"{s.Elapsed.TotalMilliseconds:0.00}");
|
Console.WriteLine($"{s.Elapsed.TotalMilliseconds:0.00}");
|
||||||
|
Debugger.Break();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,3 +1,6 @@
|
|||||||
|
using System.Diagnostics.Contracts;
|
||||||
|
using System.Runtime.CompilerServices;
|
||||||
|
|
||||||
namespace Craftimizer.Simulator.Actions;
|
namespace Craftimizer.Simulator.Actions;
|
||||||
|
|
||||||
public enum ActionType : byte
|
public enum ActionType : byte
|
||||||
@@ -51,6 +54,8 @@ public static class ActionUtils
|
|||||||
.ToArray();
|
.ToArray();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[Pure]
|
||||||
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||||
public static BaseAction Base(this ActionType me) => Actions[(int)me];
|
public static BaseAction Base(this ActionType me) => Actions[(int)me];
|
||||||
|
|
||||||
public static IEnumerable<ActionType> AvailableActions(Simulator simulation) =>
|
public static IEnumerable<ActionType> AvailableActions(Simulator simulation) =>
|
||||||
|
|||||||
Reference in New Issue
Block a user