public class MCTSNode extends Object
Modifier and Type | Field and Description |
---|---|
protected StatsSummary |
rolloutMoves |
protected StatsSummary |
rolloutScores |
Constructor and Description |
---|
MCTSNode(Collection<Action> allUnexpandedActions) |
MCTSNode(int agentID,
Action moveToState,
Collection<Action> allUnexpandedActions) |
MCTSNode(MCTSNode parent,
int agentId,
Action moveToState,
Collection<Action> allUnexpandedActions) |
Modifier and Type | Method and Description |
---|---|
protected void |
addChild(MCTSNode node) |
void |
backup(double score) |
void |
backupRollout(int moves,
int score)
Keep track of stats for rollouts.
|
boolean |
containsChild(Action moveToChild) |
boolean |
fullyExpanded(GameState state) |
boolean |
fullyExpanded(GameState state,
int nextId) |
Action |
getAction() |
int |
getAgent() |
Collection<Action> |
getAllActionsExpandedAlready() |
MCTSNode |
getBestNode() |
MCTSNode |
getChild(Action action) |
List<MCTSNode> |
getChildren() |
int |
getChildSize() |
int |
getDepth() |
Collection<Action> |
getLegalMoves(GameState state,
int nextId) |
MCTSNode |
getUCTNode(GameState state) |
double |
getUCTValue() |
boolean |
isLeaf() |
void |
printChildren() |
String |
printD3() |
String |
toString() |
protected final StatsSummary rolloutScores
protected final StatsSummary rolloutMoves
public MCTSNode(Collection<Action> allUnexpandedActions)
public MCTSNode(int agentID, Action moveToState, Collection<Action> allUnexpandedActions)
public MCTSNode(MCTSNode parent, int agentId, Action moveToState, Collection<Action> allUnexpandedActions)
protected void addChild(MCTSNode node)
public double getUCTValue()
public void backup(double score)
public boolean isLeaf()
public int getAgent()
public Action getAction()
public MCTSNode getBestNode()
public int getDepth()
public int getChildSize()
public boolean containsChild(Action moveToChild)
public boolean fullyExpanded(GameState state)
public boolean fullyExpanded(GameState state, int nextId)
public Collection<Action> getLegalMoves(GameState state, int nextId)
public Collection<Action> getAllActionsExpandedAlready()
public void printChildren()
public String printD3()
public void backupRollout(int moves, int score)
moves
- The number of moves made for a given rolloutscore
- The total score achived at the end of the rolloutCopyright © 2017 FOSS Galaxy. All rights reserved.