Archived OpenModelica forums. Posting is disabled.

Alternative forums include GitHub discussions or StackOverflow (make sure to read the Stack Overflow rules; you need to have well-formed questions)


Forgot password? | Forgot username? | Register

Good practice on parameter centralization

Good practice on parameter centralization

Hello,

Would it be considered a bad practice to collect several parameters of a multi-component system into a single record?
This would allow a quicker change of a set of parameters, but I don't know whether it's considered as good practice in general.

for example (code snippet below might contains errors, but it's just to illustrate what I mean):
record overview
parameter real p1;
parameter real p2;
end overview;

class one
parameter real p1;
overview myBag;
equations
p1 = myBag.p1;
end one;
class two
parameter real p2;
overview myBag;
equations
p2 = myBag.p2;
end two;

gtz,
Dieter

Re: Good practice on parameter centralization

A record with only parameters is fine. Mixing parameters and variables in the same record is begging for trouble.

Re: Good practice on parameter centralization

ok, thanks

There are 0 guests and 0 other users also viewing this topic
You are here: