Skip to main content

RankedBot

Trait RankedBot 

Source
pub trait RankedBot<G: Game> {
    // Required method
    fn rank(
        &mut self,
        game: &G,
        state: &G::State,
        player: PlayerId,
    ) -> Vec<(G::Action, f64)>;
}
Expand description

A bot that scores and ranks every available action, best first.

For hints, teaching, and debugging search. An opt-in extension to Bot: bots with no meaningful ranking (e.g. a uniform-random bot) simply do not implement it.

Required Methods§

Source

fn rank( &mut self, game: &G, state: &G::State, player: PlayerId, ) -> Vec<(G::Action, f64)>

Returns each legal action for player paired with its score, sorted best (highest score) first. Empty when there are no legal actions.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl<G> RankedBot<G> for Ismcts
where G: Determinize, G::State: Clone, G::Action: Clone,

Source§

impl<G> RankedBot<G> for Mcts
where G: Game, G::State: Clone, G::Action: Clone,

Source§

impl<G> RankedBot<G> for Minimax
where G: Game, G::State: Clone, G::Action: Clone,