Standardise docstring summary line placement.
This commit is contained in:
@@ -25,7 +25,8 @@ def apply_iers(
|
||||
acl: AccessControlList,
|
||||
step: int,
|
||||
):
|
||||
"""Applies IERs to the links (link pattern of life).
|
||||
"""
|
||||
Applies IERs to the links (link pattern of life).
|
||||
|
||||
Args:
|
||||
network: The network modelled in the environment
|
||||
@@ -217,7 +218,8 @@ def apply_node_pol(
|
||||
node_pol: Dict[any, Union[NodeStateInstructionGreen, NodeStateInstructionRed]],
|
||||
step: int,
|
||||
):
|
||||
"""Applies node pattern of life.
|
||||
"""
|
||||
Applies node pattern of life.
|
||||
|
||||
Args:
|
||||
nodes: The nodes within the environment
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
# Crown Copyright (C) Dstl 2022. DEFCON 703. Shared in confidence.
|
||||
"""Information Exchange Requirements for APE.
|
||||
"""
|
||||
Information Exchange Requirements for APE.
|
||||
|
||||
Used to represent an information flow from source to destination.
|
||||
"""
|
||||
@@ -47,7 +48,8 @@ class IER(object):
|
||||
self.running = _running
|
||||
|
||||
def get_id(self):
|
||||
"""Gets IER ID.
|
||||
"""
|
||||
Gets IER ID.
|
||||
|
||||
Returns:
|
||||
IER ID
|
||||
@@ -55,7 +57,8 @@ class IER(object):
|
||||
return self.id
|
||||
|
||||
def get_start_step(self):
|
||||
"""Gets IER start step.
|
||||
"""
|
||||
Gets IER start step.
|
||||
|
||||
Returns:
|
||||
IER start step
|
||||
@@ -63,7 +66,8 @@ class IER(object):
|
||||
return self.start_step
|
||||
|
||||
def get_end_step(self):
|
||||
"""Gets IER end step.
|
||||
"""
|
||||
Gets IER end step.
|
||||
|
||||
Returns:
|
||||
IER end step
|
||||
@@ -71,7 +75,8 @@ class IER(object):
|
||||
return self.end_step
|
||||
|
||||
def get_load(self):
|
||||
"""Gets IER load.
|
||||
"""
|
||||
Gets IER load.
|
||||
|
||||
Returns:
|
||||
IER load
|
||||
@@ -79,7 +84,8 @@ class IER(object):
|
||||
return self.load
|
||||
|
||||
def get_protocol(self):
|
||||
"""Gets IER protocol.
|
||||
"""
|
||||
Gets IER protocol.
|
||||
|
||||
Returns:
|
||||
IER protocol
|
||||
@@ -87,7 +93,8 @@ class IER(object):
|
||||
return self.protocol
|
||||
|
||||
def get_port(self):
|
||||
"""Gets IER port.
|
||||
"""
|
||||
Gets IER port.
|
||||
|
||||
Returns:
|
||||
IER port
|
||||
@@ -95,7 +102,8 @@ class IER(object):
|
||||
return self.port
|
||||
|
||||
def get_source_node_id(self):
|
||||
"""Gets IER source node ID.
|
||||
"""
|
||||
Gets IER source node ID.
|
||||
|
||||
Returns:
|
||||
IER source node ID
|
||||
@@ -103,7 +111,8 @@ class IER(object):
|
||||
return self.source_node_id
|
||||
|
||||
def get_dest_node_id(self):
|
||||
"""Gets IER destination node ID.
|
||||
"""
|
||||
Gets IER destination node ID.
|
||||
|
||||
Returns:
|
||||
IER destination node ID
|
||||
@@ -111,7 +120,8 @@ class IER(object):
|
||||
return self.dest_node_id
|
||||
|
||||
def get_is_running(self):
|
||||
"""Informs whether the IER is currently running.
|
||||
"""
|
||||
Informs whether the IER is currently running.
|
||||
|
||||
Returns:
|
||||
True if running
|
||||
@@ -119,7 +129,8 @@ class IER(object):
|
||||
return self.running
|
||||
|
||||
def set_is_running(self, _value):
|
||||
"""Sets the running state of the IER.
|
||||
"""
|
||||
Sets the running state of the IER.
|
||||
|
||||
Args:
|
||||
_value: running status
|
||||
@@ -127,7 +138,8 @@ class IER(object):
|
||||
self.running = _value
|
||||
|
||||
def get_mission_criticality(self):
|
||||
"""Gets the IER mission criticality (used in the reward function).
|
||||
"""
|
||||
Gets the IER mission criticality (used in the reward function).
|
||||
|
||||
Returns:
|
||||
Mission criticality value (0 lowest to 5 highest)
|
||||
|
||||
@@ -24,7 +24,8 @@ def apply_red_agent_iers(
|
||||
acl: AccessControlList,
|
||||
step: int,
|
||||
):
|
||||
"""Applies IERs to the links (link POL) resulting from red agent attack.
|
||||
"""
|
||||
Applies IERs to the links (link POL) resulting from red agent attack.
|
||||
|
||||
Args:
|
||||
network: The network modelled in the environment
|
||||
@@ -213,7 +214,8 @@ def apply_red_agent_node_pol(
|
||||
node_pol: Dict[str, NodeStateInstructionRed],
|
||||
step: int,
|
||||
):
|
||||
"""Applies node pattern of life.
|
||||
"""
|
||||
Applies node pattern of life.
|
||||
|
||||
Args:
|
||||
nodes: The nodes within the environment
|
||||
@@ -295,7 +297,8 @@ def apply_red_agent_node_pol(
|
||||
|
||||
|
||||
def is_red_ier_incoming(node, iers, node_pol_type):
|
||||
"""Checks if the RED IER is incoming.
|
||||
"""
|
||||
Checks if the RED IER is incoming.
|
||||
|
||||
TODO: Write more descriptive docstring with params and returns.
|
||||
"""
|
||||
|
||||
Reference in New Issue
Block a user