gym_csle_apt_game.dao package
Submodules
gym_csle_apt_game.dao.apt_game_attacker_mdp_config module
- class gym_csle_apt_game.dao.apt_game_attacker_mdp_config.AptGameAttackerMdpConfig(env_name: str, apt_game_config: gym_csle_apt_game.dao.apt_game_config.AptGameConfig, defender_strategy: csle_common.dao.training.policy.Policy, apt_game_name: str = 'csle-apt-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_apt_game.dao.apt_game_attacker_mdp_config.AptGameAttackerMdpConfig [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_apt_game.dao.apt_game_attacker_mdp_config.AptGameAttackerMdpConfig [source]
Reads a json file and converts it to a DTO
- Parameters
json_file_path – the json file path
- Returns
the converted DTO
gym_csle_apt_game.dao.apt_game_config module
- class gym_csle_apt_game.dao.apt_game_config.AptGameConfig(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]], C: 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]], b1: numpy.ndarray[Any, numpy.dtype[numpy.float64]], N: int, p_a: float, save_dir: str, checkpoint_traces_freq: int, gamma: float = 1)[source]
Bases:
csle_common.dao.simulation_config.simulation_env_input_config.SimulationEnvInputConfig
DTO class containing the configuration of the APT 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_apt_game.dao.apt_game_config.AptGameConfig [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_apt_game.dao.apt_game_config.AptGameConfig [source]
Reads a json file and converts it to a DTO
- Parameters
json_file_path – the json file path
- Returns
the converted DTO
gym_csle_apt_game.dao.apt_game_defender_pomdp_config module
- class gym_csle_apt_game.dao.apt_game_defender_pomdp_config.AptGameDefenderPomdpConfig(env_name: str, apt_game_config: gym_csle_apt_game.dao.apt_game_config.AptGameConfig, attacker_strategy: csle_common.dao.training.policy.Policy, apt_game_name: str = 'csle-apt-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_apt_game.dao.apt_game_defender_pomdp_config.AptGameDefenderPomdpConfig [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_apt_game.dao.apt_game_defender_pomdp_config.AptGameDefenderPomdpConfig [source]
Reads a json file and converts it to a DTO
- Parameters
json_file_path – the json file path
- Returns
the converted DTO
gym_csle_apt_game.dao.apt_game_state module
- class gym_csle_apt_game.dao.apt_game_state.AptGameState(b1: numpy.ndarray[Any, numpy.dtype[numpy.float64]])[source]
Bases:
csle_base.json_serializable.JSONSerializable
Represents the state of the optimal APT game
- attacker_observation() Tuple[numpy.ndarray[Any, numpy.dtype[Any]], int] [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_apt_game.dao.apt_game_state.AptGameState [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_apt_game.dao.apt_game_state.AptGameState [source]
Reads a json file and converts it to a DTO
- Parameters
json_file_path – the json file path
- Returns
the converted DTO