#2459 Align whitespace and typing

This commit is contained in:
Marek Wolan
2024-04-15 12:40:50 +01:00
parent e876bb5d41
commit 72283e6184
2 changed files with 4 additions and 1 deletions

View File

@@ -26,7 +26,7 @@ the structure:
``` ```
""" """
from abc import abstractmethod from abc import abstractmethod
from typing import Callable, Dict, List, Optional, Tuple, Type, TYPE_CHECKING from typing import Callable, Dict, Iterable, List, Optional, Tuple, Type, TYPE_CHECKING
from typing_extensions import Never from typing_extensions import Never
@@ -37,6 +37,7 @@ if TYPE_CHECKING:
from primaite.game.agent.interface import AgentActionHistoryItem from primaite.game.agent.interface import AgentActionHistoryItem
_LOGGER = getLogger(__name__) _LOGGER = getLogger(__name__)
WhereType = Iterable[str | int] | None
class AbstractReward: class AbstractReward:

View File

@@ -411,6 +411,7 @@ class PrimaiteGame:
for link_cfg in links_cfg: for link_cfg in links_cfg:
node_a = net.get_node_by_hostname(link_cfg["endpoint_a_hostname"]) node_a = net.get_node_by_hostname(link_cfg["endpoint_a_hostname"])
node_b = net.get_node_by_hostname(link_cfg["endpoint_b_hostname"]) node_b = net.get_node_by_hostname(link_cfg["endpoint_b_hostname"])
if isinstance(node_a, Switch): if isinstance(node_a, Switch):
endpoint_a = node_a.network_interface[link_cfg["endpoint_a_port"]] endpoint_a = node_a.network_interface[link_cfg["endpoint_a_port"]]
else: else:
@@ -460,6 +461,7 @@ class PrimaiteGame:
reward_function=reward_function, reward_function=reward_function,
settings=settings, settings=settings,
) )
elif agent_type == "ProxyAgent": elif agent_type == "ProxyAgent":
agent_settings = AgentSettings.from_config(agent_cfg.get("agent_settings")) agent_settings = AgentSettings.from_config(agent_cfg.get("agent_settings"))
new_agent = ProxyAgent( new_agent = ProxyAgent(