[−][src]Trait ggpf::policies::mcts::BaseMCTSPolicy
Interface used to write a policy as an MCTS policy.
Associated Types
type NodeInfo: Debug + Clone + Copy + Send + Sync
Additional node statistics.
type MoveInfo: Debug + Clone + Copy + Send + Sync
Additional move statistics.
type PlayoutInfo: Send + Sync
Informations generated by a playout.
Required methods
fn get_value(
&self,
board: &G,
action: &G::Move,
node_info: &Self::NodeInfo,
move_info: &Self::MoveInfo,
exploration: bool
) -> f32
&self,
board: &G,
action: &G::Move,
node_info: &Self::NodeInfo,
move_info: &Self::MoveInfo,
exploration: bool
) -> f32
Get value associated to a node.
This value should be relative to the current player, it will be maximized by the selection process.
fn default_node(&self, board: &G) -> Self::NodeInfo
Default node statistics for a given state.
fn default_move(&self, board: &G, action: &G::Move) -> Self::MoveInfo
Default move statistics for a given state.
fn backpropagate(
&mut self,
leaf: MCTSNodeChild<G, Self>,
history: &[G::Move],
playout: Self::PlayoutInfo
)
&mut self,
leaf: MCTSNodeChild<G, Self>,
history: &[G::Move],
playout: Self::PlayoutInfo
)
Backpropagate playout information.
Params
leaf
: the newly created node by expansion, it can be used to propagate playout information.history
: the list of selected moves until leaf.playout
: playout information generated bysimulate
.
#[must_use]fn simulate<'life0, 'life1, 'async_trait>(
&'life0 self,
board: &'life1 G
) -> Pin<Box<dyn Future<Output = Self::PlayoutInfo> + Send + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
&'life0 self,
board: &'life1 G
) -> Pin<Box<dyn Future<Output = Self::PlayoutInfo> + Send + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
Generate playout information starting from board.
Implementors
impl<G> BaseMCTSPolicy<G> for PUCTPolicy_<G> where
G: Features + MCTSGame,
[src]
G: Features + MCTSGame,
type NodeInfo = PUCTNodeInfo
type MoveInfo = PUCTMoveInfo
type PlayoutInfo = (Option<HashMap<<G as Base>::Move, f32>>, f32, <G as Game>::Player)
fn get_value(
&self,
_board: &G,
_action: &G::Move,
node_info: &Self::NodeInfo,
move_info: &Self::MoveInfo,
exploration: bool
) -> f32
[src]
&self,
_board: &G,
_action: &G::Move,
node_info: &Self::NodeInfo,
move_info: &Self::MoveInfo,
exploration: bool
) -> f32
fn default_move(&self, _board: &G, _action: &G::Move) -> Self::MoveInfo
[src]
fn default_node(&self, _board: &G) -> Self::NodeInfo
[src]
fn backpropagate(
&mut self,
leaf: Arc<RwLock<MCTSTreeNode<G, Self>>>,
_history: &[G::Move],
(policy, value, pov): Self::PlayoutInfo
)
[src]
&mut self,
leaf: Arc<RwLock<MCTSTreeNode<G, Self>>>,
_history: &[G::Move],
(policy, value, pov): Self::PlayoutInfo
)
fn simulate<'life0, 'life1, 'async_trait>(
&'life0 self,
board: &'life1 G
) -> Pin<Box<dyn Future<Output = Self::PlayoutInfo> + Send + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
[src]
&'life0 self,
board: &'life1 G
) -> Pin<Box<dyn Future<Output = Self::PlayoutInfo> + Send + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
impl<G> BaseMCTSPolicy<G> for UCTPolicy_<G> where
G::Move: Send,
G: MCTSGame + SingleWinner,
[src]
G::Move: Send,
G: MCTSGame + SingleWinner,
type NodeInfo = UCTNodeInfo
type MoveInfo = UCTMoveInfo
type PlayoutInfo = bool
fn get_value(
&self,
board: &G,
_action: &G::Move,
node_info: &Self::NodeInfo,
move_info: &Self::MoveInfo,
exploration: bool
) -> f32
[src]
&self,
board: &G,
_action: &G::Move,
node_info: &Self::NodeInfo,
move_info: &Self::MoveInfo,
exploration: bool
) -> f32
fn default_node(&self, _board: &G) -> Self::NodeInfo
[src]
fn default_move(&self, _board: &G, _action: &G::Move) -> Self::MoveInfo
[src]
fn backpropagate(
&mut self,
leaf: Arc<RwLock<MCTSTreeNode<G, Self>>>,
_history: &[G::Move],
playout: Self::PlayoutInfo
)
[src]
&mut self,
leaf: Arc<RwLock<MCTSTreeNode<G, Self>>>,
_history: &[G::Move],
playout: Self::PlayoutInfo
)
fn simulate<'life0, 'life1, 'async_trait>(
&'life0 self,
board: &'life1 G
) -> Pin<Box<dyn Future<Output = Self::PlayoutInfo> + Send + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
[src]
&'life0 self,
board: &'life1 G
) -> Pin<Box<dyn Future<Output = Self::PlayoutInfo> + Send + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
impl<G: MCTSGame + SingleWinner> BaseMCTSPolicy<G> for RAVEPolicy_<G>
[src]
type NodeInfo = RAVENodeInfo
type MoveInfo = RAVEMoveInfo
type PlayoutInfo = (bool, Vec<G::Move>)
fn get_value(
&self,
board: &G,
_action: &G::Move,
node_info: &Self::NodeInfo,
move_info: &Self::MoveInfo,
_exploration: bool
) -> f32
[src]
&self,
board: &G,
_action: &G::Move,
node_info: &Self::NodeInfo,
move_info: &Self::MoveInfo,
_exploration: bool
) -> f32
fn default_node(&self, _board: &G) -> Self::NodeInfo
[src]
fn default_move(&self, _board: &G, _action: &G::Move) -> Self::MoveInfo
[src]
fn backpropagate(
&mut self,
leaf: Arc<RwLock<MCTSTreeNode<G, Self>>>,
history: &[G::Move],
(has_won, history_default): Self::PlayoutInfo
)
[src]
&mut self,
leaf: Arc<RwLock<MCTSTreeNode<G, Self>>>,
history: &[G::Move],
(has_won, history_default): Self::PlayoutInfo
)
fn simulate<'life0, 'life1, 'async_trait>(
&'life0 self,
board: &'life1 G
) -> Pin<Box<dyn Future<Output = Self::PlayoutInfo> + Send + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
[src]
&'life0 self,
board: &'life1 G
) -> Pin<Box<dyn Future<Output = Self::PlayoutInfo> + Send + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,