diff --git a/src/opticalcontroller/RSA.py b/src/opticalcontroller/RSA.py index 7ba77afeafc2b34f0ad31cb16f01940eae72177a..256aaff58f6811b47568e92e4e36dae3f72686a2 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