2023-07-21 14:54:09 +01:00
|
|
|
# © Crown-owned copyright 2023, Defence Science and Technology Laboratory UK
|
2023-05-25 11:42:19 +01:00
|
|
|
"""The Passive Node class (i.e. an actuator)."""
|
2023-05-25 21:03:11 +01:00
|
|
|
from primaite.common.enums import HardwareState, NodeType, Priority
|
2023-06-07 22:40:16 +01:00
|
|
|
from primaite.config.training_config import TrainingConfig
|
2023-05-25 10:31:37 +01:00
|
|
|
from primaite.nodes.node import Node
|
2023-03-28 17:33:34 +01:00
|
|
|
|
2023-05-25 11:42:19 +01:00
|
|
|
|
2023-03-28 17:33:34 +01:00
|
|
|
class PassiveNode(Node):
|
2023-07-06 16:08:51 +01:00
|
|
|
"""The Passive Node class."""
|
2023-03-28 17:33:34 +01:00
|
|
|
|
2023-05-25 21:03:11 +01:00
|
|
|
def __init__(
|
|
|
|
|
self,
|
|
|
|
|
node_id: str,
|
|
|
|
|
name: str,
|
|
|
|
|
node_type: NodeType,
|
|
|
|
|
priority: Priority,
|
|
|
|
|
hardware_state: HardwareState,
|
2023-06-07 22:40:16 +01:00
|
|
|
config_values: TrainingConfig,
|
2023-07-13 18:08:44 +01:00
|
|
|
) -> None:
|
2023-07-06 16:08:51 +01:00
|
|
|
"""
|
|
|
|
|
Initialise a passive node.
|
|
|
|
|
|
|
|
|
|
:param node_id: The node id.
|
|
|
|
|
:param name: The name of the node.
|
|
|
|
|
:param node_type: The type of the node.
|
|
|
|
|
:param priority: The priority of the node.
|
|
|
|
|
:param hardware_state: The state of the node.
|
|
|
|
|
:param config_values: Config values.
|
|
|
|
|
"""
|
2023-03-28 17:33:34 +01:00
|
|
|
# Pass through to Super for now
|
2023-06-30 16:52:57 +01:00
|
|
|
super().__init__(node_id, name, node_type, priority, hardware_state, config_values)
|
2023-03-28 17:33:34 +01:00
|
|
|
|
2023-05-25 21:03:11 +01:00
|
|
|
@property
|
|
|
|
|
def ip_address(self) -> str:
|
2023-07-07 10:28:00 +01:00
|
|
|
"""
|
|
|
|
|
Gets the node IP address as an empty string.
|
2023-05-25 21:03:11 +01:00
|
|
|
|
|
|
|
|
No concept of IP address for passive nodes for now.
|
2023-03-28 17:33:34 +01:00
|
|
|
|
2023-05-25 21:03:11 +01:00
|
|
|
:return: The node IP address.
|
2023-03-28 17:33:34 +01:00
|
|
|
"""
|
2023-05-25 11:42:19 +01:00
|
|
|
return ""
|