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/base_agent.md
+1-2Lines changed: 1 addition & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,5 +3,4 @@ The `BaseAgent` class provides the foundational interface for all agents interac
3
3
4
4
All custom agents should extend this class and implement their decision-making logic by overriding a method like `choose_action` (see [Getting Started](getting_started.md#creating-your-first-agent) for an example).
The `ParallelBaseAgent` class extends the concepts of the base agent to manage connections to multiple NetSecGame server instances simultaneously, enabling parallel environment interaction.
4
+
5
+
Unlike `BaseAgent` (which manages a single socket), this class maintains one TCP socket per environment and exposes vectorized versions of methods like `register()`, `make_step()`, and `request_game_reset()` that operate on lists of actions and observations.
"""Register in all connected environments in parallel.
368
367
369
368
Returns:
370
-
In single-env mode: the initial ``Observation`` (or ``None``).
371
-
In multi-env mode: list of initial observations, positionally
372
-
aligned with ``game_ports``.
369
+
The initial ``Observation`` (or ``None``) in single-env mode, or a list of initial observations positionally aligned with ``game_ports`` in multi-env mode.
"""Execute one step in every **active** environment in parallel.
385
382
383
+
*Note: If you need to access the boolean done statuses across
384
+
all environments, you can use the `self.done_mask` property.*
385
+
386
386
Args:
387
387
actions: In single-env mode a single ``Action``; in multi-env
388
388
mode a list of ``Action`` objects (one per environment).
389
389
Actions at indices where the done mask is ``True`` are
390
390
**ignored** (no message is sent to that env).
391
391
392
392
Returns:
393
-
In single-env mode: a single ``Observation | None``.
394
-
In multi-env mode: list of observations positionally aligned
395
-
with ``game_ports``.
396
-
397
-
*Note: If you need to access the boolean done statuses across
398
-
all environments, you can use the `self.done_mask` property.*
393
+
A single ``Observation | None`` in single-env mode, or a list of observations positionally aligned with ``game_ports`` in multi-env mode.
399
394
400
395
Raises:
401
396
ValueError: If the number of actions doesn't match ``num_envs``.
@@ -444,9 +439,7 @@ def request_game_reset(
444
439
seed: RNG seed. Required when ``randomize_topology`` is True.
445
440
446
441
Returns:
447
-
In single-env mode: the initial ``Observation`` (or ``None``).
448
-
In multi-env mode: list of initial observations, positionally
449
-
aligned with ``game_ports``.
442
+
The initial ``Observation`` (or ``None``) in single-env mode, or a list of initial observations positionally aligned with ``game_ports`` in multi-env mode.
0 commit comments