list_average_queuelength = [] list_average_queuingtimes = [] all_queue_lengths_overtime = np.zeros((len(diff_serverns), end_n_actions + 1)) queuelengthforrepetitios = np.zeros((n_simulations, end_n_actions + 1)) # run the simulation multiple times i = 0 for n_server in diff_serverns: queuelengthforrepetitios = np.zeros((n_simulations, end_n_actions + 1)) for j in range(0, n_simulations): mu = 0.80 l = 0.64 * n_server # initialize the global lists init_global(end_n_actions) # create a simpy environment env = simpy.Environment() # set up the system env.process( setup(env, n_server, mu, l, sjf, end_n_actions, db_helptime, LT_value)) # run the program env.run() average_queuelength = np.average(global_variables.queue_length_list) list_average_queuelength.append(average_queuelength)
n_batches = (end_n_actions-initialisation_period)/batch_size/2. sjf = False # True to use shortest job first '''Run simulation for different values of rho''' list_nf_confidence_average_queuetimes = [] list_total_average_queuetimes = [] mu_range = np.arange(l+0.01, 0.8, 0.05) for mu in mu_range: list_average_queuelength = [] list_average_queuingtimes = [] # run the simulation multiple times for i in range(n_simulations): # initialize the global lists init_global() # create a simpy environment env = simpy.Environment() # set up the system env.process(setup(env, n_server, mu, l, sjf, end_n_actions, "M", LT_value)) # run the program env.run() average_queuelength = np.average(global_variables.queue_length_list) list_average_queuelength.append(average_queuelength) list_batch_averages = batch_averages(batch_size, initialisation_period) average_queuingtimes = np.average(global_variables.time_spend_in_queue_list)