-
Notifications
You must be signed in to change notification settings - Fork 50
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ParameterBindings at a higher hierarchy level must take precedence over bindings defined in lower levels #1305
Comments
@GorbadPS3 can you provide the ssp file, so that it is much easier to debug |
@arun3688 Unfortunately, the SSP model used and all the sub-FMI components is proprietary. It should be enough to create a simple FMI model and create a single parameter for it, then define an output variable in the FMI that simply returns the parameter value. This way, you can then add this FMI as a component under a system in SSP, and define ParameterBindings as System and Component level to write to the same parameter. This should demonstrate the issue. |
@GorbadPS3 The name of the parameter at higher level and at component level should be the same, so the parameter binding at the component level should be written as full qualified names incase you want the system level hierarchy to take precedence over component level so it should
|
@arun3688 is this specified in the SSP standard? I cannot find a reference for why the individual Component's parameter should reference the whole system hierarchy like that. Why should the "Component" layer know about its position within the full system, by essentially "referencing upwards until you hit the root"? |
@GorbadPS3 I guess it is not specified in the standards but the example you have inline parameter bindings, and the component itself has another inline parameter settings which is fine, but you want the top level system parameter bindings to override the value and currently OMSimulator does not check for the inline settings in the ssp i guess i need to verify it. But we had discussion about this when we were implementing this and we thought that if we want to make system level parameter settings to take priority then it should be exported to ssv files and referenced in the ssp file for example
and in the ssv file you can have all the top level parameter settings and it should work, see some examples we have
But anyways OMSimulator always checks for fully Qualified names in case for top level parameter priority like |
Using a source file ".ssv" does not seem to override inline variables in OMSimulator right now.
^This, with this content:
Does not affect my simulation results at all, if my SSP has this definition:
In other words, it doesn't matter if my inline parameter is written as "A.width" (full path) or "width" (just variable name), the .ssv file does not override it. Is this intended behaviour in OMSimulator? The way I see it: It would be useful for an SSP to have "sane default values" in the inline parameters, but from the .ssv file you can then override what you need to create a case-specific initial condition for your system. This doesn't seem to be a supported use-case? I can confirm that removing the inline definition entirely does allow me to modify the parameter values of components, using an SSV file that looks like this (i.e. contains full path "A.width"):
|
@GorbadPS3 I did some testing and i can confirm the following
OMSimulator currently checks for the parameter bindings at the current level and if there are no parameter bindings exists then it checks for the top level systems and the values are applied (case-2), however according to ssp standards the top level system parameter bindings have priority over component level, I will try to fix this |
@GorbadPS3 the issue is fixed with this commit 637a1c9, please update your OMSimulator and hopefully it should fix the issue |
@arun3688 Sorry for the delayed response. I've been extremely busy at work, and will look into this as soon as I have time. Thank you for the quick fix! |
Description
In the documentation for SSP, section 5.2.3 ParameterBindings, we can see the following definition:
This means that in an SSP file, where we define a system like this:
Then, during OMSimulations, we should write the parameter value 60 to the parameter "width" of the sub-element "A".
This does not appears to be the case during my tests. If I remove the parameter definition from the sub-element "A", then I get different simulation results than if the parameter definition is there. Meaning, the sub-element's "width=30" is being applied to the component during simulations.
Steps to reproduce the behavior
Create an SSP model with a System hierarchy such that you're writing as a component level a parameter X, and above the component (in the system level) you're overriding it using the "Component.X" hierarchy reference mechanism.
Expected behavior
The parameters at the top level should be applied during simulaiton, not lower levels.
Version and OS
The text was updated successfully, but these errors were encountered: