parameters: (self, options, network, IntLink, ExtLink, Router)
docstring: Recursively make all of the links and routers
docstring_summary: Recursively make all of the links and routers
docstring_tokens: Recursively make all of the links and routers
function: def makeTopology(self, options, network, IntLink, ExtLink, Router):
          """ Recursively make all of the links and routers
          """
  
          # make a router to connect all of the nodes
          self.router = Router(router_id=self.num_routers())
          network.routers.append(self.router)
  
          for node in self.nodes:
              if type(node) == Cluster:
                  node.makeTopology(options, network, IntLink,
                                    ExtLink, Router)
  
                  # connect this cluster to the router
                  link_out = IntLink(link_id=self.num_int_links(), src_node=self.router,
                             dst_node=node.router)
                  link_in = IntLink(link_id=self.num_int_links(), src_node=node.router,
                                    dst_node=self.router)
  
                  if node.extBW:
                      link_out.bandwidth_factor = node.extBW
                      link_in.bandwidth_factor = node.extBW
  
                  # if there is an internal b/w for this node
                  # and no ext b/w to override
                  elif self.intBW:
                      link_out.bandwidth_factor = self.intBW
                      link_in.bandwidth_factor = self.intBW
  
                  if node.extLatency:
                      link_out.latency = node.extLatency
                      link_in.latency = node.extLatency
                  elif self.intLatency:
                      link_out.latency = self.intLatency
                      link_in.latency = self.intLatency
  
                  network.int_links.append(link_out)
                  network.int_links.append(link_in)
              else:
                  # node is just a controller,
                  # connect it to the router via a ext_link
                  link = ExtLink(link_id=self.num_ext_links(), ext_node=node,
                          int_node=self.router)
  
                  if self.intBW:
                      link.bandwidth_factor = self.intBW
                  if self.intLatency:
                      link.latency = self.intLatency
  
                  network.ext_links.append(link)
function_tokens: def makeTopology ( self , options , network , IntLink , ExtLink , Router ) : # make a router to connect all of the nodes self . router = Router ( router_id = self . num_routers ( ) ) network . routers . append ( self . router ) for node in self . nodes : if type ( node ) == Cluster : node . makeTopology ( options , network , IntLink , ExtLink , Router ) # connect this cluster to the router link_out = IntLink ( link_id = self . num_int_links ( ) , src_node = self . router , dst_node = node . router ) link_in = IntLink ( link_id = self . num_int_links ( ) , src_node = node . router , dst_node = self . router ) if node . extBW : link_out . bandwidth_factor = node . extBW link_in . bandwidth_factor = node . extBW # if there is an internal b/w for this node # and no ext b/w to override elif self . intBW : link_out . bandwidth_factor = self . intBW link_in . bandwidth_factor = self . intBW if node . extLatency : link_out . latency = node . extLatency link_in . latency = node . extLatency elif self . intLatency : link_out . latency = self . intLatency link_in . latency = self . intLatency network . int_links . append ( link_out ) network . int_links . append ( link_in ) else : # node is just a controller, # connect it to the router via a ext_link link = ExtLink ( link_id = self . num_ext_links ( ) , ext_node = node , int_node = self . router ) if self . intBW : link . bandwidth_factor = self . intBW if self . intLatency : link . latency = self . intLatency network . ext_links . append ( link )