Events Step by StepModel Design
UML Diagrams of Events |
|||||||
Changes in the state of the system occur whenever a truck enters the system and when a van carrier finishes loading a truck. So we will need an event type describing the arrival of a truck (truck arrival event) and a second event type describing the end of the loading process (service end event). A detail we have neglected so far is how to model waiting space. The trucks need to wait in line until a van carrier is free to fetch and load their container. Well, the term queueing system already says it all: this is done using queues. Our model will need a queue for trucks to enter in case the van carrier is busy. And it will use a second queue for the van carriers to enter in case there are no trucks to serve. This second queue might not seem necessary so long as there's only one van carrier to consider. But it has several advantages:
Here's a UML activity diagram of the truck arrival event:
Here's a UML activity diagram of the service end event: This occurs whenever a van carrier finishes loading a truck. The truck just leaves the system leaving the van carrier free to start service on another truck. The event therefore has to check if there are still trucks waiting in the queue. If there are no trucks the event inserts the van carrier into the queue for idle van carriers (which models the VC driving back onot its parking spot waiting for the next customer). If there is at least one truck waiting, the event then removes the first truck from the queue and creates and schedules a new service end event.
|
|||||||
http://desmoj.sourceforge.net/tutorial/events/design2.html |