Exemplo n.º 1
0
def execute():

    for hub in config.hubs:

        sim.init()
        aircraft_handlers.init()
        formation_handlers.init()
        statistics.init()
        visualization.init()

        # Construct flight list
        planes = [
            Aircraft('FLT001', Route([Waypoint('LHR'),
                                      Waypoint('IAD')]), 0),
            Aircraft('FLT001', Route([Waypoint('LHR'),
                                      Waypoint('IAD')]), 0),
            Aircraft('FLT001', Route([Waypoint('LHR'),
                                      Waypoint('IAD')]), 0),
            Aircraft('FLT002', Route([Waypoint('LHR'),
                                      Waypoint('JFK')]), 0),
            #Aircraft('FLT003', Route([Waypoint('LHR'), Waypoint('SFO')]), 0),
            Aircraft('FLT003', Route([Waypoint('LHR'),
                                      Waypoint('ORD')]), 0),
        ]

        # Allocate hubs to flights
        allocators.allocate(planes, config.hubs)

        for flight in planes:
            sim.events.append(sim.Event('aircraft-init', flight, 0))

        sim.run()

        debug.print_dictionary(statistics.vars)
Exemplo n.º 2
0
def single_run():

    sim.init()
    aircraft_handlers.init()
    formation_handlers.init()
    statistics.init()
    #plot.init()

    # Construct flight list
    planes = generators.get_via_stdin()

    # Find hubs
    config.hubs = builders.build_hubs(planes, config.count_hubs, config.Z)

    # Register hub arrivals to determine flow rates
    listeners.init(config.hubs)

    # Allocate hubs to flights
    allocators.allocate(planes, config.hubs)

    for flight in planes:
        sim.events.append(sim.Event('aircraft-init', flight, 0))

    sim.run()

    debug.print_dictionary(statistics.vars)
Exemplo n.º 3
0
def execute():

    for hub in config.hubs:

        sim.init()
        aircraft_handlers.init()
        formation_handlers.init()
        statistics.init()
        visualization.init()

        # Construct flight list
        planes = [
            Aircraft('FLT001', Route([Waypoint('LHR'), Waypoint('IAD')]), 0),
            Aircraft('FLT001', Route([Waypoint('LHR'), Waypoint('IAD')]), 0),
            Aircraft('FLT001', Route([Waypoint('LHR'), Waypoint('IAD')]), 0),
            Aircraft('FLT002', Route([Waypoint('LHR'), Waypoint('JFK')]), 0),
            #Aircraft('FLT003', Route([Waypoint('LHR'), Waypoint('SFO')]), 0),
            Aircraft('FLT003', Route([Waypoint('LHR'), Waypoint('ORD')]), 0),
        ]

        # Allocate hubs to flights
        allocators.allocate(planes, config.hubs)
        
        for flight in planes:
            sim.events.append(sim.Event('aircraft-init', flight, 0))

        sim.run()

        debug.print_dictionary(statistics.vars)
Exemplo n.º 4
0
def single_run():
    sim.init()
    aircraft_handlers.init()
    formation_handlers.init()
    statistics.init()
    visualization.init()

    # Construct flight list
    planes = [
        Aircraft('FLT001', Route([Waypoint('DUS'), Waypoint('IAD')]), 0),
        Aircraft('FLT002', Route([Waypoint('BRU'), Waypoint('ORD')]), 0),
        Aircraft('FLT003', Route([Waypoint('AMS'), Waypoint('IAH')]), 0),
        Aircraft('FLT004', Route([Waypoint('LHR'), Waypoint('ATL')]), 45),
        Aircraft('FLT005', Route([Waypoint('FRA'), Waypoint('SFO')]), 0),
    ]

    # Find hubs
    config.hubs = builders.build_hubs(planes, config.count_hubs, config.Z)
    
    # Allocate hubs to flights
    allocators.allocate(planes, config.hubs)
    
    for flight in planes:
        sim.events.append(sim.Event('aircraft-init', flight, 0))
    
    sim.run()

    debug.print_dictionary(statistics.vars)
Exemplo n.º 5
0
def single_run():
    
    sim.init()
    aircraft_handlers.init()
    formation_handlers.init()
    statistics.init()
    #plot.init()
    
    # Construct flight list
    planes = generators.get_via_stdin()
    #planes = generators.get_manual()
    
    if len(planes) > 0:

        # Find hubs
        config.hubs = builders.build_hubs(planes, config.count_hubs, config.Z)
    
        # Allocate hubs to flights
        allocators.allocate(planes, config.hubs)
        
        for flight in planes:
            sim.events.append(sim.Event('aircraft-init', flight, 0))
        
    sim.run()

    sink.push(statistics.vars)
    debug.print_dictionary(statistics.vars)
Exemplo n.º 6
0
def single_run():

    sim.init()
    aircraft_handlers.init()
    formation_handlers.init()
    statistics.init()
    #plot.init()

    # Construct flight list
    planes = generators.get_via_stdin()

    # Find hubs
    config.hubs = builders.build_hubs(planes, config.count_hubs, config.Z)

    # Register hub arrivals to determine flow rates
    listeners.init(config.hubs)

    # Allocate hubs to flights
    allocators.allocate(planes, config.hubs)

    for flight in planes:
        sim.events.append(sim.Event('aircraft-init', flight, 0))

    sim.run()

    debug.print_dictionary(statistics.vars)
Exemplo n.º 7
0
def single_run():

    sim.init()
    aircraft_handlers.init()
    formation_handlers.init()
    statistics.init()

    # Construct flight list
    config.planes = generators.get_via_stdin()

    # Find hubs
    config.hubs = builders.build_hubs(config.planes, config.count_hubs,
                                      config.Z)

    # Allocate hubs to flights
    allocators.allocate(config.planes, config.hubs)

    for flight in config.planes:
        sim.events.append(sim.Event('aircraft-init', flight, 0))

    sim.run()

    debug.print_dictionary(statistics.vars)

    return statistics.vars['fuel_saved'], statistics.vars['fuel_saved_abs']
Exemplo n.º 8
0
def single_run():
    sim.init()
    aircraft_handlers.init()
    formation_handlers.init()
    statistics.init()
    visualization.init()

    # Construct flight list
    planes = [
        Aircraft('FLT001', Route([Waypoint('DUS'),
                                  Waypoint('IAD')]), 0),
        Aircraft('FLT002', Route([Waypoint('BRU'),
                                  Waypoint('ORD')]), 0),
        Aircraft('FLT003', Route([Waypoint('AMS'),
                                  Waypoint('IAH')]), 0),
        Aircraft('FLT004', Route([Waypoint('LHR'),
                                  Waypoint('ATL')]), 45),
        Aircraft('FLT005', Route([Waypoint('FRA'),
                                  Waypoint('SFO')]), 0),
    ]

    # Find hubs
    config.hubs = builders.build_hubs(planes, config.count_hubs, config.Z)

    # Allocate hubs to flights
    allocators.allocate(planes, config.hubs)

    for flight in planes:
        sim.events.append(sim.Event('aircraft-init', flight, 0))

    sim.run()

    debug.print_dictionary(statistics.vars)
Exemplo n.º 9
0
def single_run(planes):

    sim.init()
    aircraft_handlers.init()
    formation_handlers.init()
    statistics.init()
    calibrate.init()

    # Find hubs
    config.hubs = builders.build_hubs(planes, config.count_hubs, config.Z)

    # Allocate hubs to flights
    allocators.allocate(planes, config.hubs)

    for flight in planes:
        sim.events.append(sim.Event('aircraft-init', flight, 0))

    sim.run()
Exemplo n.º 10
0
def single_run(planes):
    
    sim.init()
    aircraft_handlers.init()
    formation_handlers.init()
    statistics.init()
    calibrate.init()
    
    # Find hubs
    config.hubs = builders.build_hubs(planes, config.count_hubs, config.Z)
    
    # Allocate hubs to flights
    allocators.allocate(planes, config.hubs)
    
    for flight in planes:
        sim.events.append(sim.Event('aircraft-init', flight, 0))
    
    sim.run()
Exemplo n.º 11
0
def single_run():

    sim.init()
    aircraft_handlers.init()
    formation_handlers.init()
    statistics.init()
    
    # Construct flight list
    config.planes = generators.get_via_stdin()
    
    # Find hubs
    config.hubs = builders.build_hubs(config.planes, config.count_hubs, config.Z)

    # Allocate hubs to flights
    allocators.allocate(config.planes, config.hubs)
    
    for flight in config.planes:
        sim.events.append(sim.Event('aircraft-init', flight, 0))
    
    sim.run()

    debug.print_dictionary(statistics.vars)
    
    return statistics.vars['fuel_saved'], statistics.vars['fuel_saved_abs']