Exercise 2 solution

TrafficLight
red : Lamp
yellow : Lamp
green : Lamp
leftGreenArrow : Lamp ?
rightGreenArrow : Lamp ?
arrowsOff ?
emergencyVehicle ?
abstract xor Lamp
on
off
flashing
TrafficLightSystem
Lamps
LeftGreenArrow ?
RightGreenArrow ?
redAndYellowToGreen ?
allWayFlashingRedAsStop ?
allWayYellow ?
xor advancedOrExtendedLeft ?
greenFlashing
leftArrow

Let’s try it out. Again, assert certain signals and see what are the states of the lamps. E.g., when you turn all features off and assume the presence or absence of an emergencyVehicle:



Module Statistics: | All clafers: 32 | Abstract: 1 | Concrete: 31 | Reference: 0 | Constraints: 63 | Goals: 0 | Global scope: 1..* | Can skip name resolver: no |

Module Downloads: | [.cfr] | [.html] |

Back to linking signals and lamps.