base#

Classes#

class prt_sim.jhu.base.BaseEnvironment[source]#

Defines the environment interface for JHU simulations.

abstractmethod execute_action(action: int) Tuple[int, float, bool][source]#

Executes the agent’s action and steps the simulation.

Parameters:

action (int) – Action to execute

Returns:

Next state, reward, done

Return type:

Tuple[int, float, bool]

abstractmethod get_number_of_actions() int[source]#

Returns the number of actions in the environment.

Returns:

number of actions

Return type:

int

abstractmethod get_number_of_states() int[source]#

Returns the number of states in the environment.

Returns:

number of states

Return type:

int

render()[source]#

Renders the environment

abstractmethod reset(seed: int | None = None, randomize_start: bool | None = False) int[source]#

Resets the environment to the initial state.

Parameters:
  • seed (int, optional) – Random seed. Defaults to None.

  • randomize_start (bool, optional) – Whether to randomize the starting state. Not all environments will support this. Defaults to False.

Returns:

current state value

Return type:

int