Skip to content
Snippets Groups Projects
Commit 37a465bf authored by Lluis Gifre Renom's avatar Lluis Gifre Renom
Browse files

Debug OFC24 and Optical Controller

parent 41b2089a
No related branches found
No related tags found
2 merge requests!294Release TeraFlowSDN 4.0,!285Resolve: "(CNIT) New SBI Driver based on OpenROADM for ROADMs"
......@@ -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)
......
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