Skip to content

Commit 4ec1b5e

Browse files
authored
Merge pull request #354 from stratosphereips/ondra-make-the-env-backward-copmatible
Ondra make the env backward copmatible
2 parents db9e45b + bb787ad commit 4ec1b5e

File tree

4 files changed

+5
-3
lines changed

4 files changed

+5
-3
lines changed

AIDojoCoordinator/coordinator.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -551,7 +551,7 @@ async def _process_reset_game_action(self, agent_addr: tuple, reset_action:Actio
551551
# add reset request for this agent
552552
self._reset_requests[agent_addr] = True
553553
# register if the agent wants to randomize the topology
554-
self._randomize_topology_requests[agent_addr] = reset_action.parameters.get("randomize_topology", False)
554+
self._randomize_topology_requests[agent_addr] = reset_action.parameters.get("randomize_topology", True)
555555
if all(self._reset_requests.values()):
556556
# all agents want reset - reset the world
557557
self.logger.debug(f"All agents requested reset, setting the event")

AIDojoCoordinator/docs/Components.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,8 @@ ActionType is unique Enum that determines what kind of action is agent playing.
6161
### List of actions
6262
- **JoinGame**, params={`agent_info`:AgentInfo(\<name\>, \<role\>)}: Used to register agent in a game with a given \<role\>.
6363
- **QuitGame**, params={}: Used for termination of agent's interaction.
64-
- **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.
64+
- **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.
65+
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.
6566
---
6667
- **ScanNetwork**, params{`source_host`:\<IP\>, `target_network`:\<Network\>}: Scans the given \<Network\> from a specified source host. Discovers ALL hosts in a network that are accessible from \<IP\>. If successful, returns set of discovered \<IP\> objects.
6768
- **FindServices**, params={`source_host`:\<IP\>, `target_host`:\<IP\>}: 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 \<Service\> objects.

AIDojoCoordinator/docs/Coordinator.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ Coordinator, having the role of the middle man in all communication between the
3535
`self.agents`: information about connected agents {`agent address`: (`agent_name`,`agent_role`)}
3636
`self._agent_steps`: step counter for each agent in the current episode
3737
`self._reset_requests`: dictionary where requests for episode reset are collected (the world resets only if **all** active agents request reset)
38+
`self._randomize_topology_requests`: dictionary where requests for topology randomization are collected (the world randomizes the topology only if **all** active agents request reset)
3839
`self._agent_observations`: current observation per agent
3940
`self._agent_starting_position`: starting position (with wildcards, see [configuration](../README.md#task-configuration)) per agent
4041
`self._agent_states`: current GameState per agent

AIDojoCoordinator/netsecenv_conf.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ env:
9999
# random_seed: 42
100100
scenario: 'scenario1'
101101
use_global_defender: False
102-
use_dynamic_addresses: True
102+
use_dynamic_addresses: False
103103
use_firewall: True
104104
save_trajectories: False
105105
required_players: 1

0 commit comments

Comments
 (0)