Skip to content

Commit

Permalink
fix: clean up comments
Browse files Browse the repository at this point in the history
  • Loading branch information
Max851010 committed Feb 4, 2025
1 parent 011a216 commit 7e81e63
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 37 deletions.
48 changes: 17 additions & 31 deletions examples/C/src/SkiLift/Lift.lf
Original file line number Diff line number Diff line change
@@ -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

Expand Down Expand Up @@ -170,29 +180,14 @@ 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;
}
=}

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;
Expand Down Expand Up @@ -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;
Expand Down
9 changes: 3 additions & 6 deletions examples/C/src/SkiLift/lib/EntrySensor.lf
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
/**
* @author Cheng Yen, Tsai
*/
target C

preamble {=
Expand All @@ -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);
=}
}
3 changes: 3 additions & 0 deletions examples/C/src/SkiLift/lib/LiftSensor.lf
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
/**
* @author Cheng Yen, Tsai
*/
target C

reactor LiftSensor {
Expand Down
3 changes: 3 additions & 0 deletions examples/C/src/SkiLift/lib/ObjectDetector.lf
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
/**
* @author Cheng Yen, Tsai
*/
target C

reactor ObjectDetector {
Expand Down

0 comments on commit 7e81e63

Please sign in to comment.