# Pre-commit actions

This commit is contained in:
Charlie Crane
2025-02-14 11:39:25 +00:00
parent 7e138d1d61
commit 7b80d15d81
5 changed files with 5 additions and 8 deletions

View File

@@ -80,8 +80,7 @@ class AbstractAgent(BaseModel, ABC):
_registry: ClassVar[Dict[str, Type[AbstractAgent]]] = {}
def __init__(self, **kwargs):
"""Initialise and setup agent logger"""
"""Initialise and setup agent logger."""
super().__init__(**kwargs)
self.logger: AgentLog = AgentLog(agent_name=kwargs["config"]["ref"])

View File

@@ -163,7 +163,6 @@ class Network(SimComponent):
:param links: Include link details in the output. Defaults to True.
:param markdown: Use Markdown style in table output. Defaults to False.
"""
if nodes:
table = PrettyTable(["Node", "Type", "Operating State"])
if markdown:
@@ -192,8 +191,8 @@ class Network(SimComponent):
port.ip_address,
port.subnet_mask,
node.config.default_gateway,
]
)
]
)
print(table)
if links:

View File

@@ -20,7 +20,6 @@ from primaite.utils.validation.port import Port
if TYPE_CHECKING:
from primaite.simulator.system.core.software_manager import SoftwareManager
from primaite.simulator.network.hardware.base import Node
class SoftwareType(Enum):

View File

@@ -4,7 +4,7 @@ from primaite.game.agent.scripted_agents.random_agent import RandomAgent
def test_creating_empty_agent():
agent = RandomAgent(config={"ref" :"Empty Agent"})
agent = RandomAgent(config={"ref": "Empty Agent"})
assert len(agent.action_manager.action_map) == 0
assert isinstance(agent.observation_manager.obs, NullObservation)
assert len(agent.reward_function.reward_components) == 0