Follow this link. This is not an OCL tutorial. I am still looking for a good paper. Keep checking this page.
Follow this link. This is a better paper.
CpSc 872 Assignment 2 UML Specification of Lift Problem The specification of a software system includes a number of aspects: behavior, attributes, and states. The requirements statement below will be the basis for our draft specification. The purpose of this assignment is to construct a specification for the elevator problem that is complete, correct and consistent. Steps: This is a two person team assignment.
Grading will be based on:
Requirements Statement
A software system must control a set of N Acme elevators for a building with M floors. Each elevator contains a set of buttons, each corresponding to a desired floor. These are called floor request buttons since they indicate a request to go to a specific floor. Each elevator has an emergency stop button that stops the elevator immediately where ever it is. The elevator resumes when the button is pressed a second time. Each elevator as well has a current floor indicator above the door. Each floor has two buttons for requesting elevators called elevator request buttons, because they request an elevator.
Each floor has a sliding door for each shaft arranged so that two door halves meet in the center when closed. When the elevator arrives at the floor, the door opens at the same time the door on the elevator opens. Each elevator has both an optical and pressure sensor to prevent the door from closing when an obstacle is between the two door halves. If an obstruction is detected by either sensor, the door shall open. The door shall automatically close after a timeout period of 5 seconds after the door opens. The detection of an obstacle shall restart the door closure time after an obstruction is removed. There is a speaker on each floor that pings in response to the arrival of an elevator.
On each floor, there are two elevator request buttons, one for UP and one for DOWN, except for the top floor and the bottom floor. On each floor, above each door there is an indicator specifying the current floor for the elevator and another indicator for the direction of the elevator. The system shall respond to an elevator request by sending the nearest elevator that is either idle or already going in the requested direction. If no elevators are currently available, the request shall pend until an elevator meets the previously stated criteria. Once pressed, the request buttons are backlit to indicate that the request is pending. Pressing an elevator request button for which a request is already pending shall have no effect. When an elevator arrives to handle a request (i.e. it is slated to go in the selected direction), then the door shall stop closing and the door closure timer shall be reset.
To enhance safety, a cable tension sensor monitors the tension on the cable controlling the elevator. In the event of a failure, in which the measured tension falls below a critical value, then four external locking clamps connected to running tracks in the shaft stop the elevator and hold it in place.
Additional safety features include a smoke detector and emergency mode controlled by a special key. When the smoke detector detects smoke it places the elevator in emergency mode. In that mode, the elevator stops, if traveling up, and then, regardless of its previous direction, returns to the first floor and opens the door. When an emergency occurs, such as a building fire, a "key operator" may use a special key to place the elevator in emergency mode.
The service person can place the elevator in a "diagnostic mode", in which the service person can step the elevator through any operation.
Adapted From Real-Time UML by Bruce Powell Douglass, Addison-Wesley Pub Co, 1998.