queues used to represent the line in which passengers must wait until they are served by ticket agent the ticket agents are represented as an array of agent objects the individual objects are instantiated and each is assigned an id numberstarting with two data fields are needed to store data collected during the actual simulation the first is the summation of the time each passenger has to wait in line before being servedand the second keeps track of the number of passengers in the simulation the latter will also be used to assign an id to each passenger the simulation is performed by calling the run(methodwhich simulates the ticking of the clock by performing count-controlled loop keeping track of the current time in curtime the loop executes until numminutes have elapsed the events of the simulation are also performed during the terminating minutehencethe need for the numminutes in the range(function during each iteration of the loopthe three simulation rules outlined earlier are handled by the respective handlexyz(helper methods the handlearrival(method determines if passenger arrives during the current time step and handles that arrival handlebeginservice(determines if any agents are free and allows the next passenger(sin line to begin their transaction the handleendservice(determines which of the current transactions have completedif anyand flags passenger departure the implementation of the helper methods is left as an exercise after running the simulationthe printresults(method is called to print the results when the simulation terminates there may be some passengers remaining in the queue who have not yet been assisted thuswe need to determine how many passengers have exited the queuewhich indicates the number of passenger wait times included in the totalwaittime field the average wait time is simply the total wait time divided by the number of passengers served the last component of our program is the driver modulewhich is left as an exercise the driver extracts the simulation parameters from the user and then creates and uses ticketcountersimulation object to perform the simulation to produce the same results shown earlieryou will need to seed the random number generator with the value before running the simulationrandom seed in typical experimenta simulation is performed multiple times varying the parameters with each execution table illustrates the results of single experiment with multiple executions of the simulation note the significant change in the average wait time when increasing the number of ticket agents by one in the last two sets of experiments exercises determine the worst case time-complexity for each operation defined in the ticketcountersimulation class