Esempio n. 1
0
def main(json_name):
    """
    Main method

    Starts parsing the JSON and creating the network with the help of JSONHandler

    Created the simulator

    Executes a simulation for every seed

    Prints results
    """
    queues, first_arrivals, n_randoms, seeds = JSONHandler.open_json(json_name)
    sim = Simulator(queues, n_randoms)
    for queue in queues:
        sim.add_queue(queue)
    for seed in seeds:
        print('Simulating seed {0}...'.format(seed))
        sim.simulate(seed, first_arrivals)
        sim.reset_simulator()
    print(sim.get_averages())