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: README.md
+16-18Lines changed: 16 additions & 18 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,23 +1,25 @@
1
1
# NetSecGameAgents
2
-
Agents located in this repository should be use in the [Network Security Game](https://github.com/stratosphereips/NetSecGame) environment. They are intented for a navigation and problem solving in the adversarial network-security based environment where they play role of attackers or defenders.
2
+
Agents located in this repository should be used in the [Network Security Game](https://github.com/stratosphereips/NetSecGame) environment. They are intended for navigation and problem solving in the adversarial network-security based environment where they play the role of attackers or defenders.
3
3
4
4
## BaseAgent
5
-
All future agents should extend BaseAgent - a minimal implementation of agent capable of interaction with he environment. The base agent also implement logging capabilities for the agent via the `logging`module of python. The logger can be accessed by property `logger`.
5
+
All future agents should extend BaseAgent - a minimal implementation of agent capable of interaction with the environment. The base agent also implements logging capabilities for the agent via the `logging` python module. The logger can be accessed by property `logger`.
6
6
7
7
For creating an instance of a `BaseAgent`, three parameters have to be used:
8
-
1.`host:str` - URL where the game server runs
9
-
2.`port: int` - port number where game server runs
8
+
1.`host:str` - URL where the game server runs
9
+
2.`port: int` - port number where game server runs
10
10
3.`role: str` - Intended role of the agent. Options are `Attacker`, `Defender`, `Human`
11
11
12
-
When extending the `BaseAgent`, these args should be passed to in the constructor by calling:
13
-
```super().__init__(host, port, role)```
12
+
When extending the `BaseAgent`, these args should be passed to the constructor by calling:
13
+
```
14
+
super().__init__(host, port, role)
15
+
```
14
16
15
17
There are 4 important methods to be used for interaction with the environment:
16
18
17
-
1.`register()`: Should be used ONCE in the beginning of the interaction to register the agent in the game.
19
+
1.`register()`: Should be used ONCE at the beginning of the interaction to register the agent in the game.
18
20
- Uses the class name and `role` specified in the initialization for the registration in the game
19
21
- returns `Observation` which contains the status of the registration and the initial `GameState` if the registration was successful
20
-
2.`make_step(Action: action)`: Used for sending a`Action` object to be used as a next step of the agent. Returns `Observation` with new state fo the environment after the action was applied.
22
+
2.`make_step(Action: action)`: Used for sending an`Action` object to be used as a next step of the agent. Returns `Observation` with new state of the environment after the action was applied.
21
23
3.`request_game_reset()`: Used to RESET the state of the environment to its initial position (e.g. at the end of an episode). Returns `Observation` with state of the environment.
22
24
4.`terminate_connection()`: Should be used ONCE at the end of the interaction to properly disconnect the agent from the game server.
23
25
@@ -35,7 +37,7 @@ There are three types of roles an agent can play in NetSecEnv:
35
37
Agents of each type are stored in the corresponding directory within this repository:
36
38
```
37
39
├── agents
38
-
├── attakcers
40
+
├── attackers
39
41
├── concepts_q_learning
40
42
├── double_q_learning
41
43
├── gnn_reinforce
@@ -48,11 +50,11 @@ Agents of each type are stored in the corresponding directory within this reposi
48
50
├── benign_random
49
51
```
50
52
### Agent utils
51
-
Utility functions in [agent_utils.py](./agents/agent_utils.py) can be used by any agent to evaluate a `GameState`, generate set of valid `Actions` in a `GameState` etc.
53
+
Utility functions in [`agent_utils.py`](./agents/agent_utils.py) can be used by any agent to evaluate a `GameState`, and generate a set of valid `Actions` in a `GameState`, etc.
52
54
Additionally, there are several files with utils functions that can be used by any agents:
53
-
-`[agent_utils.py](./agents/agent_utils.py) Formatting GameState and generation of valid actions
Utility functions in [agent_utils.py](./agents/agent_utils.py) can be used by any agent to evaluate a `GameState`, generate set of valid `Actions` in a `GameState` etc.
73
-
74
73
## Export to mlflow
75
74
76
75
Every agent by default exports the experiment details to a local mlflow directory.
@@ -88,6 +87,5 @@ If you want to export the local mlflow to a remote mlflow you can use our util
This code was developed at the [Stratosphere Laboratory at the Czech Technical University in Prague](https://www.stratosphereips.org/) as part of the AIDojo Project.
91
+
This code was developed at the [Stratosphere Laboratory at the Czech Technical University in Prague](https://www.stratosphereips.org/) as part of the [AIDojo Project](https://www.stratosphereips.org/ai-dojo).
0 commit comments