/
DistributedLogicalActionUpstreamLong.lf
62 lines (56 loc) · 1.52 KB
/
DistributedLogicalActionUpstreamLong.lf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
/**
* Test that a rapidly produced logical action in an upstream federate can be
* properly handled in a long chain of federates.
*/
target C {
timeout: 1 msec
}
import PassThrough from "../lib/PassThrough.lf"
import TestCount from "../lib/TestCount.lf"
reactor WithLogicalAction {
output out: int
state thread_id: lf_thread_t(0)
state counter: int(1)
logical action act(0): int
reaction(startup, act) -> act, out {=
lf_set(out, self->counter);
lf_schedule_int(act, USEC(50), self->counter++);
=}
}
federated reactor {
a = new WithLogicalAction()
test = new TestCount(num_inputs = 21)
passThroughs1 = new PassThrough()
passThroughs2 = new PassThrough()
passThroughs3 = new PassThrough()
passThroughs4 = new PassThrough()
passThroughs5 = new PassThrough()
passThroughs6 = new PassThrough()
passThroughs7 = new PassThrough()
passThroughs8 = new PassThrough()
passThroughs9 = new PassThrough()
passThroughs10 = new PassThrough()
a.out,
passThroughs1.out,
passThroughs2.out,
passThroughs3.out,
passThroughs4.out,
passThroughs5.out,
passThroughs6.out,
passThroughs7.out,
passThroughs8.out,
passThroughs9.out,
passThroughs10.out
->
passThroughs1.in,
passThroughs2.in,
passThroughs3.in,
passThroughs4.in,
passThroughs5.in,
passThroughs6.in,
passThroughs7.in,
passThroughs8.in,
passThroughs9.in,
passThroughs10.in,
test.in
}