예제 #1
0
    def startMobility(self, stations, accessPoints, **kwargs):
        "Starts Mobility"
        mobilityModel = ''
        self.isMobility = True

        if 'model' in kwargs:
            mobilityModel = kwargs['model']

        if 'AC' in kwargs:
            self.AC = kwargs['AC']

        if mobilityModel != '' or self.isVanet:
            stationaryNodes = []
            for sta in stations:
                if 'position' not in sta.params:
                    sta.isStationary = False
                    stationaryNodes.append(sta)
                    sta.params['position'] = 0, 0, 0

            if not self.isVanet:
                params = self.setMobilityParams(stations, accessPoints,
                                                stationaryNodes, **kwargs)
                mobility.start(**params)
            else:
                params = self.setMobilityParams(stations, accessPoints,
                                                stationaryNodes, **kwargs)
                vanet(**params)

        info("Mobility started at %s second(s)\n" % kwargs['time'])
예제 #2
0
    def start_mobility(cls, stations, aps, **kwargs):
        "Starts Mobility"
        mobility_model = ''
        cls.isMobility = True

        if 'model' in kwargs:
            mobility_model = kwargs['model']

        if 'AC' in kwargs:
            cls.AC = kwargs['AC']

        if mobility_model != '' or cls.isVanet:
            stationaryNodes = []
            for sta in stations:
                if 'position' not in sta.params \
                        or 'position' in sta.params \
                                and sta.params['position'] == (-1,-1,-1):
                    sta.isStationary = False
                    stationaryNodes.append(sta)
                    sta.params['position'] = 0, 0, 0

            params = cls.setMobilityParams(stations, aps, stationaryNodes,
                                           **kwargs)
            if cls.nroads == 0:
                mobility.start(**params)
            else:
                vanet(**params)
예제 #3
0
    def start_mobility(cls, **kwargs):
        "Starts Mobility"
        cls.isMobility = True

        if 'model' in kwargs or cls.isVanet:
            stationaryNodes = []
            for node in kwargs['mobileNodes']:
                if 'position' not in node.params \
                        or 'position' in node.params \
                                and node.params['position'] == (-1,-1,-1):
                    node.isStationary = False
                    stationaryNodes.append(node)
                    node.params['position'] = 0, 0, 0
            kwargs['stationaryNodes'] = stationaryNodes
            params = cls.setMobilityParams(**kwargs)
            if cls.nroads == 0:
                mobility.start(**params)
            else:
                vanet(**params)