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
- 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
- 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
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
- 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
- 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