Newer
Older
package battle.controllers.Piers;
import asteroids.Action;
import battle.BattleController;
import battle.SimpleBattle;
/**
* Created by pwillic on 11/06/2015.
*/
public class PiersMCTS implements BattleController {
public PiersMCTS() {
MCTSNode.setAllActions();
@Override
public Action getAction(SimpleBattle gameStateCopy, int playerId) {
BetterMCTSNode root = new BetterMCTSNode(2.0, playerId);
while (timer.remainingTimePercent() > 10) {
BetterMCTSNode travel = root.select(copy, 5);
double result = travel.rollout(copy, 50);
travel.updateValues(result);
// if(i % 100 == 0){
// root.printAllChildren();
// }
// System.out.println("Best Action: " + root.getBestAction());