diff --git a/examples/C/src/SkiLift/Lift.lf b/examples/C/src/SkiLift/Lift.lf index 1ab52ed1..b19854b6 100644 --- a/examples/C/src/SkiLift/Lift.lf +++ b/examples/C/src/SkiLift/Lift.lf @@ -1,9 +1,19 @@ /** - * This illustrates bank of reactors where each reactor produces an output that is broadcast to all - * reactors in the bank, including itself. +* This project simulates the behavior of ski lifts with a focus on improving + * safety and reducing labor costs through automation using Lingua Franca. + * The simulation models key aspects of ski lift operations, including: * - * @author Christian Menard - * @author Edward A. Lee + * 1. Passenger Flow & Lift Capacity + * - Ensuring smooth and efficient boarding/unboarding. + * 2. Safety Mechanisms + * - Detecting potential dangers and automating responses to prevent accidents. + * 3. Autonomous Control + * - Optimizing lift operations with minimal human intervention. + * + * The goal is to explore how automation can enhance safety while reducing + * operational costs, making ski lifts more efficient and reliable. + * + * @author Cheng Yen, Tsai */ target C @@ -170,15 +180,7 @@ main reactor Lift { lf_set(liftMotion.move, self->move); =} - // Behaviors on the start of the lift - // reaction(liftSensor.start_ready) -> entryGate.open {= - // if (liftSensor.start_ready->value) { - // self->open = true; - // } else { - // self->open = false; - // } - // lf_set(entryGate.open, self->open); - // =} + // TODO: Behaviors on the start of the lift reaction(objectDetector.start_number) {= if (objectDetector.start_number != 0) { self->start_number = objectDetector.start_number->value; @@ -186,13 +188,6 @@ main reactor Lift { =} reaction(t) -> liftMotion.move {= - // start_number from objectDetector - // passenger_cnt from entrySensor - // if (self->start_number != 0 && self->start_number != passenger_cnt) { - // self->move = false; - // } else { - // self->move = true; - // } self->count++; if (self->count % 10 == 0) { self->move = !self->move; @@ -231,17 +226,8 @@ main reactor Lift { } =} - // Behavior on the end of the lift - // reaction(liftSensor.end_ready) -> liftMotion.move {= - // if (liftSensor.end_ready->value) { - // if (self->end_number != 0) { - // // self->move = false; - // } else { - // // self->move = true; - // } - // //lf_set(liftMotion.move, self->move); - // } - // =} + // TODO: Behavior on the end of the lift + reaction(objectDetector.end_number) {= if (objectDetector.end_number != 0) { self->end_number = objectDetector.end_number->value; diff --git a/examples/C/src/SkiLift/lib/EntrySensor.lf b/examples/C/src/SkiLift/lib/EntrySensor.lf index d0f44b20..6afbf1a1 100644 --- a/examples/C/src/SkiLift/lib/EntrySensor.lf +++ b/examples/C/src/SkiLift/lib/EntrySensor.lf @@ -1,3 +1,6 @@ +/** + * @author Cheng Yen, Tsai + */ target C preamble {= @@ -20,17 +23,11 @@ reactor EntrySensor { output gate_1: bool output gate_2: bool output gate_3: bool - // output gate_4: bool - // output gate_5: bool - // output gate_6: bool timer t(0, 200 msec); reaction(t) -> gate_1, gate_2, gate_3 {= lf_set(gate_1, random_bool()); lf_set(gate_2, random_bool()); lf_set(gate_3, random_bool()); - // lf_set(gate_4, true); - // lf_set(gate_5, true); - // lf_set(gate_6, true); =} } diff --git a/examples/C/src/SkiLift/lib/LiftSensor.lf b/examples/C/src/SkiLift/lib/LiftSensor.lf index ca1641e7..11cbe54f 100644 --- a/examples/C/src/SkiLift/lib/LiftSensor.lf +++ b/examples/C/src/SkiLift/lib/LiftSensor.lf @@ -1,3 +1,6 @@ +/** + * @author Cheng Yen, Tsai + */ target C reactor LiftSensor { diff --git a/examples/C/src/SkiLift/lib/ObjectDetector.lf b/examples/C/src/SkiLift/lib/ObjectDetector.lf index 2b86a378..87a85980 100644 --- a/examples/C/src/SkiLift/lib/ObjectDetector.lf +++ b/examples/C/src/SkiLift/lib/ObjectDetector.lf @@ -1,3 +1,6 @@ +/** + * @author Cheng Yen, Tsai + */ target C reactor ObjectDetector {