1 |
4748b215
|
hbourbou
|
-- This file has been generated by CoCoSim2.
|
2 |
|
|
|
3 |
|
|
-- Compiler: Lustre compiler 2 (ToLustre.m)
|
4 |
|
|
-- Time: 03-Dec-2018 23:03:16
|
5 |
|
|
node bool_to_real(x : bool;)
|
6 |
|
|
returns(y : real;);
|
7 |
|
|
let
|
8 |
|
|
y = if x then
|
9 |
|
|
1.0
|
10 |
|
|
else 0.0;
|
11 |
|
|
tel
|
12 |
|
|
|
13 |
|
|
(*
|
14 |
|
|
Original block name: bangbang_PP/B
|
15 |
|
|
*)
|
16 |
|
|
node B_64_323(in_1_1 : real;
|
17 |
|
|
__time_step : real;
|
18 |
|
|
__nb_step : int;)
|
19 |
|
|
returns(out_1_1 : real;);
|
20 |
|
|
var Constant_1 : real;
|
21 |
|
|
DataTypeConversion1_1 : real;
|
22 |
|
|
DataTypeConversion2_1 : real;
|
23 |
|
|
RelationalOperator_1 : bool;
|
24 |
|
|
RelationalOperator1_1 : bool;
|
25 |
|
|
Sum_1 : real;
|
26 |
|
|
let
|
27 |
|
|
Constant_1 = 0.000000000000000;
|
28 |
|
|
DataTypeConversion1_1 = bool_to_real(RelationalOperator_1);
|
29 |
|
|
DataTypeConversion2_1 = bool_to_real(RelationalOperator1_1);
|
30 |
|
|
RelationalOperator_1 = (in_1_1 > Constant_1);
|
31 |
|
|
RelationalOperator1_1 = (in_1_1 < Constant_1);
|
32 |
|
|
Sum_1 = 0.0 + DataTypeConversion1_1 - DataTypeConversion2_1;
|
33 |
|
|
out_1_1 = Sum_1;
|
34 |
|
|
tel
|
35 |
|
|
|
36 |
|
|
(*
|
37 |
|
|
Original block name: bangbang_PP
|
38 |
|
|
*)
|
39 |
|
|
node bangbang_PP(wheel_speed_1 : real;)
|
40 |
|
|
returns(ApplyBrakes_1 : real;);
|
41 |
|
|
var B_1 : real;
|
42 |
|
|
__time_step : real;
|
43 |
|
|
__nb_step : int;
|
44 |
|
|
let
|
45 |
|
|
B_1 = B_64_323(wheel_speed_1, __time_step, __nb_step);
|
46 |
|
|
ApplyBrakes_1 = B_1;
|
47 |
|
|
__time_step = (0.0 -> ((pre __time_step) + 0.200000000000000));
|
48 |
|
|
__nb_step = (0 -> ((pre __nb_step) + 1));
|
49 |
|
|
tel
|