public void RunCase(string input) { var state = StateReader.Read(input); var ai = new AlphabetaAi(evaluator); var action = ai.GetAction(state, 45); Console.WriteLine(action); }
public void PerformanceTest() { var state = new StateReader("...0...|..000..|.00000.|0000000|.00010.|..000..|...1...|3 5|5 4|3 4|1 1|") .ReadState(new InitializationData(7, 2)); for (var j = 0; j < 10; j++) { var alphabetaAi = new AlphabetaAi(evaluator); for (var i = 0; i < 10; i++) { var action = alphabetaAi.GetAction(state, 100); action.ApplyTo(state); state.ChangeCurrentPlayer(); //Console.WriteLine(state); Console.WriteLine(action); } } }
public void TreeSizeMeasurement() { var totalSize = new StatValue(); foreach (var stateInput in GetStatesCollection()) { var localSize = new StatValue(); var state = StateReader.Read(stateInput); var ai = new AlphabetaAi(evaluator, 3) { Logging = false }; for (var i = 0; i < 1; i++) { var action = ai.GetAction(state, 250); localSize.Add(ai.LastSearchTreeSize); action.ApplyTo(state); } Console.WriteLine(localSize.ToDetailedString()); totalSize.AddAll(localSize); } Console.WriteLine("Total:"); Console.WriteLine(totalSize.ToDetailedString()); }