Skip to content
Snippets Groups Projects
Commit 5cb4d557 authored by markn92's avatar markn92
Browse files

do cleanup

parent 5a3da12d
No related branches found
No related tags found
No related merge requests found
......@@ -68,9 +68,7 @@ def shortest_path(G: nx.DiGraph, charging_stations: Set[Node], s: Node, t: Node,
l_set[node_min].append(label_node_min)
if node_min == t:
G.remove_node(t)
charging_stations.remove(dummy_cs)
_cleanup(G, t, charging_stations, dummy_cs)
return _result(
label_node_min, f_soc_factory(label_node_min).minimum
)
......@@ -138,9 +136,14 @@ def shortest_path(G: nx.DiGraph, charging_stations: Set[Node], s: Node, t: Node,
if is_new_min:
prio_queue.insert(n, **keys(f_soc_factory(label_neighbour)))
_cleanup(G, t, charging_stations, dummy_cs)
return EmptyResult()
def _cleanup(G, t, charging_stations, dummy_cs):
G.remove_node(t)
G.remove_node(dummy_cs)
charging_stations.remove(dummy_cs)
return EmptyResult()
def _setup(G: nx.Graph, charging_stations: Set[Node], capacity: SoC,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment