def test_create_arrival(): pq = Task1.PriorityQueue() print('Testing to create 200 arrival events.') pq = create_arrival(pq, 200) pq.print_all() print('Test success.') #for i in range(len(pq)): # print(pq.serve()) print()
def test_serving(): pq = Task1.PriorityQueue() #pq = create_arrival(pq) pq.reset() print('Testing to find the time when the customer is served and leaves if the customer arrives at 5.00pm.') pq.add('Arrival', 540) pq = serving(pq) #print('Test success.') pq.reset() print('\nTesting to find the time when the customer is served and leaves if the customer arrives at 12.00pm.') pq.add('Arrival', 240) pq = serving(pq) #print('Test success.') pq.reset() print('\nTesting to find the time when the customer is served and leaves if the customer arrives at 9.39am.') pq.add('Arrival', 99) pq = serving(pq)