diff --git a/AIDojoCoordinator/coordinator.py b/AIDojoCoordinator/coordinator.py index 6850972b..92d07034 100644 --- a/AIDojoCoordinator/coordinator.py +++ b/AIDojoCoordinator/coordinator.py @@ -551,7 +551,7 @@ async def _process_reset_game_action(self, agent_addr: tuple, reset_action:Actio # add reset request for this agent self._reset_requests[agent_addr] = True # register if the agent wants to randomize the topology - self._randomize_topology_requests[agent_addr] = reset_action.parameters.get("randomize_topology", False) + self._randomize_topology_requests[agent_addr] = reset_action.parameters.get("randomize_topology", True) if all(self._reset_requests.values()): # all agents want reset - reset the world self.logger.debug(f"All agents requested reset, setting the event") diff --git a/AIDojoCoordinator/docs/Components.md b/AIDojoCoordinator/docs/Components.md index 1ac63276..bbe13c3d 100644 --- a/AIDojoCoordinator/docs/Components.md +++ b/AIDojoCoordinator/docs/Components.md @@ -61,7 +61,8 @@ ActionType is unique Enum that determines what kind of action is agent playing. ### List of actions - **JoinGame**, params={`agent_info`:AgentInfo(\, \)}: Used to register agent in a game with a given \. - **QuitGame**, params={}: Used for termination of agent's interaction. -- **ResetGame**, params={`request_trajectory`:`bool`}: Used for requesting reset of the game to it's initial position. If `request_trajectory = True`, the coordinator will send back the complete trajectory of the previous run in the next message. +- **ResetGame**, params={`request_trajectory`:`bool`(default=`False`), `randomize_topology`:`bool` (default=`False`)}: Used for requesting reset of the game to it's initial position. If `request_trajectory = True`, the coordinator will send back the complete trajectory of the previous run in the next message. +If `randomize_topology=True`, the agent requests randomization of IPs for the next episode. NOTE: randomization takes place only if all playing agents request it. --- - **ScanNetwork**, params{`source_host`:\, `target_network`:\}: Scans the given \ from a specified source host. Discovers ALL hosts in a network that are accessible from \. If successful, returns set of discovered \ objects. - **FindServices**, params={`source_host`:\, `target_host`:\}: Used to discover ALL services running in the `target_host` if the host is accessible from `source_host`. If successful, returns a set of all discovered \ objects. diff --git a/AIDojoCoordinator/docs/Coordinator.md b/AIDojoCoordinator/docs/Coordinator.md index bd7af93b..28a524fb 100644 --- a/AIDojoCoordinator/docs/Coordinator.md +++ b/AIDojoCoordinator/docs/Coordinator.md @@ -35,6 +35,7 @@ Coordinator, having the role of the middle man in all communication between the `self.agents`: information about connected agents {`agent address`: (`agent_name`,`agent_role`)} `self._agent_steps`: step counter for each agent in the current episode `self._reset_requests`: dictionary where requests for episode reset are collected (the world resets only if **all** active agents request reset) +`self._randomize_topology_requests`: dictionary where requests for topology randomization are collected (the world randomizes the topology only if **all** active agents request reset) `self._agent_observations`: current observation per agent `self._agent_starting_position`: starting position (with wildcards, see [configuration](../README.md#task-configuration)) per agent `self._agent_states`: current GameState per agent diff --git a/AIDojoCoordinator/netsecenv_conf.yaml b/AIDojoCoordinator/netsecenv_conf.yaml index 0c161d30..6fd52eb1 100644 --- a/AIDojoCoordinator/netsecenv_conf.yaml +++ b/AIDojoCoordinator/netsecenv_conf.yaml @@ -99,7 +99,7 @@ env: # random_seed: 42 scenario: 'scenario1' use_global_defender: False - use_dynamic_addresses: True + use_dynamic_addresses: False use_firewall: True save_trajectories: False required_players: 1