def start_next(self,new_task)self current_task new_task self time_remaining new_task get_pages( self page_rate the task class will represent single printing task when the task is createda random number generator will provide length from to pages we have chosen to use the randrange function from the random module import random random randrange( random randrange( each task will also need to keep timestamp to be used for computing waiting time this timestamp will represent the time that the task was created and placed in the printer queue the wait_time method can then be used to retrieve the amount of time spent in the queue before printing begins import random class taskdef __init__(selftime)self timestamp time self pages random randrange( def get_stamp(self)return self timestamp def get_pages(self)return self pages def wait_time(selfcurrent_time)return current_time self timestamp the main simulation implements the algorithm described above the print_queue object is an instance of our existing queue adt boolean helper functionnew_print_taskdecides whether new printing task has been created we have again chosen to use the randrange function from the random module to return random integer between and print tasks arrive once every seconds by arbitrarily choosing from the range of random integerswe can simulate this random event the simulation function allows us to set the total time and the pages per minute for the printer import queue as previously defined import printer as previously defined queues