Esempio n. 1
0
    def start(self, **params):
        'start topology'
        from mn_wifi.mobility import mobility

        cars = []
        for car in params['stations']:
            if 'carsta' in car.params:
                cars.append(car)
        mobility.stations = cars
        mobility.aps = params['aps']
        mobility.mobileNodes = cars
        [self.road.append(x) for x in range(0, params['nroads'])]
        [self.points.append(x) for x in range(0, params['nroads'])]
        [self.totalRoads.append(x) for x in range(0, params['nroads'])]
        plot2d.instantiateGraph(params['min_x'], params['min_y'],
                                params['max_x'], params['max_y'])

        self.display_grid(params['aps'], params['conn'], params['nroads'])
        self.display_cars(cars)
        plot2d.plotGraph(cars, [])
        self.setWifiParameters(mobility)
        while True:
            [self.scatter, self.com_lines] = \
                self.simulate_car_movement(cars, params['aps'], self.scatter,
                                           self.com_lines, mobility)
            mobility.continue_params
Esempio n. 2
0
    def start(self, **params):
        'start topology'
        from mn_wifi.mobility import mobility

        cars = params['cars']
        mobility.stations = cars
        mobility.aps = params['aps']
        mobility.mobileNodes = cars
        [self.roads.append(x) for x in range(params['nroads'])]
        [self.points.append(x) for x in range(params['nroads'])]
        plot2d.instantiateGraph(params['min_x'], params['min_y'], params['max_x'], params['max_y'])

        self.display_grid(params['aps'], params['conn'], params['nroads'])
        self.display_cars(cars)
        plot2d.plotGraph(cars, [])
        self.setWifiParameters(mobility)
        while mobility.thread_._keep_alive:
            [self.scatter, self.com_lines] = \
                self.simulate_car_movement(cars, params['aps'], self.scatter,
                                           self.com_lines, mobility)
            sleep(0.0001)
Esempio n. 3
0
    def start(self, cars, aps, roads, conn,
              min_x, min_y, max_x, max_y, **kwargs):
        'start topology'
        from mn_wifi.mobility import mobility

        mobility.stations = cars
        mobility.mobileNodes = cars
        mobility.aps = aps
        [self.roads.append(x) for x in range(roads)]
        [self.points.append(x) for x in range(roads)]
        plot2d.instantiateGraph(min_x, min_y, max_x, max_y)

        self.display_grid(aps, conn, roads)
        self.display_cars(cars)
        plot2d.plotGraph(cars, [])
        self.setWifiParameters(mobility)
        while mobility.thread_._keep_alive:
            [self.scatter, self.com_lines] = \
                self.simulate_car_movement(cars, aps, self.scatter,
                                           self.com_lines, mobility)
            sleep(0.0001)
Esempio n. 4
0
    def start(self, **params):
        'start topology'
        from mn_wifi.mobility import mobility

        cars = params['cars']
        mobility.stations = cars
        mobility.aps = params['aps']
        mobility.mobileNodes = cars
        [self.roads.append(x) for x in range(params['nroads'])]
        [self.points.append(x) for x in range(params['nroads'])]
        plot2d.instantiateGraph(params['min_x'], params['min_y'],
                                params['max_x'], params['max_y'])

        self.display_grid(params['aps'], params['conn'], params['nroads'])
        self.display_cars(cars)
        plot2d.plotGraph(cars, [])
        self.setWifiParameters(mobility)
        while mobility.thread_._keep_alive:
            [self.scatter, self.com_lines] = \
                self.simulate_car_movement(cars, params['aps'], self.scatter,
                                           self.com_lines, mobility)
            sleep(0.0001)