Ejemplo n.º 1
0
 def parameters(self):
     while self.continue_:
         listNodes.ssid_ID = 0
         for node in self.staList:
             for wlan in range(0, len(node.params['wlan'])):
                 if node.func[wlan] != 'mesh' and node.func[wlan] != 'adhoc':
                     self.nodeParameter(node, wlan)
                 elif node.func[wlan] == 'mesh':
                     dist = listNodes.pairingNodes(node, wlan, self.staList)
                     if dist != 0:
                         channelParameters(node, None, wlan, dist,
                                           self.staList, 0)
                 else:
                     if dist != 0:
                         channelParameters(node, None, wlan, dist,
                                           self.staList, 0)
         if meshRouting.routing == 'custom':
             for node in mobility.staList:
                 for wlan in range(0, len(node.params['wlan'])):
                     if node.func[wlan] == 'mesh':
                         """Mesh Routing"""
                         try:
                             meshRouting.customMeshRouting(
                                 node, wlan, self.staList)
                         except:
                             pass
             listNodes.clearList()
Ejemplo n.º 2
0
 def parameters(self):
     while self.continue_:
         listNodes.ssid_ID = 0
         for node in self.staList:
             for wlan in range(0, len(node.params['wlan'])):
                 if node.func[wlan] != 'mesh' and node.func[wlan] != 'adhoc':
                     self.nodeParameter(node, wlan)
                 elif node.func[wlan] == 'mesh' :
                     dist = listNodes.pairingNodes(node, wlan, self.staList)
                     if dist != 0:
                         channelParameters(node, None, wlan, dist, self.staList, 0)
                 else:
                     if dist != 0:
                         channelParameters(node, None, wlan, dist, self.staList, 0)
         if meshRouting.routing == 'custom':
             for node in mobility.staList:
                 for wlan in range(0, len(node.params['wlan'])):
                     if node.func[wlan] == 'mesh':
                         """Mesh Routing"""
                         try:
                             meshRouting.customMeshRouting(node, wlan, self.staList)
                         except:
                             pass
             listNodes.clearList()
         # have to verify this
         time.sleep(0.01)
Ejemplo n.º 3
0
    def parameters(self):
        """ 
        Applies channel params and handover
        """
        meshNodes = []
        for node in self.mobilityNodes:
            for wlan in range(0, len(node.params['wlan'])):
                if node.func[wlan] == 'mesh' or node.func[wlan] == 'adhoc':
                    meshNodes.append(node)

        while True:
            for node in self.mobilityNodes:
                for wlan in range(0, len(node.params['wlan'])):
                    if node.func[wlan] == 'mesh' or node.func[wlan] == 'adhoc':
                        if node.type == 'vehicle':
                            node = node.params['carsta']
                            wlan = 0
                        dist = listNodes.pairingNodes(node, wlan, meshNodes)
                        if WmediumdServerConn.connected == False and dist >= 0.01:
                            setChannelParams(sta=node, wlan=wlan, dist=dist)
                    else:
                        self.handoverCheck(node, wlan)
            if meshRouting.routing == 'custom':
                meshRouting(meshNodes)
            # have to verify this
            eval(self.continueParams)
Ejemplo n.º 4
0
    def parameters_(self, node=None):
        """ 
        have to check it!
        Applies channel params and handover
        """
        if node == None:
            nodes = self.stations 
        else:
            nodes = []
            nodes.append(node)  
        for node_ in self.accessPoints:
            if 'link' in node_.params and node_.params['link'] == 'mesh':
                nodes.append(node_)

        for node in nodes:
            for wlan in range(0, len(node.params['wlan'])):
                if node.func[wlan] == 'mesh' or node.func[wlan] == 'adhoc':
                    if node.type == 'vehicle':
                        node = node.params['carsta']
                        wlan = 0
                    dist = listNodes.pairingNodes(node, wlan, nodes)
                    if WmediumdServerConn.connected == False and dist >= 0.01:
                        setChannelParams(sta=node, wlan=wlan, dist=dist)
                else:
                    self.handoverCheck(node, wlan)
        if meshRouting.routing == 'custom':
            meshRouting(nodes)
        # have to verify this
        eval(self.continueParams)        
Ejemplo n.º 5
0
 def parameters(self):
     while self.continue_:
         try:
             for node in self.staList:
                 for wlan in range(0, node.nWlans):
                     if node.func[wlan] == 'mesh' or node.func[
                             wlan] == 'adhoc':
                         dist = listNodes.pairingNodes(
                             node, wlan, self.staList)
                         if dist != 0:
                             channelParameters(node, None, wlan, dist,
                                               self.staList,
                                               abs(node.params['speed']))
                     else:
                         self.nodeParameter(node, wlan)
             if meshRouting.routing == 'custom':
                 for node in mobility.staList:
                     for wlan in range(0, node.nWlans):
                         if node.func[wlan] == 'mesh':
                             """Mesh Routing"""
                             meshRouting.customMeshRouting(
                                 node, wlan, self.staList)
                 listNodes.clearList()
         except:
             pass
Ejemplo n.º 6
0
 def parameters(self):
     while self.continue_:
         for node in self.staList:
             for wlan in range(0, len(node.params['wlan'])):
                 if node.func[wlan] == 'mesh' or node.func[wlan] == 'adhoc':
                     if node.type == 'vehicle':
                         node = node.params['carsta']
                         wlan = 0
                     dist = listNodes.pairingNodes(node, wlan, self.staList)
                     if dist >= 0.01:
                         setAdhocChannelParams(node, wlan, dist,
                                               self.staList)
                 else:
                     self.nodeParameter(node, wlan)
         if meshRouting.routing == 'custom':
             meshRouting(self.staList)
Ejemplo n.º 7
0
 def parameters(self):
     while emulationEnvironment.continue_:
         try:
             for node in emulationEnvironment.staList: 
                 for wlan in range(0, node.nWlans):
                     if node.func[wlan] == 'mesh' or node.func[wlan] == 'adhoc':
                         dist = listNodes.pairingNodes(node, wlan, emulationEnvironment.staList)
                         channelParameters(node, None, wlan, dist, emulationEnvironment.staList, abs(node.speed))
                     else:
                         self.nodeParameter(node, wlan)
             if emulationEnvironment.meshRouting == 'custom':
                 for node in emulationEnvironment.staList:       
                     for wlan in range(0, node.nWlans):
                         if node.func[wlan] == 'mesh':
                             """Mesh Routing"""                    
                             meshRouting.customMeshRouting(node, wlan, emulationEnvironment.staList)    
                 listNodes.clearList()
         except:
             pass
Ejemplo n.º 8
0
    def setParameters(self, nodes, meshNodes=None):
        if meshNodes == None:
            meshNodes = nodes

        for node in nodes:
            for wlan in range(0, len(node.params['wlan'])):
                if node.func[wlan] == 'mesh' or node.func[wlan] == 'adhoc':
                    if node.type == 'vehicle':
                        node = node.params['carsta']
                        wlan = 0
                    dist = listNodes.pairingNodes(node, wlan, meshNodes)
                    if WmediumdServerConn.connected == False and dist >= 0.01:
                        setChannelParams(sta=node, wlan=wlan, dist=dist)
                else:
                    self.handoverCheck(node, wlan)
        if meshRouting.routing == 'custom':
            meshRouting(meshNodes)
        # have to verify this
        eval(self.continueParams)
Ejemplo n.º 9
0
 def parameters(self):
     """ 
     Applies channel params and handover
     """
     while self.continue_:
         for sta in self.stations:
             for wlan in range(0, len(sta.params['wlan'])):
                 if sta.func[wlan] == 'mesh' or sta.func[wlan] == 'adhoc':
                     if sta.type == 'vehicle':
                         sta = sta.params['carsta']
                         wlan = 0
                     dist = listNodes.pairingNodes(sta, wlan, self.stations)
                     if WmediumdServerConn.connected == False and dist >= 0.01:
                         setChannelParams(sta=sta, wlan=wlan, dist=dist)
                 else:
                     self.handoverCheck(sta, wlan)
         if meshRouting.routing == 'custom':
             meshRouting(self.stations)
         # have to verify this
         eval(self.continueParams)
Ejemplo n.º 10
0
 def parameters(self):
     while self.continue_:
         try:
             for node in self.staList: 
                 for wlan in range(0, node.nWlans):
                     if node.func[wlan] == 'mesh' or node.func[wlan] == 'adhoc':
                         dist = listNodes.pairingNodes(node, wlan, self.staList)
                         if dist!=0:
                             channelParameters(node, None, wlan, dist, self.staList, abs(node.speed))
                     else:
                         self.nodeParameter(node, wlan)
             if meshRouting.routing == 'custom':
                 for node in mobility.staList:       
                     for wlan in range(0, node.nWlans):
                         if node.func[wlan] == 'mesh':
                             """Mesh Routing"""                    
                             meshRouting.customMeshRouting(node, wlan, self.staList)    
                 listNodes.clearList()
         except:
             pass
Ejemplo n.º 11
0
    def autoAssociation(self, stations, accessPoints):
        """
        This is useful to make the users' life easier
        
        :param stations: list of stations
        :param accessPoints: list of access points
        """
        ap = []
        for node in accessPoints:
            if 'link' in node.params:
                ap.append(node)

        nodes = stations + ap

        if not self.isVanet:
            for node in nodes:
                pairingAdhocNodes.ssid_ID += 1
                for wlan in range(0, len(node.params['wlan'])):
                    if 'position' in node.params and 'link' not in node.params:
                        mobility.accessPoints = accessPoints
                        mobility.handoverCheck(node, wlan)
                    if 'position' in node.params and node.func[
                            wlan] == 'adhoc' and node.params['associatedTo'][
                                wlan] == '':
                        value = pairingAdhocNodes(node, wlan, nodes)
                        dist = value.dist
                        if dist >= 0.01:
                            setChannelParams(sta=node, wlan=wlan, dist=dist)
                    elif 'position' in node.params and node.func[
                            wlan] == 'mesh':
                        if node.type == 'vehicle':
                            node = node.params['carsta']
                            wlan = 0
                        dist = listNodes.pairingNodes(node, wlan, nodes)
                        if dist >= 0.01:
                            setChannelParams(sta=node, wlan=wlan, dist=dist)
                if meshRouting.routing == 'custom':
                    meshRouting(nodes)