You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: subjects/java/raids/jraffic/README.md
+21-3Lines changed: 21 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -47,7 +47,24 @@ East --------------- --------------- West
47
47
48
48
Position traffic lights at the points where each lane enters the intersection. Your traffic lights should only have two colors: red and green.
49
49
50
-
You can use any algorithm to control the traffic lights. However, the system should be efficient enough to avoid traffic congestion (8 or more vehicles). The primary aim of the traffic light system is to prevent collisions at the intersection.
50
+
You can implement any algorithm you choose to control the traffic lights system, but bear in mind that **traffic congestion should remain below the lane’s maximum capacity**.
51
+
52
+
> **Dynamic Congestion Rule:**
53
+
> The maximum allowed queue length for each lane is calculated based on the lane’s physical length, vehicle length, and safety gap between vehicles:
> - `lane_length`: Distance from the stop line to the vehicle spawn point
62
+
> - `vehicle_length`: Approximate car length in simulation units (e.g., pixels or meters)
63
+
> - `safety_gap`: Minimum safe distance between vehicles
64
+
>
65
+
> If the number of vehicles in a lane reaches this capacity, the traffic light logic should adjust (e.g., extend green time for that lane) to prevent overflow.
66
+
67
+
The primary function of your traffic light system is to avoid collisions between vehicles passing through the intersection, while dynamically adapting to congestion.
51
68
52
69
**3. Vehicles**
53
70
@@ -56,6 +73,7 @@ You can use any algorithm to control the traffic lights. However, the system sho
56
73
/|_||_\`.__
57
74
=`-(_)--(_)-'
58
75
```
76
+
59
77
The vehicles traveling through your capital city's new junction must follow these rules:
60
78
61
79
- Vehicles must be painted in a color that illustrates the route they will follow. The colors are up to you to decide, and your choices will need to be made available during the audit of the raid. For example, all cars which make a right turn could be painted yellow. It's really up to you though.
@@ -87,21 +105,21 @@ You will use your keyboard to spawn vehicles for your simulation. You will use t
87
105
88
106
> A safe distance is any distance which enables the vehicles to avoid crashing into each other.
89
107
90
-
91
108
### Example
92
109
93
110
You can see an example for road_intersection [here](https://www.youtube.com/watch?v=6B0-ZBET6mo).
94
111
95
112
### Bonus
113
+
96
114
You can implement the following optional features:
97
115
98
116
- Vehicle and traffic light animations, and image rendering. You can find some cool assets here:
Copy file name to clipboardExpand all lines: subjects/java/raids/jraffic/audit/README.md
+6-5Lines changed: 6 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,7 +1,8 @@
1
-
#### Comprehension
1
+
#### Comprehension
2
+
3
+
**_Is the student able to justify his choices and explain the following:_**
4
+
**_Note:_** Ask the student to show you the implementation in the source code when necessary.
2
5
3
-
***Is the student able to justify his choices and explain the following:***
4
-
***Note:*** Ask the student to show you the implementation in the source code when necessary.
5
6
###### Can the student explain why he uses this library?
6
7
7
8
###### Can the student explain how he manages the High-Traffic congestion
@@ -12,7 +13,7 @@
12
13
13
14
###### Can the student explain how he manages the key hooks?
14
15
15
-
#### Functional
16
+
#### Functional
16
17
17
18
##### Try to run the application.
18
19
@@ -94,7 +95,7 @@
94
95
95
96
###### Was the simulation ended?
96
97
97
-
###### High traffic congestion is when there are 8 or more vehicles in the same lane without proceeding. Was there low traffic congestion while running the simulation?
98
+
###### High traffic congestion is when there are **Max Capacity** in the same lane without proceeding. Was there low traffic congestion while running the simulation?
Copy file name to clipboardExpand all lines: subjects/road_intersection/README.md
+18-4Lines changed: 18 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -53,9 +53,24 @@ Traffic lights are signaling devices positioned at road intersections that follo
53
53
54
54
You will position those traffic lights at the point where each lane enters the intersection.
55
55
56
-
You can implement any algorithm you choose to control the traffic lights system, but bare in mind that traffic congestion should not be too high (8 or more vehicles).
57
-
58
-
The primary function of **your** traffic light system, is to avoid collisions between vehicles passing through the intersection.
56
+
You can implement any algorithm you choose to control the traffic lights system, but bear in mind that **traffic congestion should remain below the lane’s maximum capacity**.
57
+
58
+
> **Dynamic Congestion Rule:**
59
+
> The maximum allowed queue length for each lane is calculated based on the lane’s physical length, vehicle length, and safety gap between vehicles:
> - `lane_length`: Distance from the stop line to the vehicle spawn point
68
+
> - `vehicle_length`: Approximate car length in simulation units (e.g., pixels or meters)
69
+
> - `safety_gap`: Minimum safe distance between vehicles
70
+
>
71
+
> If the number of vehicles in a lane reaches this capacity, the traffic light logic should adjust (e.g., extend green time for that lane) to prevent overflow.
72
+
73
+
The primary function of your traffic light system is to avoid collisions between vehicles passing through the intersection, while dynamically adapting to congestion.
59
74
60
75
**3. Vehicles**
61
76
@@ -105,7 +120,6 @@ You can see an example for road_intersection [here](https://www.youtube.com/watc
105
120
You can implement the following optional features:
106
121
107
122
- Vehicle and traffic light animations, and image rendering. You can find some cool assets here:
Copy file name to clipboardExpand all lines: subjects/road_intersection/audit/README.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -76,7 +76,7 @@
76
76
77
77
###### Was the simulation ended?
78
78
79
-
###### High traffic congestion is when there are 8 or more vehicles in the same lane without proceeding. Was there low traffic congestion while running the simulation?
79
+
###### High traffic congestion is when there are **Max Capacity** in the same lane without proceeding. Was there low traffic congestion while running the simulation?
0 commit comments