Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions subjects/road_intersection/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,15 @@ You will use your keyboard to spawn vehicles for your simulation. You will use t

> A safe distance is any distance which enables the vehicles to avoid crashing into each other.

### Unit Tests

You must implement unit tests within your `road_intersection` project to ensure your traffic logic and vehicle physics are sound. Specifically, your tests should:

- Verify the **Dynamic Congestion Rule** by ensuring the `capacity` calculation correctly uses the `lane_length`, `vehicle_length`, and `safety_gap` variables.
- Verify that a vehicle correctly identifies a "stop" condition when the distance to the vehicle in front is less than or equal to the `safety_gap`.
- Test the **Traffic Light Controller** to ensure that the algorithm never allows green lights for conflicting paths (e.g., North-South and East-West) simultaneously.
- Verify **Route Persistence** by testing that once a vehicle is assigned a route (Left, Right, or Straight), its internal state remains consistent and does not change during the simulation.

### Example

You can see an example for road_intersection [here](https://www.youtube.com/watch?v=6B0-ZBET6mo).
Expand Down
10 changes: 10 additions & 0 deletions subjects/road_intersection/audit/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,16 @@

###### Do vehicles proceed whenever there is a green light?

#### Unit Tests

###### Do all tests pass without errors?

###### Are there specific tests for the **Dynamic Congestion Rule** (e.g., verifying capacity calculation and green light extension)?

###### Are there tests for **Vehicle Physics**, such as checking if a car stops correctly when a `safety_gap` is breached?

###### Are there tests for the **Traffic Light Controller** to ensure no two perpendicular lanes have a green light at the same time?

#### Bonus

###### +Is there any type of image sprite for traffic light? (An image sprite is a collection of images put into a single image.)
Expand Down
Loading