Skip to content

Latest commit

 

History

History
32 lines (23 loc) · 905 Bytes

state_is_simultaneous_node.md

File metadata and controls

32 lines (23 loc) · 905 Bytes

OpenSpiel state methods: is_simultaneous_node

Back to Core API reference

is_simultaneous_node()

Returns True if the state represents a simultaneous player node (where all players act simultaneously), False otherwise.

Examples:

import pyspiel

game = pyspiel.load_game("tic_tac_toe")
state = game.new_initial_state()
print(state.is_simultaneous_node())    # Output: False

game = pyspiel.load_game("matrix_mp")
state = game.new_initial_state()
print(state.is_simultaneous_node())    # Output: True

# Simultaneous-move game that start at a chance node.
game = pyspiel.load_game("markov_soccer")
state = game.new_initial_state()
print(state.is_simultaneous_node())    # Output: False
print(state.legal_actions())
state.apply_action(state.legal_actions()[0])   # Apply first legal chance outcome.
print(state.is_simultaneous_node())    # Output: True