Reference¶
- class poke_engine.IterativeDeepeningResult(side_one: list[str], side_two: list[str], matrix: list[float], depth_searched: int)¶
Result of an Iterative Deepening Expectiminimax Search
- Parameters:
side_one (list[str]) – The moves for side_one
side_two (list[str]) – The moves for side_two
matrix (int) – A vector representing the payoff matrix of the search. Pruned branches are represented by None
depth_searched (int) – The depth that was searched to
- get_safest_move() str¶
Get the safest move for side_one The safest move is the move that minimizes the loss for the turn
- Returns:
The safest move
- Return type:
str
- class poke_engine.MctsResult(side_one: list[MctsSideResult], side_two: list[MctsSideResult], total_visits: int)¶
Result of a Monte Carlo Tree Search
- Parameters:
side_one (list[MctsSideResult]) – Result for side one
side_two (list[MctsSideResult]) – Result for side two
total_visits (int) – Total number of monte carlo iterations
- class poke_engine.MctsSideResult(move_choice: str, total_score: float, visits: int)¶
Result of a Monte Carlo Tree Search for a single side
- Parameters:
move_choice (str) – The move that was chosen
total_score (float) – The total score of the chosen move
visits (int) – The number of times the move was chosen
- class poke_engine.PokemonIndex(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)¶
- class poke_engine.Terrain(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)¶
- class poke_engine.Weather(value, names=None, *, module=None, qualname=None, type=None, start=1, boundary=None)¶
- poke_engine.iterative_deepening_expectiminimax(state: State, duration_ms: int = 1000) IterativeDeepeningResult¶
Perform an iterative-deepening expectiminimax search on the given state and for the given duration
- Parameters:
state (State) – the state to search through
duration_ms (int) – time in milliseconds to run the search
- Returns:
the result of the search
- Return type:
- poke_engine.monte_carlo_tree_search(state: State, duration_ms: int = 1000, threads: int = 1) MctsResult¶
Perform monte-carlo-tree-search on the given state and for the given duration
- Parameters:
state (State) – the state to search through
duration_ms (int) – time in milliseconds to run the search
threads (int) – number of threads to use for the search
- Returns:
the result of the search
- Return type: