You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/Coordinator.md
+20-29Lines changed: 20 additions & 29 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,16 +2,29 @@
2
2
Coordinator is the centerpiece of the game orchestration. It provides an interface between the agents and the AIDojo world.
3
3
4
4
1. Registration of new agents in the game
5
-
2. Verification of agents' actionf format
5
+
2. Verification of agents' action format
6
6
3. Recording (and storing) trajectories of agents
7
7
4. Detection of episode ends (either by reaching timout or agents reaching their respective goals)
8
8
5. Assigning rewards for each action and at the end of each episode
9
9
6. Removing agents from the game
10
10
7. Registering the GameReset requests and handelling the game resets.
11
11
12
+
## Connction to other game components
13
+
Coordinator, having the role of the middle man in all communication between the agent and the world uses several queues for massing passing and handelling.
14
+
15
+
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.
16
+
2.`Answer queue` is a separeate queue **per agent** in which the results of the actions are send to the agent.
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)
`self._actions_queue`: asycnio queue for agent -> aidojo_world communication
14
-
`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
15
28
`self.ALLOWED_ROLES`: list of allowed agent roles [`Attacker`, `Defender`, `Benign`]
16
29
`self._world`: Instance of `AIDojoWorld`. Implements the dynamics of the world
17
30
`self._CONFIG_FILE_HASH`: hash of the configuration file used in the interaction (scenario, topology, etc.). Used for better reproducibility of results
@@ -24,33 +37,11 @@ Coordinator is the centerpiece of the game orchestration. It provides an interfa
24
37
### Agent information components
25
38
`self.agents`: information about connected agents {`agent address`: (`agent_name`,`agent_role`)}
26
39
`self._agent_steps`: step counter for each agent in the current episode
27
-
`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)
28
41
`self._agent_observations`: current observation per agent
29
42
`self._agent_starting_position`: starting position (with wildcards, see [configuration](../README.md#task-configuration)) per agent
30
43
`self._agent_states`: current GameState per agent
31
-
`self._agent_statuses`: status of each agent. One of following options:
32
-
- `playing`: agent is registered and can participate in current episode. Can't influence the episode termination
33
-
- `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
34
-
- `goal_reached`: agent has reached it's goal in this episode. It can't perform any more actions until the interaction is resetted.
35
-
- `blocked`: agent has been blocked. It can't perform any more actions until the interaction is resetted.
36
-
- `max_steps`: agent has reached it's maximum allowed steps. It can't perform any more actions until the interaction is resetted.
37
-
38
-
44
+
`self._agent_last_action`: last Action per agent
45
+
`self._agent_statuses`: status of each agent. One of AgentStatus
39
46
`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.
40
-
`self._agent_trajectories`: complete trajectories for each agent in the ongoing episode
41
-
42
-
## The format of the messages to the agents is
43
-
{
44
-
"to_agent": address of client,
45
-
"status": {
46
-
"#players": number of players,
47
-
"running": true or false,
48
-
"time": time in game,
49
-
} ,
50
-
"message": Generic text messages (optional),
51
-
"state": (optional) {
52
-
"observation": observation_object,
53
-
"ended": if the game ended or not,
54
-
"reason": reason for ending
55
-
}
56
-
}
47
+
`self._agent_trajectories`: complete trajectories for each agent in the ongoing episode
0 commit comments