예제 #1
0
 public double[] rollOut()
 {
     Playfield RandomRollerState = new Playfield(state);
     int action = 0;
     while (!RandomRollerState.isEnded() && action != -1) {
         action = RandomRoller.roll(RandomRollerState);
         if(action >= 0)
         {
             RandomRollerState.tick(action);
         }
     }
     return m_ParetoMCTSPlayer.getHeuristic().value(RandomRollerState);
 }
예제 #2
0
 public SimpleTreeNode expand() {
     // choose a random unused action and add a new node for that
     int bestAction = -1;
     double bestValue = -1;
     for (int i = 0; i < children.Length; i++) {
         double x = r.NextDouble();
         if (x > bestValue && children[i] == null) {
             bestAction = i;
             bestValue = x;
         }
     }
     Playfield nextState = new Playfield(state);
     nextState.tick(bestAction);
     SimpleTreeNode tn = new SimpleTreeNode(nextState, this, this.RandomRoller, this.paretoTreePolicy, this.m_ParetoMCTSPlayer);
     children[bestAction] = tn;
     return tn;
 }