Opened 9 years ago

Last modified 9 years ago

#3962 new enhancement

OMEdit variable overrides

Reported by: crupp@… Owned by: Adeel Asghar
Priority: normal Milestone: Future
Component: OMEdit Version:
Keywords: Cc:

Description

At some time in the last year, OMEdit switched from using -override to set changed simulation parameters to updating the parameters in the init.xml file directly. I don't like this change because the original set of start parameters are lost once an updated simulation is run. It is then no longer possible to use the original set as a reference point and it is also possible to mess up your start values such that the model no longer works (e.g., for initialization), thereby forcing the user to rebuild just to get a new init.xml file.

My preference is to use the init.xml file as a reference file and then use the -override command line option to update parameter start values. This lets the user, for example, easily do parameter sweeps of one variable at a time without worrying about resetting old variables to their original values.

Is there any way to revert back to the old behavior?

Maybe there are good reasons for this change that I am unaware of?

Perhaps giving OMEdit the option to reset parameters to the original values defined in the init.xml file would be a nice feature?

Change History (7)

comment:1 by Adrian Pop, 9 years ago

Is this really the case? I don't think so. The code is here:
https://github.com/OpenModelica/OMEdit/blob/master/OMEdit/OMEditGUI/Simulation/SimulationDialog.cpp#L857
and is using -override.

comment:2 by crupp@…, 9 years ago

Yes, it definitely is the case, but you scared me into thinking I missed something. That piece of code overrides startTime, stopTime, etc., but not any parameters. The simulation output dialog has -override in the command, but is missing the updated parameters (they used to be there). Also, after re-simulating, the init.xml file is updated with a new timestamp and new value for the changed parameter (the file format also changes slightly).

I tried finding when the change occurred, but didn't have any luck. I do specifically remember the dialog overriding parameters and didn't realize there was a change until I happened to mix OMEdit and command line usage on the same model.

comment:3 by Adeel Asghar, 9 years ago

OMEdit only use override to specify startTime, stopTime etc. For the parameters OMEdit modify the init.xml file. This is how it is since the beginning. We never had code that uses override for parameters that is why you can't find anything in the source code logs.

comment:4 by crupp@…, 9 years ago

Priority: highnormal
Type: discussionenhancement

I must be losing my mind, but I tried a really old version and you are right. It is the original behavior. Sorry for the accusation.

I guess this makes it an enhancement request. I will still make the argument that the original parameter information is lost upon re-simulate because the init.xml file is changed. Going back to the original requires rebuilding the model.

I don't know how valuable this is to everyone else, so feel free to do what you want with this ticket.

comment:5 by Adrian Pop, 9 years ago

I really think we should change the current behavior and use -override instead of modifying the _init.xml file. I actually thought this was the case since we added override support.

Last edited 9 years ago by Adrian Pop (previous) (diff)

comment:6 by Adeel Asghar, 9 years ago

We can't use override for parameters because we might have problems with command line arguments limit.

We could however keep the original file and generate a new init.xml file and use it. Do you know if it's possible to specify a different init.xml file?

comment:7 by crupp@…, 9 years ago

A different init.xml can be used during simulation with the -f flag.

There is also the -overrideFile option. The input for this, however, will change with #3810, which I hope will be finished before the next release.

Note: See TracTickets for help on using tickets.