diff --git a/examples/C/src/SkiLift/Readme.md b/examples/C/src/SkiLift/Readme.md new file mode 100644 index 00000000..b5a85905 --- /dev/null +++ b/examples/C/src/SkiLift/Readme.md @@ -0,0 +1,97 @@ + +

+
+ Markdownify +
+
+ Autonomous Ski Lift System +
+

+ +

A safe and efficient ski lift system build with Lingua Franca.

+ +
+ +
+ +
+ + +## About the Project + +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: + +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. + +## How To Use + +To clone and run this application, you'll need [Git](https://git-scm.com) and [Lingua Franca](https://www.lf-lang.org/docs/installation) installed on your computer. From your command line: + +```bash +# Clone this repository +$ git clone https://github.com/lf-lang/playground-lingua-franca.git + +# Go into the example folder of the repository +$ cd playground-lingua-franca/examples/C + +# Compile the main reactor +$ lfc src/SkiLift/Lift.lf + +# Run the program +$ bin/Lift +``` + +> **Note:** +> Or you can compile and run the program simply using VS Code, [see section "Running Locally"](https://github.com/lf-lang/playground-lingua-franca). + + +## Components (Reactors) + + + + + + + + + + + + + + + + + + + + + + + +
Lift + Lift.lf: The main reactor that controls all timed and startup events, receives signals from sensors, and manages the lift behavior.
EntryGate + EntryGate.lf: Uses a modal model to control the opening and stopping of the entry gate.
ScreenPrinter + ScreenPrinter.lf: Manages stdout behavior for the ski lift simulation. This reactor handles printing lift animations, clearing lines, and refreshing the displayed output to ensure smooth and dynamic visualization.
EntrySensor + EntrySensor.lf: Processes data from the sensor placed at the entry gate. This reactor tracks the number of people attempting to board the lift, ensuring accurate passenger flow management.
LiftSensor + + LiftSensor.lf: Processes data from two sensors—one at the start of the lift and one at the end. +
    +
  • Start sensor: Detects when a lift chair is ready to carry passengers in the ready area. If triggered, it signals the gate to open, allowing the next group of passengers to board.
  • +
  • End sensor: Detects when a lift chair reaches the unloading area. If triggered, it checks whether any passengers remain in the exit area, ensuring a smooth and safe unloading process.
  • +
+
ObjectDetector + ObjectDetector.lf: Detects the number of people on the ready and exit areas.
LiftMotion + LiftMotion.lf: Uses a modal model to control the motion of the lift.
+ + diff --git a/examples/C/src/SkiLift/assets/EntryGate.png b/examples/C/src/SkiLift/assets/EntryGate.png new file mode 100644 index 00000000..6b8e54d0 Binary files /dev/null and b/examples/C/src/SkiLift/assets/EntryGate.png differ diff --git a/examples/C/src/SkiLift/assets/EntrySenor.png b/examples/C/src/SkiLift/assets/EntrySenor.png new file mode 100644 index 00000000..c2492e48 Binary files /dev/null and b/examples/C/src/SkiLift/assets/EntrySenor.png differ diff --git a/examples/C/src/SkiLift/assets/Lift.png b/examples/C/src/SkiLift/assets/Lift.png new file mode 100644 index 00000000..1a5358fe Binary files /dev/null and b/examples/C/src/SkiLift/assets/Lift.png differ diff --git a/examples/C/src/SkiLift/assets/LiftMotion.png b/examples/C/src/SkiLift/assets/LiftMotion.png new file mode 100644 index 00000000..5b8f8b20 Binary files /dev/null and b/examples/C/src/SkiLift/assets/LiftMotion.png differ diff --git a/examples/C/src/SkiLift/assets/LiftSensor.png b/examples/C/src/SkiLift/assets/LiftSensor.png new file mode 100644 index 00000000..bd9b0ab6 Binary files /dev/null and b/examples/C/src/SkiLift/assets/LiftSensor.png differ diff --git a/examples/C/src/SkiLift/assets/ObjectDetector.png b/examples/C/src/SkiLift/assets/ObjectDetector.png new file mode 100644 index 00000000..9ce6f36b Binary files /dev/null and b/examples/C/src/SkiLift/assets/ObjectDetector.png differ diff --git a/examples/C/src/SkiLift/assets/ScreenPrinter.png b/examples/C/src/SkiLift/assets/ScreenPrinter.png new file mode 100644 index 00000000..f5d174f4 Binary files /dev/null and b/examples/C/src/SkiLift/assets/ScreenPrinter.png differ diff --git a/examples/C/src/SkiLift/assets/cable-car-solid.svg b/examples/C/src/SkiLift/assets/cable-car-solid.svg new file mode 100644 index 00000000..04bcefdd --- /dev/null +++ b/examples/C/src/SkiLift/assets/cable-car-solid.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/examples/C/src/SkiLift/assets/demo.mov b/examples/C/src/SkiLift/assets/demo.mov new file mode 100644 index 00000000..58168444 Binary files /dev/null and b/examples/C/src/SkiLift/assets/demo.mov differ