i am trying to get familiar with OMShell because i need to do multiple simulations with models in my self-written package extending models of the buildings library…multiple runs, where i want to vary weatherfiles used and some values within a parameter-record defining my model. I’d like to write a script (.mos) to automate this process and came across the command “setParameterValue()”. Trying to use it to manipulate a parameter of a model within the model i simulate doesn*t seem to work as i get an Error-message stating that it couldn’t find the class. But it works when i want to manipulate a parameter in the model i want to simulate itself.
I loaded my package >>loadFile(/home/…/mypackage.mo”) and simulated the model >>simulate(mypackage.mymodel). After that i tried to change one parameter of a model inside the simulated model >>setParameterValue(mypackage.mymodel.anothermodelinsidemymodel, parameter_to_change, value).
As long as the parameter is in the model i simulate itsef, it works. But going one model-level deeper i cant change any parameter.
Is there a restriction for this command to only be applicable on the model that i simulate and not on ones within it? I would like to know how to access the parameters that are on a “deeper level”….hope you get what i want to express. Thank you very much for your help in advance!
Roman
Dummer Horst is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.