Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add example programs and a short README #116

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

erlingrj
Copy link
Contributor

@erlingrj erlingrj commented Oct 15, 2024

@byeonggiljun, do you think we should add the program used for evaluation also here?

Todo:

  • Improve README
  • Add example values to Consistency.lf
  • Add Evaluation

@byeonggiljun
Copy link
Collaborator

Thanks for working on this, @erlingrj!

do you think we should add the program used for evaluation also here?

Yes, I think so. The program should look like the code below.

target C {
  timeout: 1 sec,
  tracing: true
}

reactor A (offset:time = 0, period:time = 100 msec){
  timer t(offset, period)
  input in: int
  output out: int

  reaction (t) -> out {=
    lf_set(out, 42);
  =}

  reaction(in) {=
    instant_t logical_time = lf_time_logical_elapsed();
    instant_t physical_time = lf_time_physical_elapsed();

    lf_print("The lag is " PRINTF_TIME ".", physical_time - logical_time);
  =}
}

reactor B {
  input in: int
  output out: int
  
  reaction(in) -> out {=
    lf_set(out, in->value);
  =}
}

federated reactor at localhost {
  a = new A(offset = 0, period = 10 msec)
  b = new B()

  a.out -> b.in
  b.out -> a.in
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants