Given Gap Filling Time and Zone Weight, the system
will start scanning the Zones once the traffic light turns
Red. This calculation only takes place when the timer is
equal to the Gap Filling time of a zone. If the cars in the
zone are equal to the number of cars that should be in the
zone then the system will wait until Timer is equal to Gap
Filling Time of other zones. If the Cars in the zone are less
than the number of cars that should be in it then report an
accident probability in the previous zone. Then the system
will check the previous Zone with the same logic. If it is
empty too then it will check the previous zone with more
probability of an accident but with less emphasis on taking
an action against it, because the further away the zone with
the accident is the less effect does it have on the traffic
flow over all. Which means the effective road will be equal
to the real road. Those calculations are taken care of using
Fuzzy Logic. After reporting accidents the system will
decide wither, taking an action against it is good for other
Queues by checking the first zone in each queue besides
the current queue. By doing so the system will decide if for
example lowering the green time of the queue with an
accident will not leave cars waiting for other empty
queues. Therefore, if the first zone of all queues is almost
full, the system will move on to phase three else it will just
suspend and wait for the traffic light to turn green again.