A for-loop is executed once for every minute of simulation time
in the runSimulation method of the AirlineCheckinSim class. This
method calls the checkNewArrival method of PassengerQueue class on
the frequentFlyerQueue as well as the requelarPassengerQueue to
verify the arrival of any new passenger. It uses the showAll and
the clock variables to call the checkNewArrival method of
PassengerQueue class. This method also calls the startServe method
of the AirlineCheckinSim class depending on the clock and the
timeDone variables.

The runSimulation method calls the checkNewArrival method in the
below order after exchanging the statements.

regularPassengerQueue.checkNewArrival(clock, showAll);

frequentFlyerQueue.checkNewArrival(clock, showAll);

When this method calls the checkNewArrival method on the
frequentFlyerQueue at the first and the requelarPassengerQueue at
the second for every minute, the checkNewArrival method displays
the details of the frequentFlyerQueue at the first for every
minute.

If this method calls the checkNewArrival method on the
requelarPassengerQueue at the first and the frequentFlyerQueue at
the second for every minute, then the checkNewArrival method
displays the details of the requelarPassengerQueue at the first for
every minute. And the output of the program will be changed as
below.

Expected number of frequent flyer arrivals per hour: 15

Expected number of regular passenger arrivals per hour: 30

The maximum number of frequent flyers served between regular
passengers: 5

Maximum service time in minutes: 4

Total simulation time in minutes: 10

Display minute-by-minute trace of simulation (Y or N): y

At clock 0:

Time is 0 server is idle

At clock 1:

Time is 1 server is idle

At clock 2:

Time is 2 server is idle

At clock 3:

Time is 3 server is idle

At clock 4:

Time is 4 server is idle

At clock 5:

Time is 5 server is idle

At clock 6:

Time is 6 server is idle

At clock 7:

Frequent Flyer arrival, new queue size is 1

Serving Frequent Flyer with time stamp 7, service time is 3

At clock 8:

Frequent Flyer arrival, new queue size is 1

Regular Passenger arrival, new queue size is 1

At clock 9:

The number of regular passengers served was 0

with an average waiting time of NaN

The number of frequent flyers served was 1

with an average waiting time of 0.0

Passengers in frequent flyer queue: 1

Passengers in regular passenger queue: 1

Modifications in Simulation Program:

Need to modify the simulation program as below to get the output
in the above formatting.

Add the following print statement as beginning of for-loop in
the runSimulation method (refer the text book for this method) in
the AirlineCheckinSim class.