flatland.envs.step_utils.state_machine module#
- class flatland.envs.step_utils.state_machine.TrainStateMachine#
Bases:
object- calculate_next_state(current_state)#
- static can_get_moving_independent(state: TrainState, in_malfunction: bool, movement_action_given: bool, new_speed: float, stop_action_given: bool)#
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)
- clear_next_state()#
- static from_dict(load_dict) TrainStateMachine#
- next_state#
- previous_state#
- reset()#
- set_state(state)#
- set_transition_signals(state_transition_signals)#
- st_signals#
- state#
- state_position_sync_check(configuration, i_agent, remove_agents_at_target)#
Check for whether on map and off map states are matching with position being None
- state_transition_signals#
- step()#
Steps the state machine to the next state
- to_dict()#
- update_if_reached(configuration, targets)#