open-simulation-platform / libcosim

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

Initial value is not properly assigned when there is a mistake of type. #689

Open kevinksyTRD opened 2 years ago

kevinksyTRD commented 2 years ago

I found that if I assign an initial value with a wrong type, it will be assigned to another variable.

Let's say we have one variable, x, which is of "Real" type and another, y, of "Integer" type.

In the OspSystemDescription.xml file, if I write

<InitialValue variable="x">
    <Integer value="1.0">
</InitialValue>

This will assigned the value 1.0 to y as it is the integer variable with the same reference number.

I think that it should either give an error or convert value to real and assign it to the correct variable.