TrafficLight

TrafficLight is available as:

This hierarchical model demonstrates a traffic light system with DE (Discrete Event) and Ptera (Ptolemy Event Relationship Actor). The DE model simulates an execution environment, which randomly triggers errors. The traffic light switches into error mode on receiving an error event (generated by the PoissonClock), and the yellow light flashes. After 10 units of model time, the traffic light recovers and resumes its function.

This model illustrates a typical design pattern where the top level is a DE model of the physical environment for a system under design. The next level down is a modal model fashioned after the statecharts model at the right. Open the TrafficLight actor to see how it is implemented.

The PoissonClock actor occassionally injects an Error signal. The Error condition then lasts 5 seconds, as determined by the TimedDelay actor.