csle_tolerance.envs package

Submodules

csle_tolerance.envs.intrusion_recovery_pomdp_env module

class csle_tolerance.envs.intrusion_recovery_pomdp_env.IntrusionRecoveryPomdpEnv(config: csle_tolerance.dao.intrusion_recovery_pomdp_config.IntrusionRecoveryPomdpConfig)[source]

Bases: csle_common.dao.simulation_config.base_env.BaseEnv

Gym Environment representing the Intrusion recovery POMDP

action_space: spaces.Space[ActType]
get_traces() List[csle_common.dao.simulation_config.simulation_trace.SimulationTrace][source]
Returns

the list of simulation traces

manual_play() None[source]

An interactive loop to test the POMDP manually

Returns

None

observation_space: spaces.Space[ObsType]
render(mode: str = 'human')[source]

Renders the environment. Supported rendering modes: (1) human; and (2) rgb_array

Parameters

mode – the rendering mode

Returns

True (if human mode) otherwise an rgb array

reset(seed: Union[None, int] = None, soft: bool = False, options: Optional[Dict[str, Any]] = None) Tuple[List[Union[int, float]], Dict[str, Any]][source]

Resets the environment state, this should be called whenever step() returns <done>

Parameters
  • seed – the random seed

  • soft – boolean flag indicating whether it is a soft reset or not

  • options – optional configuration parameters

Returns

initial observation and info

reset_traces() None[source]

Resets the list of traces

Returns

None

set_model(model) None[source]

Sets the model. Useful when using RL frameworks where the stage policy is not easy to extract

Parameters

model – the model

Returns

None

set_state(state: int) None[source]

Sets the state. Allows to simulate samples from specific states

Parameters

state – the state

Returns

None

step(a: int) Tuple[List[Union[int, float]], float, bool, bool, Dict[str, Any]][source]

Takes a step in the environment by executing the given action

Parameters

a – the action

Returns

(obs, reward, terminated, truncated, info)

csle_tolerance.envs.intrusion_response_cmdp_env module

class csle_tolerance.envs.intrusion_response_cmdp_env.IntrusionResponseCmdpEnv(config: csle_tolerance.dao.intrusion_response_cmdp_config.IntrusionResponseCmdpConfig)[source]

Bases: csle_common.dao.simulation_config.base_env.BaseEnv

Gym Environment representing the intrusion response CMDP

action_space: spaces.Space[ActType]
get_traces() List[csle_common.dao.simulation_config.simulation_trace.SimulationTrace][source]
Returns

the list of simulation traces

manual_play() None[source]

An interactive loop to test the CMDP manually

Returns

None

observation_space: spaces.Space[ObsType]
render(mode: str = 'human')[source]

Renders the environment. Supported rendering modes: (1) human; and (2) rgb_array

Parameters

mode – the rendering mode

Returns

True (if human mode) otherwise an rgb array

reset(seed: Union[None, int] = None, soft: bool = False, options: Optional[Dict[str, Any]] = None) Tuple[int, Dict[str, Any]][source]

Resets the environment state, this should be called whenever step() returns <done>

Parameters
  • seed – the random seed

  • soft – boolean flag indicating whether it is a soft reset or not

  • options – optional configuration parameters

Returns

initial observation and info

reset_traces() None[source]

Resets the list of traces

Returns

None

set_model(model) None[source]

Sets the model. Useful when using RL frameworks where the stage policy is not easy to extract

Parameters

model – the model

Returns

None

set_state(state: int) None[source]

Sets the state. Allows to simulate samples from specific states

Parameters

state – the state

Returns

None

step(a: int) Tuple[int, float, bool, bool, Dict[str, Any]][source]

Takes a step in the environment by executing the given action

Parameters

a – the action

Returns

(obs, reward, terminated, truncated, info)

Module contents