SED-ML / sed-ml

Simulation Experiment Description Markup Language (SED-ML)
http://sed-ml.org
5 stars 2 forks source link

Clarify which model variables are used in FunctionalRange and SetValue #167

Closed matthiaskoenig closed 3 years ago

matthiaskoenig commented 3 years ago

Hi all, there are some confusing formulations in the spec in respect to FunctionalRange and Set Value:

2.2.9.3.4 "FunctionalRange":

The value of any Variable child of a FunctionalRange should be calculated before the first simulation begins, and will not be affected by any SubTask in the RepeatedTask.

2.2.9.2: "SetValue":

Again as for functionalRange, variable references retrieve always the current value of the model variable or range at the current iteration of the enclosing repeatedTask.

The issues are:

I suggest the following fixes:

2.2.9.3.4 "FunctionalRange"

The value of any Variable child of a FunctionalRange should be calculated after the listOfChanges are applied to the models and before the first simulation begins, and will not be affected by any SubTask in the RepeatedTask.

2.2.9.2: "SetValue":

In contrast to functionalRange, variable references in setValue retrieve always the current value of the model variable and the range at the current iteration of the enclosing repeatedTask.

Best Matthias

luciansmith commented 3 years ago

I agree! Good catch. The SetValue text was written when I had a different idea of what FunctionalRange should mean.

luciansmith commented 3 years ago

(Also: I've been reserving the 'draft fix' label for after text is actually changed in github. If you're up for making the change, that'd be great.)

matthiaskoenig commented 3 years ago

Yes, will include the change now.

matthiaskoenig commented 3 years ago

I had to change the second part to before ListOfChanges; Otherwise there could be strange circular behavior. I.e. the listOfChanges could depend on ranges (so it is something range dependent which is changed in iterations). If one wanted to change values before one could always create a new model with changes or add the change to the actual functional range.

2.2.9.3.4 "FunctionalRange"

The value of any Variable child of a FunctionalRange should be calculated before the listOfChanges are applied to the models and before the first simulation begins, and will not be affected by any SubTask in the RepeatedTask.