diff --git a/main/src/main/java/sd/engine/TrafficLightThread.java b/main/src/main/java/sd/engine/TrafficLightThread.java index 4b9c988..6d40fdf 100644 --- a/main/src/main/java/sd/engine/TrafficLightThread.java +++ b/main/src/main/java/sd/engine/TrafficLightThread.java @@ -10,10 +10,6 @@ import sd.model.Vehicle; * Implements the control logic for a single TrafficLight * as a Runnable task that runs in its own Thread. * - * This class fulfills the assignment requirements: - * 1. Implements Runnable (to be executed by a Thread/ExecutorService). - * 2. Implements the GREEN/RED cycle logic. - * 3. Includes a graceful shutdown mechanism (via the 'running' flag). */ public class TrafficLightThread implements Runnable { @@ -120,11 +116,11 @@ public class TrafficLightThread implements Runnable { vehicle.addCrossingTime(crossingTime); // // 4. Update intersection statistics - // (This requires getIntersection() to be public in IntersectionProcess) + process.getIntersection().incrementVehiclesSent(); // // 5. Call the parent Process to send the vehicle - // (This requires sendVehicleToNextDestination() to be public in IntersectionProcess) + process.sendVehicleToNextDestination(vehicle); // } } @@ -158,8 +154,5 @@ public class TrafficLightThread implements Runnable { */ public void shutdown() { this.running = false; - // (Note: If the thread is sleeping, it will only stop - // *after* waking up. A more immediate shutdown would require - // calling .interrupt() on the thread running this Runnable) } } \ No newline at end of file