Overview
Project details
In a futuristic smart city, the traffic management system is entirely autonomous and responsible for ensuring smooth traffic flow, minimizing congestion, and responding to incidents.
Specifications
Objective:
Design and implement an autonomous traffic management system for a smart city that controls traffic lights, manages vehicle routing, monitors road conditions, and handles emergency scenarios without relying on any external APIs or third-party services.
Context:
In a futuristic smart city, the traffic management system is entirely autonomous and responsible for ensuring smooth traffic flow, minimizing congestion, and responding to incidents. This system should handle many vehicles, diverse road networks, and various real-world scenarios such as accidents, road maintenance, and emergency vehicle priority.
Tracks: Python
845
number of points you will earn
5
launches to complete the project
19
tasks to complete the project
This project is part of the following tracks:
Learning outcomes
-
Get adapted to the EpicLaunchX learning style.
-
Understand the flow actions at EpicLaunchX.
-
Explore PR and code best practices, and earn your first points.
-
Learn more about GitHub and master the conventional commit style.
-
Use Makefile extensively, explore code formatting, linting style, etc.
-
Usage of Domain Driven Design(DDD).
Project Launches & Tasks
launch_1
-
task_1 (50 points)
-
Create a
domain/models.py
file to manage the traffic lights state. -
Create a
TrafficLightState
class that inherits from theEnum
class. -
Use the enum to change the traffic lights state.
-
Traffic light states must be RED, YELLOW, and GREEN.
-
__str__
method has to return the key's value. -
Remember to implement unit tests for traffic light states, and use pytest for tests.
-
-
task_2 (45 points)
-
Create an
Intersection
class withid
andconnected_roads
class fields. -
Class must be located in
domain/entities.py
. -
The
id
field must bestr
type,connected_roads
field must be alist
of strings. -
Remember to implement unit tests for an
Intersection
class, use hypothesis for tests.
-
launch_2
-
task_6 (35 points)
-
Create a
Vehicle
class withid
,type
,speed
,current_route
, andcurrent_position
class fields. -
Class must be located in
domain/entities.py
. -
The
id
andtype
fields must bestr
type, thespeed
field must beint
type, thecurrent_route
field must belist
ofIntersection
, and thecurrent_position
field must beIntersection
type andoptional
. -
Implement the
move_to_next_intersection
method to update the vehicle's current position. -
Implement the
has_reached_destination
method to check if the vehicle has reached its final destination. It has to return thebool
type. -
Remember to implement unit tests for a **
Vehicle
** class and its methods, use pytest for tests.
-
-
task_7 (35 points)
-
Create a function called
vehicle_factory
withid
,type
,speed
,current_route
, andcurrent_position
arguments. -
The function must be located in
domain/entities.py
. -
id
andtype
arguments must bestr
type,speed
argument must beint
type,current_route
argument must belist
ofIntersection
andcurrent_position
argument must beIntersection
type andoptional
. -
Factory should return the type as a
Vehicle
class object. -
Remember to implement unit tests for a
vehicle_factory
function, use pytest for tests.
-