SED-ML / sed-ml

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

Allow SetValue to set attributes of simulations to allow the execution of variants of simulations (in addition to variants of models) #98

Open jonrkarr opened 3 years ago

jonrkarr commented 3 years ago

Together, RepeatedTask, Range, and SetValue enable simulation experiments of multiple variants of a model (e.g., a set of simulations of a model with different values for an initial condition). This provides abstraction that isn't afforded with Task alone.

As far as I understand, this set of classes is currently limited to describing the execution of a set of variants of a model. The same machinery cannot be used to describe the execution of a set of variants of a simulation (e.g., multiple simulations of the same model with different step sizes).

To support the above use case and for parallelism with the description of model variants, I suggest SetValue be extended to capture changes to the values of instances of AlgorithmParameter. This would require at least one additional attribute.

jonrkarr commented 3 years ago

This requires changes such as:

luciansmith commented 3 years ago

AlgorithmParameter, like every element in SED-ML, already has an id from SEDBase, so we'd be OK on that front already.

jonrkarr commented 3 years ago

I don't see that in the schema.

luciansmith commented 3 years ago

It's in the UML for l1v4; the schema probably hasn't been updated yet.

luciansmith commented 3 years ago

So, in theory this can be accomplished with the current SED-ML schema; it's just a matter of explaining it in the text.

I think we need a vote from the current SED-ML editors as to what to do (and everyone else is invited to chime in as well). Here's the options as I see them:

1) Describe in the L1v4 spec how to do this with the current schema. Since modelReference is required, this would change the AlgorithmParameter only when that algorithm is applied to referenced model. 2) Describe in the L1v4 spec how to do this, and make modelReference optional, so the change applies to the AlgorithmParameter in all situations. (Since libsedml doesn't do validation anyway, it won't need to be changed.) 3) Make this an L2 goal, and don't change the L1v4 spec at all. 4) Disallow this.

My advisory opinion (as a non-current editor) is that 2) seems reasonable, if someone wants to implement support for it. If we don't get implementation, this gets pushed to option 3). I do like it, and would not vote for 4).

jonrkarr commented 3 years ago

How would this be done with the current schema? Using local URI fragments (e.g, #...)?

If the targets were limited to algorithms (i.e., KiSAO id) and their parameters, I think this would be fairly straightforward for many simulation tools to implement. But, it would be useful to be able to reference parameters not by local ids (which they don't have), but by their KiSAO ids (e.g., using XPATHs within SED-ML documents). I think this would get a bit beyond a simple change to the current schema.

If the targets were not limited to this (e.g., changing the source of a model), the implementational complexity could be significant. For this reason, I would discourage this.

luciansmith commented 3 years ago

The SED-ML would look like:


    <uniformTimeCourse id="sim0" initialTime="0" outputStartTime="0" outputEndTime="10" numberOfSteps="10">
      <algorithm kisaoID="KISAO:0000019">
        <listOfAlgorithmParameters>
          <algorithmParameter id="sim0_abs_tol" kisaoID="KISAO:0000211" value="0.04"/>
        </listOfAlgorithmParameters>
      </algorithm>
    </uniformTimeCourse>

[...]

        <setValue modelReference="model0" target="#sim0_abs_tol">
          <math xmlns="http://www.w3.org/1998/Math/MathML">
            <cn> 0.5 </cn>
          </math>
        </setValue> 
jonrkarr commented 3 years ago

That works. I forgot AlgorithmParameter now has an id attribute in L1V4.

If this can be set, does it also need to be possible to control how it be reset similar to resetModel?

luciansmith commented 3 years ago

For now, I would lump this in with everything else and say that it should also be reset if 'resetModel' was true, and then revisit the idea in L2 (especially if the 'modelReference' attribute remained required).

jonrkarr commented 3 years ago

In that case, I think the text should clarify that resetModel means reset everything, including simulations.

matthiaskoenig commented 3 years ago

Yes. This should be stated in the specification. It would also be great if we add the example for setting an AlgorithmParameter to the specification.

luciansmith commented 3 years ago

Coming back to this: I forgot that we had proposed this change, so a lot of my new text specifically disallows this. On the plus side, if we decide we want it, I now know exactly where to make the change ;-)

Let's vote! Should we allow SetValue to change AlgorithmParameters in L1v4, or postpone it to later? @jonrkarr , @matthiaskoenig , @fbergmann , @nickerso , and Tomas? (I invited Tomas to this github project just today, so he's not in the at-list yet.)

The change would be:

No change to the library is needed. We'd then need someone to implement this.

jonrkarr commented 3 years ago

In the interest of keeping L1V4 closer to things that are implemented by multiple tools, I would vote to leave this for L2. Also, I'd like to see this is part of broader ability to use SetValue with the attributes of algorithms (KiSAO id), simulations (e.g., number of steps when the steps to record is not differentiated from the number of steps to compute as in pyNeuroML), and tasks (model reference).

nickerso commented 3 years ago

In the interest of keeping L1V4 closer to things that are implemented by multiple tools, I would vote to leave this for L2.

agreed.

matthiaskoenig commented 3 years ago

agree, L2

On Thu, Jun 10, 2021 at 5:16 AM David Nickerson @.***> wrote:

In the interest of keeping L1V4 closer to things that are implemented by multiple tools, I would vote to leave this for L2.

agreed.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/SED-ML/sed-ml/issues/98#issuecomment-858247574, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAG33OVHBY5DDU4BT74CZPDTSAVCFANCNFSM4W6BQBUQ .

-- Matthias König, PhD. Junior Group Leader LiSyM - Systems Medicine of the Liver Humboldt Universität zu Berlin, Institute of Biology, Institute for Theoretical Biology https://livermetabolism.com @.*** https://twitter.com/konigmatt https://github.com/matthiaskoenig Tel: +49 30 2093 98435

luciansmith commented 3 years ago

That's three--done!