Skip to content

Commit 23071aa

Browse files
authored
Merge branch '01-edu:master' into master
2 parents 4e13b63 + 2994e32 commit 23071aa

4 files changed

Lines changed: 46 additions & 13 deletions

File tree

subjects/java/raids/jraffic/README.md

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,24 @@ East --------------- --------------- West
4747

4848
Position traffic lights at the points where each lane enters the intersection. Your traffic lights should only have two colors: red and green.
4949

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:
54+
>
55+
> ```
56+
> capacity = floor(lane_length / (vehicle_length + safety_gap))
57+
> ```
58+
>
59+
> Where:
60+
>
61+
> - `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.
5168
5269
**3. Vehicles**
5370
@@ -56,6 +73,7 @@ You can use any algorithm to control the traffic lights. However, the system sho
5673
/|_||_\`.__
5774
=`-(_)--(_)-'
5875
```
76+
5977
The vehicles traveling through your capital city's new junction must follow these rules:
6078
6179
- 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
87105
88106
> A safe distance is any distance which enables the vehicles to avoid crashing into each other.
89107
90-
91108
### Example
92109
93110
You can see an example for road_intersection [here](https://www.youtube.com/watch?v=6B0-ZBET6mo).
94111
95112
### Bonus
113+
96114
You can implement the following optional features:
97115
98116
- Vehicle and traffic light animations, and image rendering. You can find some cool assets here:
99-
100117
- [limezu](https://limezu.itch.io/)
101118
- [finalbossblue](http://finalbossblues.com/timefantasy/free-graphics/).
102119
- [mobilegamegraphics](https://mobilegamegraphics.com/product-category/all_products/freestuff/).
103120
- [spriters-resource](https://www.spriters-resource.com/).
104121
105122
### Notions
123+
106124
- [JavaFX](https://openjfx.io/openjfx-docs/)
107125
- [Java KeyEvents](https://docs.oracle.com/javase/tutorial/uiswing/events/keylistener.html)

subjects/java/raids/jraffic/audit/README.md

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff 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.
25

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.
56
###### Can the student explain why he uses this library?
67

78
###### Can the student explain how he manages the High-Traffic congestion
@@ -12,7 +13,7 @@
1213

1314
###### Can the student explain how he manages the key hooks?
1415

15-
#### Functional
16+
#### Functional
1617

1718
##### Try to run the application.
1819

@@ -94,7 +95,7 @@
9495

9596
###### Was the simulation ended?
9697

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?
9899

99100
#### General
100101

subjects/road_intersection/README.md

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -53,9 +53,24 @@ Traffic lights are signaling devices positioned at road intersections that follo
5353

5454
You will position those traffic lights at the point where each lane enters the intersection.
5555

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:
60+
>
61+
> ```
62+
> capacity = floor(lane_length / (vehicle_length + safety_gap))
63+
> ```
64+
>
65+
> Where:
66+
>
67+
> - `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.
5974
6075
**3. Vehicles**
6176
@@ -105,7 +120,6 @@ You can see an example for road_intersection [here](https://www.youtube.com/watc
105120
You can implement the following optional features:
106121
107122
- Vehicle and traffic light animations, and image rendering. You can find some cool assets here:
108-
109123
- [limezu](https://limezu.itch.io/)
110124
- [finalbossblue](http://finalbossblues.com/timefantasy/free-graphics/).
111125
- [spriters-resource](https://www.spriters-resource.com/).

subjects/road_intersection/audit/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@
7676

7777
###### Was the simulation ended?
7878

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?
8080

8181
#### General
8282

0 commit comments

Comments
 (0)