Merge branch 'dev' into feature/2266_network-focussed-dev-documentation

# Conflicts:
#	src/primaite/game/agent/observations/observations.py
This commit is contained in:
Chris McCarthy
2024-04-24 16:04:46 +01:00
42 changed files with 450 additions and 102 deletions

View File

@@ -227,6 +227,13 @@ class HostObservation(AbstractObservation, identifier="HOST"):
applications = [ApplicationObservation.from_config(config=c, parent_where=where) for c in config.applications]
folders = [FolderObservation.from_config(config=c, parent_where=where) for c in config.folders]
nics = [NICObservation.from_config(config=c, parent_where=where) for c in config.network_interfaces]
# If list of network interfaces is not defined, assume we want to
# monitor the first N interfaces. Network interface numbering starts at 1.
count = 1
while len(nics) < config.num_nics:
nic_config = NICObservation.ConfigSchema(nic_num=count, include_nmne=config.include_nmne)
nics.append(NICObservation.from_config(config=nic_config, parent_where=where))
count += 1
return cls(
where=where,

View File

@@ -1,6 +1,6 @@
"""Manages the observation space for the agent."""
from abc import ABC, abstractmethod
from typing import Any, Dict, Iterable, Type, Optional, Union
from typing import Any, Dict, Iterable, Optional, Type, Union
from gymnasium import spaces
from gymnasium.core import ObsType