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

Enumeration issue

Enumeration issue

Hi there,
I am having difficulties with enumeration type in OM. It seems that the type is not supported completely. Any recommendations are very much appreciated.
Many thanks

Re: Enumeration issue

Hi,

First, you should tell us what OpenModelica version you use (and what OS) and maybe also give an example model with your problem.

Enumerations are supported, the only missing thing is using enumeration constants as index in arrays, i.e.:
Real[EnumerationType] x; will generate in the flattened code:

Real x[1];
Real x[2];
...
instead of:

Real x[EnumerationType.enum1];
Real x[EnumerationType.enum2];
...

Cheers,
Adrian Pop/

Re: Enumeration issue

Hi,
Thanks for your help. It was just me trying to use enumeration type for connectors, which is not the right way to use it. I have found an alternative solution with Boolean connectors.
Thanks, anyway
Ivan

There are 0 guests and 0 other users also viewing this topic