public RandomMoveChooser(IPairWeighter pairWeight, bool withExchange, int depth = 20,
                                 double flagsTakenC = 10000, double distC = 1, double nextFlagC = 1d / 4)
        {
            this.depth          = depth;
            evaluationFunctions = new EvaluationFunctions(flagsTakenC, distC, nextFlagC);
            PairWeighter        = pairWeight;
            var list             = new[] { 0, 1, -1 };
            var possibleCommands = list
                                   .SelectMany(t => list, (t1, t2) => (ICarCommand) new MoveCommand(new V(t1, t2)));

            if (withExchange)
            {
                Commands = possibleCommands
                           .Prepend(new ExchangeCommand())
                           .ToArray();
                maxCommandIndex = 10;
            }
            else
            {
                Commands        = possibleCommands.ToArray();
                maxCommandIndex = 9;
            }
        }
示例#2
0
 public RandomRacerWithoutMemorizing(int depth        = 20, double flagsTakenC = 10000, double distC = 1,
                                     double nextFlagC = 1d / 4)
 {
     this.depth          = depth;
     evaluationFunctions = new EvaluationFunctions(flagsTakenC, distC, nextFlagC);
 }