-
Notifications
You must be signed in to change notification settings - Fork 12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Plots #2
Comments
Hi Miguel! when I directly copy and paste your code (pls see below), the program runs (though shows some errors) and gives output: all plots except service utilization and probabilities' plots. so tell me please why? ##single server #Importing Libraries import warnings #Single server, single queue simulation #generating inter arrival times using exponential distribution inter_arrival_times = list(np.random.exponential(scale=1/l,size=ncust)) arrival_times= []# list of arrival times of a person joining the queue arrival_times = [0 for i in range(ncust)] arrival_times[0]=round(inter_arrival_times[0],2)#arrival of first customer
for i in range(1,ncust):
service_times = list(np.random.exponential(scale=1/µ,size=ncust))
finish_times[0]=round((arrival_times[0]+service_times[0]),2)
for i in range(1,ncust):
total_times =[abs(round((finish_times[i]-arrival_times[i]),2)) for i in range(ncust)]
wait_times = [abs(round((total_times[i] - service_times[i]),2)) for i in range(ncust)]
data = pd.DataFrame(list(zip(arrival_times,service_times,total_times,finish_times,wait_times,inter_arrival_times)), #generating time between events , and their description (arrivals, departures) tbe=list([0]) #Creating a dataframe to summarize the time between events #generating the number of customers inside the system at any given time of the simulation timeline['n']=0
workingtime=workingtime+timeline['time'][2ncust-3]-timeline['time'][2ncust-2] timeline.time.max() data['occupied']=[0 for i in range(ncust)]
t= list() t.append(0) #checking central tendency measures and dispersion of the data timeline['Lq']=0 ocupation= pd.Series(name='ocupation',data=[idletime/data.finish_times.max(), plt.figure(figsize=(12,4)) plt.figure(figsize=(7,7)) plt.figure(figsize=(8,8)) plt.figure(figsize=(8,8)) plt.figure(figsize=(7,7)) Ls=(sum(PnPn.index)) print('Output:','\n', |
The text was updated successfully, but these errors were encountered: