From 37a465bfd2b2f39d604b7252e28c87dddb40bb34 Mon Sep 17 00:00:00 2001 From: gifrerenom <lluis.gifre@cttc.es> Date: Wed, 30 Oct 2024 23:24:55 +0000 Subject: [PATCH] Debug OFC24 and Optical Controller --- src/opticalcontroller/RSA.py | 8 ++++---- src/opticalcontroller/{dijsktra.py => dijkstra.py} | 0 2 files changed, 4 insertions(+), 4 deletions(-) rename src/opticalcontroller/{dijsktra.py => dijkstra.py} (100%) diff --git a/src/opticalcontroller/RSA.py b/src/opticalcontroller/RSA.py index 7ba77afea..256aaff58 100644 --- a/src/opticalcontroller/RSA.py +++ b/src/opticalcontroller/RSA.py @@ -12,7 +12,7 @@ # See the License for the specific language governing permissions and # limitations under the License. -import opticalcontroller.dijsktra +from opticalcontroller.dijkstra import Graph, shortest_path from opticalcontroller.tools import * from opticalcontroller.variables import * @@ -83,7 +83,7 @@ class RSA(): return "{},{},{}".format(self.c_slot_number, self.l_slot_number, self.s_slot_number) def initGraph(self): - self.g = dijsktra.Graph() + self.g = Graph() for n in self.nodes_dict: self.g.add_vertex(n) for l in self.links_dict["optical_links"]: @@ -100,7 +100,7 @@ class RSA(): def initGraph2(self): - self.g = dijsktra.Graph() + self.g = Graph() for n in self.nodes_dict: self.g.add_vertex(n) @@ -117,7 +117,7 @@ class RSA(): self.g.printGraph() def compute_path(self, src, dst): - path = dijsktra.shortest_path(self.g, self.g.get_vertex(src), self.g.get_vertex(dst)) + path = shortest_path(self.g, self.g.get_vertex(src), self.g.get_vertex(dst)) print("INFO: Path from {} to {} with distance: {}".format(src, dst, self.g.get_vertex(dst).get_distance())) if debug: print(path) diff --git a/src/opticalcontroller/dijsktra.py b/src/opticalcontroller/dijkstra.py similarity index 100% rename from src/opticalcontroller/dijsktra.py rename to src/opticalcontroller/dijkstra.py -- GitLab