- Index
- » Usage and Applications
- » OpenModelica Usage and Applications
- » combined modification and redeclaration
Page Start Prev 1 Next End
combined modification and redeclaration
combined modification and redeclaration
Mar-04-14 22:57:51
Code:
model M1
parameter Real a = 1;
parameter Real b = 1;
end M1;
model M0
parameter Real a = 0;
parameter Real b = 0;
end M0;
model N
replaceable M0 m;
end N;
model B
N n(m.a = 3, redeclare M1 m, m.b = 3);
end B;
I simulated model B in OpenModelica revision19412.
it turned out that:
n.m.a = 3
n.m.b = 1
To my understanding the order of modification should not matter, so I guess this is a bug.
I read the Modelica spec chapter 7, about inheritance, modification, and redeclaration and it doesn't mention combined modification and redeclaration specifically, so I guess B should be equivalent to:
model B
N n(redeclare M1 m(a = 3,b = 3));
end B;
Page Start Prev 1 Next End
- Index
- » Usage and Applications
- » OpenModelica Usage and Applications
- » combined modification and redeclaration
There are 0 guests and 0 other users also viewing this topic