- Index
- » Usage and Applications
- » OpenModelica Usage and Applications
- » Redeclare models based on a parameter...
Page Start Prev 1 Next End
Redeclare models based on a parameter selection
Redeclare models based on a parameter selection
Oct-11-10 13:39:11
Hello everyone,
I've been battling with this problem but till now I couldn't find out the solution. I have several models that I'd like to be redeclared based on the selection of an integer parameter (depending on this parameter select either several simplified models of the same system or some more complex models).
Is there a way to do this? I am running out of ideas...
Regards and thanks in advance,
Manatax
Re: Redeclare models based on a parameter selection
Oct-11-10 13:44:22
There isn't an easy way to do this. Conditional components are rather ugly:
Code:
class WithAlternatives
parameter Integer alternative;
Real alt1 if alternative == 1;
Integer alt2 if alternative == 2;
end WithAlternatives;
class A
extends WithAlternatives(alternative = 2);
end A;
- sjoelund.se
- 1700 Posts
Page Start Prev 1 Next End
- Index
- » Usage and Applications
- » OpenModelica Usage and Applications
- » Redeclare models based on a parameter...
There are 0 guests and 0 other users also viewing this topic