# Pre-commit actions
This commit is contained in:
@@ -52,4 +52,4 @@ class Router(NetworkNode, identifier="router"):
|
|||||||
Changes to YAML file.
|
Changes to YAML file.
|
||||||
=====================
|
=====================
|
||||||
|
|
||||||
While effort has been made to ensure that nodes defined within configuration YAML files for use with PrimAITE 3.X remain compatible with PrimAITE v4+, it is encouraged to review for minor changes needed.
|
While effort has been made to ensure that nodes defined within configuration YAML files for use with PrimAITE 3.X remain compatible with PrimAITE v4+, it is encouraged to review for minor changes needed.
|
||||||
|
|||||||
@@ -80,8 +80,7 @@ class AbstractAgent(BaseModel, ABC):
|
|||||||
_registry: ClassVar[Dict[str, Type[AbstractAgent]]] = {}
|
_registry: ClassVar[Dict[str, Type[AbstractAgent]]] = {}
|
||||||
|
|
||||||
def __init__(self, **kwargs):
|
def __init__(self, **kwargs):
|
||||||
"""Initialise and setup agent logger"""
|
"""Initialise and setup agent logger."""
|
||||||
|
|
||||||
super().__init__(**kwargs)
|
super().__init__(**kwargs)
|
||||||
self.logger: AgentLog = AgentLog(agent_name=kwargs["config"]["ref"])
|
self.logger: AgentLog = AgentLog(agent_name=kwargs["config"]["ref"])
|
||||||
|
|
||||||
|
|||||||
@@ -163,7 +163,6 @@ class Network(SimComponent):
|
|||||||
:param links: Include link details in the output. Defaults to True.
|
:param links: Include link details in the output. Defaults to True.
|
||||||
:param markdown: Use Markdown style in table output. Defaults to False.
|
:param markdown: Use Markdown style in table output. Defaults to False.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
if nodes:
|
if nodes:
|
||||||
table = PrettyTable(["Node", "Type", "Operating State"])
|
table = PrettyTable(["Node", "Type", "Operating State"])
|
||||||
if markdown:
|
if markdown:
|
||||||
@@ -192,8 +191,8 @@ class Network(SimComponent):
|
|||||||
port.ip_address,
|
port.ip_address,
|
||||||
port.subnet_mask,
|
port.subnet_mask,
|
||||||
node.config.default_gateway,
|
node.config.default_gateway,
|
||||||
]
|
]
|
||||||
)
|
)
|
||||||
print(table)
|
print(table)
|
||||||
|
|
||||||
if links:
|
if links:
|
||||||
|
|||||||
@@ -20,7 +20,6 @@ from primaite.utils.validation.port import Port
|
|||||||
|
|
||||||
if TYPE_CHECKING:
|
if TYPE_CHECKING:
|
||||||
from primaite.simulator.system.core.software_manager import SoftwareManager
|
from primaite.simulator.system.core.software_manager import SoftwareManager
|
||||||
from primaite.simulator.network.hardware.base import Node
|
|
||||||
|
|
||||||
|
|
||||||
class SoftwareType(Enum):
|
class SoftwareType(Enum):
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ from primaite.game.agent.scripted_agents.random_agent import RandomAgent
|
|||||||
|
|
||||||
|
|
||||||
def test_creating_empty_agent():
|
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 len(agent.action_manager.action_map) == 0
|
||||||
assert isinstance(agent.observation_manager.obs, NullObservation)
|
assert isinstance(agent.observation_manager.obs, NullObservation)
|
||||||
assert len(agent.reward_function.reward_components) == 0
|
assert len(agent.reward_function.reward_components) == 0
|
||||||
|
|||||||
Reference in New Issue
Block a user