gym_csle_stopping_game.dao package

Submodules

gym_csle_stopping_game.dao.stopping_game_attacker_mdp_config module

class gym_csle_stopping_game.dao.stopping_game_attacker_mdp_config.StoppingGameAttackerMdpConfig(env_name: str, stopping_game_config: gym_csle_stopping_game.dao.stopping_game_config.StoppingGameConfig, defender_strategy: csle_common.dao.training.policy.Policy, stopping_game_name: str = 'csle-stopping-game-v1')[source]

Bases: csle_common.dao.simulation_config.simulation_env_input_config.SimulationEnvInputConfig

DTO class representing the configuration of the MDP environnment of the attacker when facing a static defender policy

static from_dict(d: Dict[str, Any]) gym_csle_stopping_game.dao.stopping_game_attacker_mdp_config.StoppingGameAttackerMdpConfig[source]

Converts a dict representation to an instance

Parameters

d – the dict to convert

Returns

the created instance

static from_json_file(json_file_path: str) gym_csle_stopping_game.dao.stopping_game_attacker_mdp_config.StoppingGameAttackerMdpConfig[source]

Reads a json file and converts it to a DTO

Parameters

json_file_path – the json file path

Returns

the converted DTO

to_dict() Dict[str, Any][source]

Converts the object to a dict representation

Returns

a dict representation of the object

gym_csle_stopping_game.dao.stopping_game_config module

class gym_csle_stopping_game.dao.stopping_game_config.StoppingGameConfig(env_name: str, T: numpy.ndarray[Any, numpy.dtype[Any]], O: numpy.ndarray[Any, numpy.dtype[numpy.int64]], Z: numpy.ndarray[Any, numpy.dtype[Any]], R: numpy.ndarray[Any, numpy.dtype[Any]], S: numpy.ndarray[Any, numpy.dtype[numpy.int64]], A1: numpy.ndarray[Any, numpy.dtype[numpy.int64]], A2: numpy.ndarray[Any, numpy.dtype[numpy.int64]], L: int, R_INT: int, R_COST: int, R_SLA: int, R_ST: int, b1: numpy.ndarray[Any, numpy.dtype[numpy.float64]], save_dir: str, checkpoint_traces_freq: int, gamma: float = 1, compute_beliefs: bool = True, save_trace: bool = True)[source]

Bases: csle_common.dao.simulation_config.simulation_env_input_config.SimulationEnvInputConfig

DTO class containing the configuration of the stopping game

attacker_action_space() gymnasium.spaces.discrete.Discrete[source]
Returns

the attacker’s action space

attacker_observation_space() gymnasium.spaces.box.Box[source]
Returns

the attacker’s observation space

defender_action_space() gymnasium.spaces.discrete.Discrete[source]
Returns

the defender’s action space

defender_observation_space() gymnasium.spaces.box.Box[source]
Returns

the defender’s observation space

static from_dict(d: Dict[str, Any]) gym_csle_stopping_game.dao.stopping_game_config.StoppingGameConfig[source]

Converts a dict representation to an instance

Parameters

d – the dict to convert

Returns

the created instance

static from_json_file(json_file_path: str) gym_csle_stopping_game.dao.stopping_game_config.StoppingGameConfig[source]

Reads a json file and converts it to a DTO

Parameters

json_file_path – the json file path

Returns

the converted DTO

to_dict() Dict[str, Any][source]

Converts the object to a dict representation

Returns

a dict representation of the object

gym_csle_stopping_game.dao.stopping_game_defender_pomdp_config module

class gym_csle_stopping_game.dao.stopping_game_defender_pomdp_config.StoppingGameDefenderPomdpConfig(env_name: str, stopping_game_config: gym_csle_stopping_game.dao.stopping_game_config.StoppingGameConfig, attacker_strategy: csle_common.dao.training.policy.Policy, stopping_game_name: str = 'csle-stopping-game-v1')[source]

Bases: csle_common.dao.simulation_config.simulation_env_input_config.SimulationEnvInputConfig

DTO class representing the configuration of the POMDP environnment of the defender when facing a static attacker policy

static from_dict(d: Dict[str, Any]) gym_csle_stopping_game.dao.stopping_game_defender_pomdp_config.StoppingGameDefenderPomdpConfig[source]

Converts a dict representation to an instance

Parameters

d – the dict to convert

Returns

the created instance

static from_json_file(json_file_path: str) gym_csle_stopping_game.dao.stopping_game_defender_pomdp_config.StoppingGameDefenderPomdpConfig[source]

Reads a json file and converts it to a DTO

Parameters

json_file_path – the json file path

Returns

the converted DTO

to_dict() Dict[str, Any][source]

Converts the object to a dict representation

Returns

a dict representation of the object

gym_csle_stopping_game.dao.stopping_game_state module

class gym_csle_stopping_game.dao.stopping_game_state.StoppingGameState(b1: numpy.ndarray[Any, numpy.dtype[numpy.float64]], L: int)[source]

Bases: csle_base.json_serializable.JSONSerializable

Represents the state of the optimal stopping game

attacker_observation() numpy.ndarray[Any, numpy.dtype[Any]][source]
Returns

the attacker’s observation

defender_observation() numpy.ndarray[Any, numpy.dtype[Any]][source]
Returns

the defender’s observation

static from_dict(d: Dict[str, Any]) gym_csle_stopping_game.dao.stopping_game_state.StoppingGameState[source]

Converts a dict representation to an instance

Parameters

d – the dict to convert

Returns

the created instance

static from_json_file(json_file_path: str) gym_csle_stopping_game.dao.stopping_game_state.StoppingGameState[source]

Reads a json file and converts it to a DTO

Parameters

json_file_path – the json file path

Returns

the converted DTO

reset() None[source]

Resets the state

Returns

None

to_dict() Dict[str, Any][source]

Converts the object to a dict representation

Returns

a dict representation of the object

Module contents