SED-ML / sed-ml

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

Clarify use of global ListOfAlgorithmParameters in repeated task #171

Closed matthiaskoenig closed 3 years ago

matthiaskoenig commented 3 years ago

The global parameter must be applied in the repeated tasks. The seed exception can be removed.

Currently it states:

Then, for each SubTask child of the RepeatedTask, in the order specified by its order attribute:

  • Any AlgorithmParameter children of the associated Simulation are applied (with the possible exception of the seed; see Section 2.2.7.2).
  • Any SetValue children of the SubTask are applied to the relevant Model.
  • The referenced Task of the SubTask is executed.

Which should be

Then, for each SubTask child of the RepeatedTask, in the order specified by its order attribute:

  • Any AlgorithmParameter in the global ListOfAlgorithmParameters is applied
  • Any AlgorithmParameter children of the associated Simulation are applied (with the possible exception of the seed; see Section 2.2.7.2).
  • Any SetValue children of the SubTask are applied to the relevant Model.
  • The referenced Task of the SubTask is executed.
luciansmith commented 3 years ago

There's still a note about a possible seed exception in section 2.2.7.2 that I think is worth linking to. The text there (top of p41) reads:

NOTE: the global ListOfAlgorithmParameters was added to SED-ML in Level 1 Version 4. As such, the only place to define a random seed (KISAO:0000211) for the simulation experiment as a whole in previous versions was in a Simulation, which might be part of a RepeatedTask. Rather than indicating that each repeat was to receive the same seed, resulting in identical traces, users would generally use the ’seed’ parameter to indicate that the experiment as a whole was to be replicable from one run to the next. Current users of SED-ML should use a global AlgorithmParameter for this purpose, but older versions or older files may use the previous scheme.

matthiaskoenig commented 3 years ago

Agree. The note is important. Updated my suggestion

luciansmith commented 3 years ago

Actually, the seed thing illustrates that the suggestion is actually incorrect: algorithm parameters from the global list should be applied exactly once and then not changed again. If you apply it every time, you'd reset the seed, which is precisely the problem we're trying to avoid. I can't even add it to the previous list, since it also says "The order of activities within each iteration of a RepeatedTask is as follows:"

luciansmith commented 3 years ago

Added this to the description of AlgorithmParameter:

"Any AlgorithmParameter child of a Simulation applies only to that individual Simulation, and assumes its previous value (if set globally) or becomes unset (if not) outside of the context of that Simulation (for example, within a RepeatedTask)."