+
+
+class TopoFromCompiler(Topo):
+#This class is for create the custom topology from the data collected.
+#Here we also process the data to make the topo
+ def build(self):
+ for device in devices:
+ if device.startswith("h"):
+ host = device
+ host = self.addHost(host) #Create a host with the data collected from the list
+ hosts.append(host)
+
+ elif device.startswith("s"):
+ switch = device
+ switch = self.addSwitch(switch) #Create a switch
+ switches.append(switch)
+
+ print ("Devices: " + str(devices) + "\n" + "Links: " + str(links) + "\n" + "Hosts: " + str(hosts) + "\n" + "Switches: " + str(switches) + "\n")
+
+ #Create links
+ for pair in links:
+ split = pair.split(":")
+ self.addLink(split[0],split[1])
+