Recall that the Statechart for the traffic light system has a state NORMAL_OP which is influenced by the values of two data-items which control the amount of time the traffic flows either in east-west or north-south directions. In this example, the ns_green_time is assigned randomly, while the ew_green_time is assigned from an external file trial.dat.
The external file trial.dat has the following records:
After initializing the two control values, ns_green_time and ew_green_time, the execution begins. Breakpoints are defined and the execution is driven by the go step operation. Since we use the Synchronous Time Model, go step increments the clock on each step.
Each time a malfunction occurs in the system, the Simulation Control Program resets the control values. The Simulation Control Program filters the trial.dat against a maximum allowed value of 20. The file trial.out contains a time-stamp of each malfunction.