At initialization stage, the minimum time of green light is configured. When the delay ends, the algorithm compares the total delay time of current phase with the maximum time to decide whether NeverStop goes to the next phase or remain in current state. If the red queue is waiting longer than the green queue, then the traffic lights should be switched immediately. Otherwise, the delay time should be calculated by fuzzy control rules, and then an updated delay time is configured and compared to the max light time.