Skip to content

Conversation

@vadithiyan
Copy link

  • Added PISingleTreeNode
  • Modified SingleTreeNode to handle PI-MCTS
  • Modified MCTSEnums to include Perfect Inforamtion as an Information Policy and added A new enum for Perfect Information Aggregation Policy
  • Added NumDeterminizations and PerfectInformationPolicy as Tunable parameters to MCTSParams
  • Modified MCTSPlayer to use PISingleTreeNode when Perfect Information is selected as information policy
  • Added PIMCTSMetrics class

@hopshackle hopshackle self-requested a review November 3, 2025 15:00
Copy link
Collaborator

@hopshackle hopshackle left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good - I;m being a bit fussy with some suggested changes.
The main one is that we should not have Perfect_Information as a new enum on Information, but just add a new parameter (num_determinizations) that extends the current Open_Loop / Closed_Loop information enums.

A secondary point is some refactoring of PISingleTreeNode to change its name, and streamline bits of the code.


public enum Information {
Closed_Loop, Open_Loop, Information_Set
Closed_Loop, Open_Loop, Information_Set, Perfect_Information
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need a separate enum here. Isn;t this the same as Open_Loop (with a default of 1 determinisation)

root = SingleTreeNode.createRootNode(this, gameState, rnd, getFactory());
else {
if(getParameters().information == MCTSEnums.Information.Perfect_Information)
{
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This then is if num_determinisations > 1

import static players.PlayerConstants.*;

public class PISingleTreeNode extends SingleTreeNode {
SingleTreeNode[] roots;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A better name for this would be ForestNode (or something that indicates it constructs a number of different trees, and then aggregates results across them)

int numDeterminizations = 1;
MCTSPlayer mctsPlayer;
double epsilon = 1e-6;
//Action Stats variable to hold aggregated values
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use the value from MCTSParams

roots[i].mctsSearch(initialisationTime);
}
}
//Returns the best action after search based on the chosen AggrergationPolicy
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I reckon we can rely on the mctsSearch in the SingleTreeNode for this (and reduce code repetition a little)

else
root = SingleTreeNode.createRootNode(this, gameState, rnd, getFactory());
else {
if(getParameters().information == MCTSEnums.Information.Perfect_Information)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, this doesn't take account of reuseTree (not the end of the world, but I wonder if we could implement this)

SingleTreeNode[] roots;
AbstractGameState state;
int numDeterminizations = 1;
MCTSPlayer mctsPlayer;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We shoudl just read this directly from Params

{
root = new PISingleTreeNode(this, gameState, rnd);
}
else {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A better form might be:
root = ForestNode.createRootNode(...) to keep the same pattern as for SingleTree node a couple of lines below [and then I can go an refactor MultiTreeNode to the same pattern]

}

public enum PerfectInformationPolicy{
SingleVote, TotalValue, AverageValue, TotalVisits
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also - remove the TotalValue code, as we know it is a bit theoretically suspect

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants