Skip to content

Commit

Permalink
Merge pull request #120 from lf-lang/fix-lff-issues
Browse files Browse the repository at this point in the history
Fixing lff formatting issues by running lff and excluding intentionally failing example in zero delay cycles
  • Loading branch information
hokeun authored Feb 8, 2025
2 parents 080de05 + ff41745 commit bde8b37
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 13 deletions.
10 changes: 4 additions & 6 deletions examples/C/src/zero-delay-cycles/Consistency.lf
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,15 @@ reactor Controller {
state latest_control: double = 0.0
state first: bool = true

reaction c1(local_update, remote_update) {=
=}
reaction c1(local_update, remote_update) {= =}

reaction c2(local_update) -> control {=
=}
reaction c2(local_update) -> control {= =}
}

reactor Platform {
input update: double
output publish: double

c = new Controller()
p = new PhysicalPlant()
p.sensor -> c.local_update
Expand All @@ -36,7 +34,7 @@ reactor Platform {
federated reactor {
p1 = new Platform()
p2 = new Platform()

p1.publish -> p2.update
p2.publish -> p1.update
}
4 changes: 4 additions & 0 deletions examples/C/src/zero-delay-cycles/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,8 @@ These examples show usage patterns for zero-delay cycles in Lingua Franca.
<td> <img src="img/ZeroDelayCycle.png" alt="ZeroDelayCycle" width="400">
<td> <a href="ZeroDelayCycle.lf">ZeroDelayCycle.lf</a>: Trivial test case.</td>
</tr>
<tr>
<td> <img src="img/CausalityLoop.png" alt="CausalityLoop" width="400">
<td> <a href="failing/CausalityLoop.lf">CausalityLoop.lf</a>: Failing example due to a causality loop.</td>
</tr>
</table>
14 changes: 7 additions & 7 deletions examples/C/src/zero-delay-cycles/ZeroDelayCycle.lf
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
target C

reactor A (Period:time = 1 msec) {
input in:int
output out:int
reactor A(Period: time = 1 msec) {
input in: int
output out: int

timer t(0, Period)

Expand All @@ -15,10 +15,10 @@ reactor A (Period:time = 1 msec) {
=}
}


reactor B {
input in:int
output out:int
input in: int
output out: int

reaction(in) -> out {=
lf_set(out, in->value);
=}
Expand All @@ -30,4 +30,4 @@ federated reactor {

a.out -> b.in
b.out -> a.in
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit bde8b37

Please sign in to comment.