Advanced Modelling Features

CondQueue

The Model Trace

   
 

Let us now take a look at the trace output of this example to see how the simulation processes interact via the CondQueue construct. We start at simulation time 3300.0. At this point of time the terminal office announces 5 new ships to arrive at different times. One additional ship is still expected to come to port (Ship#3 at SimTime 3971.2864), which adds up to a total number of 6 awaited ships in the next two days.

CondQueueExampleExperiment - Trace

time
event
entity
action(s)
0.0TraceOn#1----Trace switched on
... ......
3300.0 TerminalOffice#1Ships to be activated : 5
activates 'Ship#4' at 5622.7317
activates 'Ship#5' at 5899.1735
activates 'Ship#6' at 3896.7990
activates 'Ship#7' at 5936.8766
activates 'Ship#8' at 5241.4043
New total of incoming ships : 6
holds for 1440.0 until 4740.0
3308.9090 TruckGenerator#1activates 'Truck#73' now
holds for 59.7177 until 3368.6267
Truck#73 is assigned to Ship#3
waits in 'Waiting Trucks' until 'Your Ship Arrived!'
3368.6267 TruckGenerator#1activates 'Truck#74' now
holds for 15.6957 until 3384.3225
Truck#74 is assigned to Ship#5
waits in 'Waiting Trucks' until 'Your Ship Arrived!'
3384.3225 TruckGenerator#1activates 'Truck#75' now
holds for 41.0230 until 3425.3455
Truck#75 is assigned to Ship#8
waits in 'Waiting Trucks' until 'Your Ship Arrived!'

Now trucks start to arrive at the terminal and wait for their particular ship. At simulation time 3896.7990 Ship#6 arrives and signals the condition queue waitingTrucks.

3896.7990 Ship#6 arrives at the port
signals 'Waiting Trucks'
leaves the port
Ship#6 terminates
Truck#88leaves 'Waiting Trucks', because 'Your Ship Arrived!'
Truck for Ship#6 was serviced and leaves
Truck#88 terminates
3927.7726 TruckGenerator#1activates 'Truck#89' now
holds for 4.5426 until 3932.3152
Truck#89 is assigned to Ship#4
waits in 'Waiting Trucks' until 'Your Ship Arrived!'

There was only Truck#88 waiting in the condition queue for Ship#6. (Must have been quite a small ship... :) )

Trucks and ships continue to arrive and leave until the simulation is over.

You may download the full source code of this example if you want to try it out yourself.



   
  http://desmoj.sourceforge.net/tutorial/advanced/condqueue6.html