Phase
from dgisim import Phase
Phase is an abstract class.
- class Phase
Phase defines how GameState make state transitions under this phase.
This class doesn’t store any data, so all instances of Phase (of the same class) are considered equal and have the same hash.
- abstract action_generator(game_state: GameState, pid: Pid) None | ActionGenerator
- Returns:
an action generator for player pid under game_state. None is returned if the player is not allowed to make a move.
- abstract step(game_state: GameState) GameState
- Returns:
the next game state after one state transition from game_state.
This method defines how state transition is performed. (transtion without player action)
- abstract step_action(game_state: GameState, pid: Pid, action: PlayerAction) None | GameState
- Parameters:
game_state – current game state.
pid – player of action.
action – the action of player.
- Returns:
the next game state after one state transition from game_state.
This method defines how state transition is performed. (transtion with player action)