open-simulation-platform / libcosim

OSP C++ co-simulation library
https://open-simulation-platform.github.io/libcosim
Mozilla Public License 2.0
61 stars 10 forks source link

Should FMI Enum values be ignored or should we fail fast when encountering them? #670

Closed THEvang closed 2 years ago

THEvang commented 3 years ago

I know that we don't support enum values in the model description files and it seems like they are now just ignored when encountered. The user is given a warning, but the importer continues, ignoring the variable. Is this a safe way of doing it? Couldn't the user potentially start a simulation where an important variable is ignored?

Should we just fail fast when encountering enums?

https://github.com/open-simulation-platform/libcosim/blob/22a89c439970a2e2588ed5e90082e6e892274aeb/src/cosim/fmi/v1/fmu.cpp#L77-L79

kyllingstad commented 3 years ago

If memory serves me right, this was done because we had some actual cases where we needed to use third-party FMUs that had enum parameters, but we didn't actually need to interact with those parameters in any way. Simply forbidding the use of those FMUs seemed like the worst option then, and we didn't have the time to implement proper enum support, so issuing a warning was chosen as a pragmatic solution.

eidekrist commented 2 years ago

Closing issue following discussion in OSP committee meeting