Let are vehicles on the Road. |
1: Begin. |
2: Read |
3: Compute CountVehicle |
4: Set Threshold ←10 |
5: Initialize User Request ←Dashboard or GoogleMap |
////////////////////Traffic Updates on Signal Dashboard///////////// |
6: While User Request==Dashboard |
7: Store.Cloud ←Count Vehicle |
8: If (Store.Cloud <Threshold) then |
9: Active Message.Agent |
10: Set Signal.Colour←Green |
11: Dashboard ←ΣV,Signal.Colour |
12: Updat Store.Cloud |
else |
13: Store.Cloud←Heavy traffic |
14: Set Signal Color ←Red |
15: Dashboard ←ΣV,Signal.Color |
16: Goto step userRequest |
////////////////////Message Popup on Users Smartphones//////////// |
17: While User Request==GoogleMap |
18: Store.Cloud ←Count Vehicle |
19: If (Store.Cloud >Threshold) then |
20: Active Message.Agent |
21: Set Signal.Colour←Red |
22: GoogleMap ←Signal.Color |
23: Output←Traffic Congestion |
24: Update Store.Cloud |
else |
25: Store.Cloud←Empty Road |
26: Set Signal Color ←Green |
27: GoogleMap ←Signal.Color |
28: Output←Smooth Passage |
29: Update Store Cloud |
30: End. |