Skip to content

Commit 60e18fc

Browse files
committed
Update docs
1 parent d3029a8 commit 60e18fc

File tree

1 file changed

+11
-29
lines changed

1 file changed

+11
-29
lines changed

docs/Coordinator.md

Lines changed: 11 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,17 @@ Coordinator, having the role of the middle man in all communication between the
1414

1515
1. `Actions queue` is a queue in which the agents submit their actions. It provides N:1 communication channel in which the coordinator receives the inputs.
1616
2. `Answer queue` is a separeate queue **per agent** in which the results of the actions are send to the agent.
17-
3.
17+
3. `World action queue` is a queue used for sending the acions from coordinator to the AI Dojo world
18+
4. `World response queue` is a channel used for wolrd -> coordinator communicaiton (responses to the agents' action)
1819
<img src="/docs/figures/message_passing_coordinator.jpg" alt="Message passing overview" width="30%"/>
1920

2021

2122
## Main components of the coordinator
22-
`self._actions_queue`: asycnio queue for agent -> aidojo_world communication
23-
`self._answers_queue`: asycnio queue for aidojo_world -> agent communication
23+
`self._actions_queue`: asycnio queue for agents -> coordinator communication
24+
`self._answer_queues`: dictionary of asycnio queues for coordinator -> agent communication (1 queue per agent)
25+
`self._world_action_queue`: asycnio queue for coordinator -> world queue communication
26+
`self._world_response_queue`: asycnio queue for world -> coordinator queue communication
27+
`self.task_config`: Object with the configuration of the scenario
2428
`self.ALLOWED_ROLES`: list of allowed agent roles [`Attacker`, `Defender`, `Benign`]
2529
`self._world`: Instance of `AIDojoWorld`. Implements the dynamics of the world
2630
`self._CONFIG_FILE_HASH`: hash of the configuration file used in the interaction (scenario, topology, etc.). Used for better reproducibility of results
@@ -33,33 +37,11 @@ Coordinator, having the role of the middle man in all communication between the
3337
### Agent information components
3438
`self.agents`: information about connected agents {`agent address`: (`agent_name`,`agent_role`)}
3539
`self._agent_steps`: step counter for each agent in the current episode
36-
`self._reset_requests`: dictionary where requests for episode reset are collected (the world resets only if ALL agents request reset)
40+
`self._reset_requests`: dictionary where requests for episode reset are collected (the world resets only if **all** active agents request reset)
3741
`self._agent_observations`: current observation per agent
3842
`self._agent_starting_position`: starting position (with wildcards, see [configuration](../README.md#task-configuration)) per agent
3943
`self._agent_states`: current GameState per agent
40-
`self._agent_statuses`: status of each agent. One of following options:
41-
- `playing`: agent is registered and can participate in current episode. Can't influence the episode termination
42-
- `playing_active`: agent is registered and can participate in current episode. It has `goal` and `max_steps` defined and can influence the termination of the episode
43-
- `goal_reached`: agent has reached it's goal in this episode. It can't perform any more actions until the interaction is resetted.
44-
- `blocked`: agent has been blocked. It can't perform any more actions until the interaction is resetted.
45-
- `max_steps`: agent has reached it's maximum allowed steps. It can't perform any more actions until the interaction is resetted.
46-
47-
44+
`self._agent_last_action`: last Action per agent
45+
`self._agent_statuses`: status of each agent. One of AgentStatus
4846
`self._agent_rewards`: dictionary of final reward of each agent in the current episod. Only agent's which can't participate in the ongoing episode are listed.
49-
`self._agent_trajectories`: complete trajectories for each agent in the ongoing episode
50-
51-
## The format of the messages to the agents is
52-
{
53-
"to_agent": address of client,
54-
"status": {
55-
"#players": number of players,
56-
"running": true or false,
57-
"time": time in game,
58-
} ,
59-
"message": Generic text messages (optional),
60-
"state": (optional) {
61-
"observation": observation_object,
62-
"ended": if the game ended or not,
63-
"reason": reason for ending
64-
}
65-
}
47+
`self._agent_trajectories`: complete trajectories for each agent in the ongoing episode

0 commit comments

Comments
 (0)