#1355 - Renamed the NodeType custom type in custom_typing.py as it clased with the NodeType enum in enums.py

This commit is contained in:
Chris McCarthy
2023-05-26 09:43:37 +01:00
parent 32a4d9e459
commit b62ea525e9
4 changed files with 12 additions and 12 deletions

View File

@@ -15,7 +15,7 @@ from gym import Env, spaces
from matplotlib import pyplot as plt
from primaite.acl.access_control_list import AccessControlList
from primaite.common.custom_typing import NodeType
from primaite.common.custom_typing import NodeUnion
from primaite.common.enums import (
ActionType,
FileSystemState,
@@ -80,10 +80,10 @@ class Primaite(Env):
self.agent_identifier = self.config_values.agent_identifier
# Create a dictionary to hold all the nodes
self.nodes: Dict[str, NodeType] = {}
self.nodes: Dict[str, NodeUnion] = {}
# Create a dictionary to hold a reference set of nodes
self.nodes_reference: Dict[str, NodeType] = {}
self.nodes_reference: Dict[str, NodeUnion] = {}
# Create a dictionary to hold all the links
self.links: Dict[str, Link] = {}
@@ -1128,7 +1128,7 @@ class Primaite(Env):
node_class = item["node_class"]
node_hardware_state: HardwareState = HardwareState[item["hardware_state"]]
node: NodeType = self.nodes[node_id]
node: NodeUnion = self.nodes[node_id]
node_ref = self.nodes_reference[node_id]
# Reset the hardware state (common for all node types)