PrismSimulator

class PrismSimulator(program, seed=None, options=None)

Bases: Simulator

Simulator on top of Prism programs. Uses the simulator based on the next-state generator and explores the state space on-the-fly.

Parameters:
  • program – Prism program.

  • seed – (optional) Seed of the random generator.

  • options – (optional) Builder options.

available_actions()

Returns an iterable over the available actions. The action mode may be used to select how actions are referred to.

Returns:

get_reward_names()
is_done()

Is the simulator in a sink state?

Returns:

Yes, if the simulator is in a sink state.

nr_available_actions()

Returns the number of available actions

Returns:

random_step()
restart(state=None)

Reset the simulator to the initial state

set_action_mode(mode)

Select the action mode, that is, how the actions are represented

Parameters:

mode – SimulatorActionMode.INDEX_LEVEL or SimulatorActionMode.GLOBAL_NAMES

Returns:

set_full_observability(value)

Sets whether the full state space is observable. Default inherited from the model, but this method overrides the setting.

Parameters:

value

set_observation_mode(mode)

Select the observation mode, that is, how the states are represented

Parameters:

mode – STATE_LEVEL or PROGRAM_LEVEL

set_seed(value)
step(action=None)

Do a step taking the passed action.

Parameters:

action – The index of the action, for deterministic actions, action may be None.

Returns:

The observation (on state or program level).