Esempio n. 1
0
    //public PlayoutInfo m_pi;

    //public ParetoTreeNode()
    //{
    //    this(null, null, -1, null, null, null, null,null);
    //}

    //public ParetoTreeNode(Game state, Roller roller, ParetoTreePolicy treePolicy, Random rnd,
    //                      Player a_player, PlayoutInfo pi) {
    //    this(state, null, -1, roller, treePolicy, rnd, a_player,pi);
    //}

    //public ParetoTreeNode(Playfield state, RandomRoller roller, ParetoTreePolicy treePolicy, Random rnd,
    //                  ParetoMCTSPlayer a_player)
    //{
    //    this(state, null, -1, roller, treePolicy, rnd, a_player);
    //}

    //public ParetoTreeNode(Game state, ParetoTreeNode parent, int childIndex, Roller roller,
    //                      TreePolicy treePolicy, Random rnd, Player a_player, PlayoutInfo pi) {
    //    this.m_player = a_player;
    //    this.state = state;
    //    this.parent = parent;
    //    this.m_rnd = rnd;
    //    children = new ParetoTreeNode[ParetoMCTSParameters.NUM_ACTIONS];
    //    totValue = new double[ParetoMCTSParameters.NUM_TARGETS];
    //    this.roller = roller;
    //    this.treePolicy = treePolicy;
    //    pa = new ParetoArchive();
    //    this.childIndex = childIndex;
    //    this.m_prunedChildren = new bool[ParetoMCTSParameters.NUM_ACTIONS];
    //    this.m_numIters = 0;
    //    this.m_pi = pi;
        
    //    if(parent == null) //This is only for the root:
    //    {
    //        this.initValueRoute();
    //    }
    //}

    public ParetoTreeNode(Playfield state, ParetoTreeNode parent, int childIndex, RandomRoller roller,
                      ParetoTreePolicy treePolicy, Random rnd, ParetoMCTSPlayer a_player)
    {
        this.m_player = a_player;
        this.state = state;
        this.parent = parent;
        this.m_rnd = rnd;
        //children = new ParetoTreeNode[ParetoMCTSParameters.NUM_ACTIONS];
        this.roller = roller;
        this.mTreePolicy = treePolicy;
        pa = new ParetoArchive();
        this.childIndex = childIndex;
        this.m_prunedChildren = new bool[ParetoMCTSParameters.NUM_ACTIONS];
        this.m_numIters = 0;
        //this.m_pi = pi;

        isTerminal = false;
        isExpanded = false;
        isExhausted = false;
        numExpandedChildren = 0;
        numExhaustedChildren = 0;
        nodeNum = GameManager.Instance.nodeCount;
        GameManager.Instance.nodeCount++;

        totValue = new double[ParetoMCTSParameters.NUM_TARGETS];
        //if (parent == null) //This is only for the root:
        //{
        //    this.initValueRoute();
        //}
    }
Esempio n. 2
0
 public SimpleTreeNode(Playfield state, RandomRoller RandomRoller, ParetoTreePolicy ParetoTreePolicy, ParetoMCTSPlayer a_ParetoMCTSPlayer)
 {
     this(state, null, RandomRoller, ParetoTreePolicy, a_ParetoMCTSPlayer);
     this.RandomRoller = RandomRoller;
     this.paretoTreePolicy = ParetoTreePolicy;
     pa = new ParetoArchive();
 }
Esempio n. 3
0
 public SimpleTreeNode(Playfield state, SimpleTreeNode parent, RandomRoller RandomRoller, ParetoTreePolicy ParetoTreePolicy, ParetoMCTSPlayer a_ParetoMCTSPlayer)
 {
     this.m_ParetoMCTSPlayer = a_ParetoMCTSPlayer;
     this.parent = parent;
     children = new SimpleTreeNode[ParetoMCTSController.NUM_ACTIONS];
     totValue = new double[ParetoMCTSParameters.NUM_TARGETS];
     this.RandomRoller = RandomRoller;
     this.paretoTreePolicy = ParetoTreePolicy;
     // System.out.println("Made a TreeNode of depth " + depth() + ", arity " + children.Length);
 }