#2450 remove link refs and put nice naming convention instead

This commit is contained in:
Marek Wolan
2024-04-03 21:39:13 +01:00
parent c9a552b836
commit e99d238568
5 changed files with 59 additions and 84 deletions

View File

@@ -82,7 +82,7 @@ class LinkObservation(AbstractObservation, identifier="LINK"):
:return: Constructed link observation instance.
:rtype: LinkObservation
"""
link_reference = game.ref_map_links[config.link_reference]
link_reference = config.link_reference
if parent_where == []:
where = ["network", "links", link_reference]
else:

View File

@@ -111,9 +111,6 @@ class PrimaiteGame:
self.ref_map_applications: Dict[str, str] = {}
"""Mapping from human-readable application reference to application object. Used for parsing config files."""
self.ref_map_links: Dict[str, str] = {}
"""Mapping from human-readable link reference to link object. Used when parsing config files."""
self.save_step_metadata: bool = False
"""Whether to save the RL agents' action, environment state, and other data at every single step."""
@@ -409,8 +406,7 @@ class PrimaiteGame:
endpoint_b = node_b.network_interface[link_cfg["endpoint_b_port"]]
else:
endpoint_b = node_b.network_interface[link_cfg["endpoint_b_port"]]
new_link = net.connect(endpoint_a=endpoint_a, endpoint_b=endpoint_b)
game.ref_map_links[link_cfg["ref"]] = new_link.uuid
net.connect(endpoint_a=endpoint_a, endpoint_b=endpoint_b)
# 3. create agents
agents_cfg = cfg.get("agents", [])