sensors.luc 639 Bytes
Newer Older
1
	
2 3 4

-- Simulate perfect sensors that never get  worn
inputs { Heat_on : bool }
5 6
outputs {
        T : float ~min 0.0 ~max 50.0;
7 8 9
        T1 : real;
        T2 : real;
       T3 : real
10 11
}
locals {
12 13 14
      eps1 : real ~min -0.1 ~max 0.1;
      eps2 : real ~min -0.1 ~max 0.1;
      eps3 : real ~min -0.1 ~max 0.1;
15
}
16
nodes { 0,1 : stable }  
17 18
start_node  { 0 }  

19 20 21 22 23 24 25 26 27 28
transitions {
  0 -> 1 ~cond T = 7.0
            and T1 = T + eps1
            and T2 = T + eps2
            and T3 = T + eps3
		;
  1 -> 1 ~ cond T = pre T + (if Heat_on then 0.2 else -0.2)
            and T1 = T + eps1
            and T2 = T + eps2
            and T3 = T + eps3
29

30
 }