Opened 9 years ago

Last modified 9 years ago

#3810 accepted defect

New runtime flag -overrideSettings

Reported by: Lennart Ochel Owned by: Lennart Ochel
Priority: high Milestone: Future
Component: Run-time Version:
Keywords: Cc:

Description

The two flags –override and -overrideFile are currently used to override settings and parameters/start values. This lead to conflicts if a variable/parameter has the same name as a setting option. Hence, these flags should only be used to override parameters/start values and a new flag, e.g. –overrideSettings, should be introduced to handle setting overrides.

This would break some existing OpenModelica scripts. How should we deal with backwards compatibility?

Change History (6)

comment:1 by Lennart Ochel, 9 years ago

Status: newaccepted

comment:2 by Martin Sjölund, 9 years ago

How will we use -overrideFile to override settings, then? A bit annoying if we need to parse existing override files to send the same option on command-line.

in reply to:  2 comment:3 by Lennart Ochel, 9 years ago

Replying to sjoelund.se:

How will we use -overrideFile to override settings, then?

The idea is to stop using -overrideFile for simulation settings. Otherwise we have to parse the file twice and deal with name conflicts during runtime.

comment:4 by Martin Sjölund, 9 years ago

Name conflicts are easy to resolve though. Could just look for :stopTime or something similar if there are conflicts. I'm not sure you do need to parse the file twice either. You could just pass along the table of overrides if necessary.

comment:5 by Adrian Pop, 9 years ago

We could also have different sections in the file for model variables vs. settings, the only problem with this is that we need maybe a different separator for -override. Examples:

/* file */
model:
var1=val1
settings:
setting1=val

For -override we could do: -override=var1=val1,var2=val2#setting1=val or have some other separator than #.

comment:6 by Lennart Ochel, 9 years ago

@adrpo That sounds good. However, I would split up -override anyway and just use sections for the override files.

Note: See TracTickets for help on using tickets.