notes boolean serverbusy falseint numberinqueue randomvariable servicetime new exponentialrv ( )randomvariable interarrivaltime new exponentialrv ( )eventlist enqueue (new event arrival ))while (!eventlist isempty ()event event (eventeventlist dequeuemin ()double event gettime ()if ( timelimit{eventlist purge ()breakswitch (event gettype ()case event arrivalif (!severbusyserverbusy trueeventlist enqueue (new event(event departuret servicetime nextdouble ()))else ++numberinqueueeventlist enqueue (new event (event arrivalt interarrivaltime nextdouble ()))breakcase event departureif (numberinqueue = serverbusy falseelse --numberinqueueeventlist enqueue (new event(event departuret servicetime nextdouble ()))break/program application of priority queues discrete event simulation lovely professional university