0% found this document useful (0 votes)
34 views5 pages

SmartTraffix: Traffic Management Project

The document outlines a project for a Smart Traffic Management System (SmartTraffix) aimed at optimizing traffic flow at a four-way intersection, focusing on vehicle types, traffic light control, and speed management. It includes detailed requirements for vehicle handling, simulation, and the management of traffic rules, such as prioritizing emergency vehicles and managing fines for speeding. The project is divided into three modules with specific due dates and instructions for submission, including a requirement for a graphical simulation of the traffic system.

Uploaded by

i220875
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
34 views5 pages

SmartTraffix: Traffic Management Project

The document outlines a project for a Smart Traffic Management System (SmartTraffix) aimed at optimizing traffic flow at a four-way intersection, focusing on vehicle types, traffic light control, and speed management. It includes detailed requirements for vehicle handling, simulation, and the management of traffic rules, such as prioritizing emergency vehicles and managing fines for speeding. The project is divided into three modules with specific due dates and instructions for submission, including a requirement for a graphical simulation of the traffic system.

Uploaded by

i220875
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 5

NATIONAL UNIVERSITY OF COMPUTER AND EMERGING

SCIENCES ISLAMABAD

OPERATING SYSTEMS Fall 2024

SmartTraffix
Due Date: Marks : 320
Module 1: 24-Nov-2024
Module 2: 1st-December-2024
Module 3: 8th-December-2024
Demos : 9-13 (December)

Instructions
● Zero marks will be awarded to the students involved in plagiarism.
● You have to submit a single zip folder of .c/.cpp files.
● Folder name should be your name and Roll No.
● In hard form you can submit a project report and self-assessment form.
● Be prepared for viva and demos after the submission of project.
.

Project :
The SmartTraffix is Smart Traffic Management System (STMS) aims to simulate and
manage traffic flow at a four-way intersection, considering multiple factors such as regular
vehicles, emergency vehicles, and heavy vehicles. This system will optimize traffic light
timings, manage queues, and prioritize emergency vehicles, ensuring smooth traffic flow while
adhering to predefined rules. The system will handle dynamic traffic conditions, including
peak and off-peak hours, while ensuring safety and efficiency.
Key features of the system include the ability to manage regular vehicles, heavy vehicles, and
emergency vehicles. Heavy vehicles, which are only allowed during specific time windows to
avoid disrupting regular traffic flow. Additionally, emergency vehicles will always be
prioritized over other vehicle types to ensure quick passage through the intersection. There will
be challan management for vehicles exceeding the speed limit. Car owners are able to receive
and pay challan.
Module 1

Restrictions: [24]
1. There are two types of vehicles in this system:
a. Light Vehicle: Regular vehicles such as cars, motorcycles, etc.
b. Heavy Vehicle: Larger vehicles like trucks, buses, etc.
c. Emergency Vehicle: Ambulances ,firetrucks and TeoTruck.
2. The system will use two-lane roads(Lane1 and Lane2) on East, West, North and South of
the intersection and handle predefined vehicle arrivals, ensuring that traffic congestion is
minimized and managed efficiently.Predefined vehicle arrivals are mentioned below:
3. Regular Vehicles:
a. North: 1 regular vehicle every second, with 20% chance of an emergency vehicle
arriving every 15 seconds.
b. South: 1 regular vehicle every 2 seconds, with 5% chance of emergency vehicles.
c. East: 1 regular vehicle every 1.5 seconds, with 10% chance of an emergency vehicle
arriving every 20 seconds.
d. West: 1 regular vehicle every 2 seconds, with 30% chance of emergency vehicles.

Note-Each side (North, South, East, West) has two lanes, which means you can accommodate two vehicles
per time unit (if we assume one vehicle enters per second) and lane capacity is upto 10 vehicles per lane.

4. Heavy Vehicles:
a. All Heavy Vehicles arrive at a rate of 1 every 15 seconds on all sides.
b. Heavy Vehicles will be switched to lane2 only on each side( East, West, North and South).
c. Heavy Vehicles are not allowed on any side during these peak hours:
7.00am-9.30am
4.30am-8.30pm
5. Speed Limit
a. Each vehicle will be identified with a unique NumberPlate and will be used for vehicle
identification and its speed will also be recorded on arrival time to any side.
b. Maximum speed should be
i. 60km/hr for Regular vehicle
ii. 40km/h for Heavy Vehicle
iii. 80km/h is for emergency Vehicle
c. On arrival, each vehicle will be randomly allocated a speed within the range of the defined
limit. After every 5 seconds, vehicle speed will be increased by 5km/h.
6. Challan Status:
a. Each vehicle will be entered with Inactive challan status.
7. Simulation Time
a. Simulation time for each run will be 5 minutes.
8. Out of order Vehicle Rate
a. Any vehicle available on any side of the road can go out of order randomly.
b. At Least one vehicle will go out of order in a simulation

Simulation [16]
The system will simulate and visualize the traffic flow at the intersection. You may use libraries such as
SFML or openGL or any graphic library in C++ to create graphical representations of the intersection,
vehicles, and traffic light states. The graphical output will include:
● visual representation of vehicles.
● Color-coded traffic light states (Green, Yellow, Red).
● Animated movement of vehicles.
Module 2

Functional Requirements:
There will be processes managing the traffic called SmartTraffix.
SmartTraffix [120 marks]
SmartTraffix will have these components:

1. Traffic Light Control [20]


1.1. The system must manage the traffic lights at the intersection and switch between
the North-South and East-West directions at regular intervals (every 10 seconds).
1.2. The system must handle traffic light changes in a round-robin manner, with each
direction receiving an equal amount of green light time, unless there are emergency
vehicles.
1.3. The sequence of green light by default is the anticlockwise direction followed in
the given diagram.

2. Manage Speed Limit [10]


2.1. Smart Traffic will observe the vehicle speed limit. When a vehicle exceeds the
speed limit, Smart Traffic will be alerted and notify another process called Challan
Generator.
3. Priority Handling: [40]
3.1. Emergency vehicles are high-priority vehicles and can preempt regular traffic.
Smart traffic will increase the priority of the vehicle in front of emergency vehicles.
3.2. Vehicles will be prioritized for the case of engine failure or any spare part went
out of order. A toe truck will come to pull the heavy vehicle from the road.
4. Managing the Queue of Vehicles [30]
4.1. Each direction will have a queue where vehicles wait if both lanes are occupied.
The queue can hold more vehicles, but only up to the lane capacity.
4.2. Emergency vehicles that arrive shall be placed at the front of the queue for their
direction, ensuring they can cross the intersection first.
4.3. When both lanes are occupied , vehicles will wait in the queue.
4.4. Any vehicle with challan status active will not be allowed to enter into any side of
the road and will be blocked until its challan is paid.
5. Mocking Date and time [20]
5.1. Mock date time will be used to test the system's behavior under varying
conditions such as for peak traffic hours (for heavy vehicle arrivals) and overdues
challan.
Module 3

Functional requirements: There will be processes managing the remaining SmartTraffix rules,
Challan Generator, UserPortal and StripePayment.

1. SmartTraffix: SmartTraffix will have these components: [30]

1. Manage Challan [10]


1.1 Smart Traffic will observe the speed of every vehicle and notify the Challan generator
on exceeding the speed limit of the vehicle.
1.2 Smart Traffic will also update the Challan Status active for the particular vehicle.
2. Smart Traffix Analytics [20]
2.1 Smart traffix will also maintain the analytics such as number of cars on all sides of the
road, number of particular vehicle types on all sides of road, number of Active Challans,
and Vehicle number with active challan. All analytics will be displayed on visual
simulation.

Challan Generator. [30]


1. Challan generator will be receiving vehicle id and car speed. It will calculate a fine of 5000pkr
for regular vehicles and 7000pkr for heavy vehicles. Emergency vehicles are extended from the
Challan. There are 17% service charges on each Challan for Challan generator.
2. Challan generator also maintains a payment status( paid, unpaid, overdue).
3. Challan generator also maintains challan issue date and time.
4. The due date will be three days after the challan issuance date
5. Once the amount is calculated, the Challan generator process will send Challan details including
challanid, challan issue date, vehicle numberm vehicle type, amount to paid and due date to
another process called UserPortal.
6. On successful payment alert received from StripPayment,Challan Generator will set the payment
status to paid and display all challan details.Challan generator also update the smart traffic about
the successful payment status.

UserPortal: [30]
1. Owner of the vehicle can access UserPortal through the vehicle number, Challan issue date and
time.
2. Vehicle owners can view the Challan_id, vehicle number, vehicle type, payment status and amount
to be paid.
3. On successful payment alert received from StripPayment, UserPortal will simply display all
challan details and payment status will be updated to paid.

StripPayment [30]
1. Vehicle owner can pay the challan by using another process called StripePayment.
2. Stripepayment will receive challanId vehicleNnumber, vehicle type and amount to be paid.
3. User will enter the paid amount and the stripePayment process will send successful payment status
to Challan generator and UserPortal.

Deadlock Prevention [30]


Smart Traffic should use a good theorem to handle Deadlock situations. Minimum requirement is to use
Banker Algorithm to handle deadlock of vehicles.
Bonus of will be given if you implement additional algorithms other than banker theorem.
[20 Bonus marks]
Simulation [30]
The system will simulate and visualize the traffic flow at the intersection. You may use libraries such as
SFML or openGL or any graphic library in C++ to create graphical representations of the intersection,
vehicles, and traffic light states. The graphical output will include:
● Visual representation of the intersection.
● visual representation of vehicles.
● Color-coded traffic light states (Green, Yellow, Red).
● Animated movement of vehicles through the intersection.

Visual Simulation will also show analytics on the screen.

GoodLuck!

You might also like