You are on page 1of 35

CASE STUDY TRAFFIC MANAGEMENT SYSTEM

GROUP MEMBERS:
-Komal Sahita - 65 -Bhagya Maddula - 78 -Disha Vasyani - 60 -Urvi Vora - 61

ON

Mission Statement:
Government wishes to automate traffic management system: there are sensors at each traffic signal. Each sensor senses the traffic density and reports it to central control room. The control room sends signals (green signal and waiting time). All the signals follow a pattern for ON and OFF like when one signal is GREEN then opposite direction signal is RED and vice versa.

In case of accident, sensor sends signal to the control room, traffic at that time is regulated accordingly. Nearest hospital is contacted and is asked to report immediately.

In case of rally and processions and road maintenance, alternative ways/roads are flashed on the Flash Boards. During normal conditions boards display traffic status of nearby areas where the corresponding road leads.

In case someone breaks the signal or exceeds speed limit vehicle number and the direction in which it is going is noted. The traffic police at the next corresponding signal are informed about it so that appropriate action can be taken.

All the information about traffic density is Logged in the central server. It will help in providing statistical information while under taking new road or bridge construction.

CLASS DIAGRAM:
The analysis CLASS DIAGRAM for traffic management system is as shown in figure below:

CLASSSES WITH THEIR ATTRIBUTES AND OPERATION:
1.

Control Room:
Attributes:

Operator: Operator control room.

who

operates

the

 Id: Id (proof) of the controller.

Name: Name of the controller

Operations :  getOperatorDetails(): retrieves information about the control room operator

Telephone Number: Contact number of the hospital. Traffic Police: . setOperatorDetails(): sets information about the control room operator 2. Operations:  getHospitalDetails(): retrieves Hospital information about the  setHospitalDetails(): sets information about the Hospital  updateHospitalDeatils(): updates information about the Hospital 3. Location: Address of the hospital. Hospital : Attributes: Name: Name of the hospital.

Operations:  getPoliceDetails(): retrieves information about the Police Constable. Location: Location of traffic signal to which constable is responsible for. about the Police 4.Attributes: Id: Id proof of that constable. ViolateTraffic: Attributes: . Name: Name of the constable.  updatePoliceLocation(): updates information about the Police Constable.  setPoliceDetails(): sets information Constable.

Date of periodic maintenance: Last maintenance: Date of last maintenance of sensor . Sensor: Attributes: Type: Type of sensor.Direction: This will show in which direction the driver is going by violating the law. Vehicle Number: This will show the number of the vehicle who violated the law. Operations:  getTrafficViolationDetails(): Retrieves information about the Person Who violated the traffic  setTrafficViolationDetails(): sets information about the Person Who violated the traffic  getNextSignalLocation(): retrieves information about the next signal location 5.

nextMaintenence : Date of next maintenance of sensor Nearest control room: Address of nearest control room. Area: Location of place. TrafficLog Attributes: DateTime: Date and time when density is measured and logged. Density: Traffic Density measured particular area at that time. Operations:  getSensorDetails(): retrieves information about the Sensor. Operations: in that .  setMaintenenceDate(): sets information about the Maintenance date of the sensor  getMaintenenceDate(): Retrieves information about Maintenance date of the sensor the 6.

Charge: Under what charge. 7. Caught by: Police In charge of that area. Amount: Fine to be paid. Time: At what time. Date: Date of that day. . Operations:  AddLogEntry(): Add entries into the log  GenerateReport(): Generates Report to show statistics. Revenue: Attributes: Name: Name of the Individual who violated the signal. AddLogEntry(): Add entries into the log  GenerateReport(): Generates Report to show statistics.

.

.

Here observer pattern can be implemented where sensor acts as observable class and control room acts as observer class. <<observable>> Addobserver() Notify() Update() <<Observer>> Sensor Control room .PATTERNS: DESIGNING OF CLASSES: The system requires only one log so designing of class log can be done using singleton pattern wherein LOG private time private area private density static log thelog static log getinstance() static update() The sensor senses the traffic density and informs it to the control room.

USE CASE DIAGRAM: The actors included are as follows: -Control Room 0perator -Sensor -Hospital Receptionist -Vehicle Drivers -Traffic Police -Flash Boards -Pedestrians The usecases involved with each actor are as follows: 1. Control Room 0perator -Send ON and OFF time -Contact nearest hospital -Logs traffic status -Feed programs into the system .

Sensor -Senses traffic density -sends information to control room -Sense accidents 3.Hospital Receptionist -Attend Emergency calls -Send ambulance 4.Traffic Police -Charge for traffic violation .2.Vehicle Drivers -Drive vehicle -meet accidents -Follow signal -violate traffic 5.

6.Flash boards -flash traffic density in nearby areas -Flash alternative ways 7.Pedestrians -meet accidents -Walk when signal is red .

State Transition Diagram: .

When ON time is equal to five (event).e. When ON time is equal to zero (event) the signal indicator turns back to OFF state. The STATE TRANSITION DIAGRAM for the above description is as shown below: . RED in colour which indicates vehicle driver to stop and it indicates the pedestrians to walk.For signal indicator: Initially. At the same time the sensor senses traffic density and sends this information to the control room which in turn sends ON and OFF time back to the sensor.e. When OFF time is equal to zero (event) the signal indicator changes its state to ON state i. signal indicator is in OFF state i. the signal indicator changes its state to AMBER colour indicating to slow down. GREEN in colour which indicates vehicle driver to drive the vehicle and it indicates the pedestrian’s to stop or not to walk.

For sensor: Initially. When the system . the sensor is in OFF state when it is turned ON it enters in to the MONITOR state.

The STATE TRANSITION DIAGRAM for the above description is as shown below: . Initially it is in SENSING state whereby it senses the traffic density then it transits to send states where it sends the information about traffic density to the control room. The sensor transits between senses these three states viz. This time the sensor is in RECEIVE state.is in MONITOR state it transits between several sub states. In case of sensor failure or maintenance the sensor goes back to OFF state. SENSING. SEND and RECEIVE state until the sensor fails or is down for maintenance. The control room operator processes this information and sends corresponding ON and OFF time back to the sensor.

ACTIVITY DIAGRAM: In normal conditions: .

then fixed ON and OFF time scheme is followed. Check whether is sensor working or not. The control room simultaneously. GREEN signal is send indicating the drivers to drive in desired direction. And it sends traffic density at the next signal on the flash board. the signal indicator changes its state to AMBER colour indicating to slow down. If No. This again indicates the driver to wait and so on. If Yes. It logs traffic density in traffic log. When ON time is equal to zero (event) the signal indicator turns back to OFF state. When ON time is equal to five (event). When OFF time is equal to zero. then sensor senses traffic and it computes traffic and sends information to control room.For regulating traffic under normal conditions. operator performs various tasks It sends ON and OFF time. .

Initially. let the signal be in ON state i. GREEN in colour which indicates vehicle driver to drive the vehicle. If someone met with an accident then the sensor will sense it and will sends this information to the control room. .e.In Case Of Accidents: In case of accidents.

.In meanwhile. The incharge of the control room will contact to the hospital and gives information about the accident like the location where it held and whatever required. the control room will search for the nearest HOSPITAL. Sensor will then sends OFF time event to the signal indicator.

The driver who had crossed the signal. The sensor will sends this information to the control room. signal indicator is in OFF state i.In case of Violation: Initially. But if someone tries to violate the rule. RED in colour which indicates vehicle driver to stop and it indicates the pedestrian’s to walk. The incharge of the control room will forward this information to the traffic police of the next signal. the sensor will click the photo of vehicle number and its direction in which he is going. when the signal is in it’s OFF state.e. then some action has to be taken. . in the direction where the vehicle is moving.

.

e. RED in colour which indicates vehicle driver to wait and it indicates the pedestrians to walk. The control room in turn sends density information to the FLASH BOARD. the control room will process and sends the ON time event to the signal indicator. Flash board will display this information. At the same time the sensor senses traffic density and sends this information to the control room. This indicates the vehicle driver to go in their desired direction. This again indicates the driver to wait and so on. the signal indicator changes its state to AMBER colour indicating to slow down.SEQUENCE DIAGRAM: In normal conditions: Initially. signal indicator is in OFF state i. When ON time is equal to five (event). When OFF time is zero Signal indicator will be GREEN in colour. In the time. When ON time is equal to zero (event) the signal indicator turns back to OFF state. .

The SEQUENCE DIAGRAM for the above description is as shown below: .

In meanwhile. If someone met with an accident then the sensor will sense it and will sends this information to the control room.In case of Accidents: Initially. let the signal be in ON state i.e. . Sensor will then sends OFF time event to the signal indicator. The incharge of the control room will contact to the hospital and gives information about the accident like the location where it held and whatever required. GREEN in colour which indicates vehicle driver to drive the vehicle. the control room will search for the nearest HOSPITAL.

The SEQUENCE DIAGRAM for the above description is as shown below: .

.

But if someone tries to violate the rule. then some action has to be taken. . The sensor will sends this information to the control room. in the direction where the vehicle is moving. when the signal is in it’s OFF state. signal indicator is in OFF state i. the sensor will click the photo of vehicle number and its direction in which he is going.In case of Violation: Initially. The incharge of the control room will forward this information to the traffic police of the next signal. RED in colour which indicates vehicle driver to stop and it indicates the pedestrian’s to walk. The driver who had crossed the signal.e.

The SEQUENCE DIAGRAM for the above description is as shown below: .

COLLABORATION DIAGRAM DURING NORMAL CONDITIONS .

IN CASE OF ACCIDENT .

IN CASE OF TRAFFIC VIOLATION .