|
Mobile components can contain locations on which other mobile components may be placed.
Example:
MOBILE COMPONENT Bus
DECLARATION OF ELEMENTS
STATE VARIABLES
TArrive (REAL) := 0,
TDepart (REAL) := 0
LOCATION
Seats (Passenger) := 0 Passenger
END OF Bus
|
|
Passengers now can board and deboard at a bus stop.
Example:
BusLane:Bus[1].Seats^ :
TO BusStop SEND Passenger[i];
BusLane:Bus[1].Seats^ :
FROM BusStop GET Passenger{ALL};
|