flatland.envs.step_utils.state_machine module#
- class flatland.envs.step_utils.state_machine.TrainStateMachine(initial_state=TrainState.WAITING)[source]#
Bases:
object
- static can_get_moving_independent(state: TrainState, in_malfunction: bool, movement_action_given: bool, new_speed: float, stop_action_given: bool)[source]#
Incoming transitions to go into state MOVING (for motions to be checked - independently of other agents’ position): - keep MOVING unless (stop action given and reaches new speed is zero) or in malfunction - from MALFUNCTION: if not in malfunction (on or off map) any more and movement action given - from STOPPED: if movement action given and not in malfunction
Parameters#
state : TrainState in_malfunction : bool movement_action_given : bool new_speed : float stop_action_given : float
Returns#
Whether agents wants to move given its state (independently of other agents’ position)
- static from_dict(load_dict) TrainStateMachine [source]#
- property state#
- state_position_sync_check(position, i_agent, remove_agents_at_target)[source]#
Check for whether on map and off map states are matching with position being None
- property state_transition_signals#