public void Debug() { var stateInput = "...1...|..344..|.44433.|2444443|.41421.|..113..|...0...|5 2|0 3|2 1|3 5|"; var state = StateReader.Read(stateInput); var action = new AlphaBetaAi(evaluator, 1).GetAction(state, 100); Assert.That(action.ToString(), Is.EqualTo("MOVE&BUILD 0 SE SW")); }
public void BeEquivalentToGreedy_WhenSearchDepthIs1(string input) { var state = StateReader.Read(input); var initialStateDump = state.ToString(); var greedyAction = new GreedyAi(evaluator).GetAction(state, 100); var abAction = new AlphaBetaAi(evaluator, 1).GetAction(state, 100); Console.WriteLine(state.ToString()); Console.WriteLine($"[{abAction}]"); state.ToString().Should().Be(initialStateDump, "ai.GetAction should not change state"); abAction.ToString().Should().Be(greedyAction.ToString(), "ab-ai with depth=1 should be exactly gready ai"); }