Advertisement
Guest User

Untitled

a guest
Dec 13th, 2017
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.97 KB | None | 0 0
  1. from question1 import * # Imports all the neccessary functions for this task.
  2. import matplotlib.pyplot as maingraph # Imports the matplotlib.pyplot library and assigns the methods and functions to maingraph.
  3. import numpy as np #
  4. #3A
  5. maingraph.axis('auto')
  6. maingraph.title('Graph to show the relationship between the introduction of new equipment and mean customer service times')
  7. maingraph.ylabel('Theoretical Mean Queue Length') # Labels the Y axis of maingraph with 'Theoretical Mean Queue Length'
  8. maingraph.xlabel('Alpha value (Average customer service time)') # Labels the X axis with 'Iteration Number'
  9. alphavars = np.arange(1.1,10,0.1)
  10. betavars = np.arange(1,0,-0.1)
  11. for i in betavars:
  12.     plotpoints = []
  13.     for a in alphavars:
  14.         maxQ_value = 0
  15.         for j in range(500):
  16.             maxQ_value += singleQueue(a,i)
  17.         plotpoints.append(maxQ_value / 500)
  18.     maingraph.plot(alphavars,plotpoints)
  19. maingraph.legend() # Creates a legend / Key for the graph
  20. maingraph.show() # Displays the graph
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement