From a0054c9cbc32462ea58fd3111340d5e045fb9c5f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pedro=20L=2E=20Magalh=C3=A3es?= <pmlpm@posteo.de> Date: Mon, 3 Jun 2024 23:42:45 +0200 Subject: [PATCH] Non-hybrid networks now have their nodes set up accordingly. --- src/topupopt/problems/esipp/network.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/topupopt/problems/esipp/network.py b/src/topupopt/problems/esipp/network.py index 5e12053..0b257e6 100644 --- a/src/topupopt/problems/esipp/network.py +++ b/src/topupopt/problems/esipp/network.py @@ -633,11 +633,19 @@ class Network(nx.MultiDiGraph): self.identify_node_types() # declare variables for the nodes without directed arc limitations + if network_type not in self.NET_TYPES: + raise ValueError('Unknown network type.') self.network_type = network_type self.nodes_w_in_dir_arc_limitations = dict() self.nodes_w_out_dir_arc_limitations = dict() + + # set up initial nodes if the network is not hybrid + if self.network_type != self.NET_TYPE_HYBRID: + for node_key in self.nodes(): + self._set_up_node(node_key) + # ************************************************************************* # ************************************************************************* -- GitLab