1 model FMUCallBeforeInitializationTestModel
\r
2 parameter Boolean b = true;
\r
3 parameter Integer i = 1;
\r
4 parameter Real r = 1.0;
\r
6 Real stockBoolean(start=0.0,fixed=true);
\r
8 Real stockInteger(start=0.0,fixed=true);
\r
10 Real stockReal(start=0.0,fixed=true);
\r
11 parameter Real time = 0; // Time parameter is set at each time step by simulator
\r
13 valveBoolean = if initial() or b or not b then (if b then 1 else -1) else pre(valveBoolean);
\r
14 valveInteger = if initial() or i < 0 or i >= 0 then (i) else pre(valveInteger);
\r
15 valveReal = if initial() or r < 0 or r >= 0 then (r) else pre(valveReal);
\r
16 der(stockBoolean) = valveBoolean;
\r
17 der(stockInteger) = valveInteger;
\r
18 der(stockReal) = valveReal;
\r
19 end FMUCallBeforeInitializationTestModel;