Advanced Modelling Features

CondQueue

Model Description

   
 

To demonstrate the use of the CondQueue<P> construct we will consider a simple process-oriented model of a container port where trucks are waiting for ships to arrive, in order to deliver or retrieve a container. The model focuses on the interaction of the truck and ship processes and their synchronisation via the condition queue. (Un)loading of ships and trucks is therefore not modelled.

We assume that each truck is assigned to a particular ship. The truck will arrive at the port when this ship is expected to visit the port and it will wait there until the ship docks and the container exchange can take place.

The terminal office collects all messages from shipping companies about the expected arrival of one of their ships at the port. Every day at 7 o'clock the terminal office announces which ships are due to arrive at the port within the next 48 hours. (In our implementation we will use this terminal office to generate and activate the ship processes.)

Now trucks will arrive at the port with loading orders regarding one of the incoming ships. They will enter the parking lot, modelled by a CondQueue<Truck> object, and wait until their ship reaches the port.

Each ship sends a signal message to the CondQueue<Truck> to notify the waiting trucks of its arrival. All trucks waiting for this particular ship will thus be able to leave the queue and proceed to the container exchange area. The (un)loading of ships and trucks is not part of the model, so ship and truck processes will simply terminate after their successful synchronisation.



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