- Author:
- Jonathan Cooper <jonathan.cooper@cs.ox.ac.uk>
- Date:
- 2012-09-05 09:18:42+01:00
- Desc:
- Add some unit test style simulations of a very simple single ODE model, in
order to check that implementations are processing the proposed extension
elements as expected.
- Permanent Source URI:
- https://models.fieldml.org/w/andre/testing-Sed-ML-nesting/rawfile/0382d975a69edd8a34c13bbb8b57e47d6856f285/unit_tests/test_repeated_task.xml
<?xml version="1.0" encoding="UTF-8"?>
<sedML level="1" version="1" xmlns="http://sed-ml.org/"
xmlns:m="http://www.w3.org/1998/Math/MathML"
xmlns:cellml="http://www.cellml.org/cellml/1.0#"
xmlns:cmeta="http://www.cellml.org/metadata/1.0#">
<notes>
<p xmlns="http://www.w3.org/1999/xhtml">Test proposed SED-ML nested extension</p>
</notes>
<listOfSimulations>
<uniformTimeCourse id="timecourse"
initialTime="0" outputStartTime="0" outputEndTime="10" numberOfPoints="10" >
<algorithm kisaoID="KISAO:0000019"/> <!-- CVODE -->
</uniformTimeCourse>
<oneStep id="onestep" step="1.0">
<algorithm kisaoID="KISAO:0000019"/> <!-- CVODE -->
<!--<listOfParameters>
<parameter id="end_time" value="1"/> <!-\- Default value; can be overridden by setValue -\->
</listOfParameters>-->
</oneStep>
</listOfSimulations>
<listOfModels>
<model id="model" name="Simple ODE" language="urn:sedml:language:cellml" source="simple_ode.cellml"/>
</listOfModels>
<listOfTasks>
<task id="task_utc" name="Uniform time course" modelReference="model" simulationReference="timecourse"/>
<task id="task_once" name="Single step" modelReference="model" simulationReference="onestep"/>
<!-- Test nesting with single vector range -->
<repeatedTask id="task_repeat" resetModel="true" range="loop_counter">
<listOfRanges>
<vectorRange id="loop_counter">
<value>0</value>
<value>1</value>
<value>2</value>
</vectorRange>
</listOfRanges>
<listOfChanges>
<setValue target="/cellml:model/cellml:component/cellml:variable[@name='V']" range="loop_counter">
<m:math>
<m:apply><m:minus/>
<m:cn>4</m:cn>
<m:ci>loop_counter</m:ci>
</m:apply>
</m:math>
</setValue>
</listOfChanges>
<subTask task="task_utc"/>
</repeatedTask>
<!-- Test nesting with single uniform range (and eventually, setValue of protocol parameter) -->
<repeatedTask id="task_utc_repeat" resetModel="false" range="range_utc1">
<listOfRanges>
<uniformRange id="range_utc1" start="0.0" end="10.0" numberOfPoints="10"/>
</listOfRanges>
<listOfChanges>
<!--<setValue target="#end_time" range="range_utc1">
<m:math>
<m:ci>range_utc</m:ci>
</m:math>
</setValue>-->
</listOfChanges>
<subTask task="task_once"/>
</repeatedTask>
<!-- Test nesting with single uniform range and setValue of model variable -->
<!-- Resetting V on each iteration gives a sawtooth pattern. -->
<repeatedTask id="task_utc_set_model" resetModel="false" range="range_utc2">
<listOfRanges>
<uniformRange id="range_utc2" start="0.0" end="10.0" numberOfPoints="10"/>
</listOfRanges>
<listOfChanges>
<setValue target="/cellml:model/cellml:component/cellml:variable[@name='V']">
<m:math>
<m:cn>0</m:cn>
</m:math>
</setValue>
</listOfChanges>
<subTask task="task_once"/>
</repeatedTask>
<!-- Test nesting with multiple ranges, including a functional range -->
<repeatedTask id="task_functional_range1" resetModel="false" range="range_counter1">
<listOfRanges>
<uniformRange id="range_counter1" start="0.0" end="10.0" numberOfPoints="10"/>
<functionalRange id="range_function1">
<listOfVariables>
<variable id="index" idref="range_counter1"/>
</listOfVariables>
<m:math>
<m:apply><m:plus/>
<m:cn>10</m:cn>
<m:ci>index</m:ci>
</m:apply>
</m:math>
</functionalRange>
</listOfRanges>
<listOfChanges>
<setValue target="/cellml:model/cellml:component/cellml:variable[@name='V']">
<listOfVariables>
<variable id="new_V" idref="range_function1"/>
</listOfVariables>
<m:math>
<m:ci>new_V</m:ci>
</m:math>
</setValue>
</listOfChanges>
<subTask task="task_once"/>
</repeatedTask>
<!-- Identical to the above, but using the range shorthands -->
<repeatedTask id="task_functional_range2" resetModel="false" range="range_counter2">
<listOfRanges>
<uniformRange id="range_counter2" start="0.0" end="10.0" numberOfPoints="10"/>
<functionalRange id="range_function2" range="range_counter2">
<m:math>
<m:apply><m:plus/>
<m:cn>10</m:cn>
<m:ci>range_counter2</m:ci>
</m:apply>
</m:math>
</functionalRange>
</listOfRanges>
<listOfChanges>
<setValue target="/cellml:model/cellml:component/cellml:variable[@name='V']"
range="range_function2">
<m:math>
<m:ci>range_function2</m:ci>
</m:math>
</setValue>
</listOfChanges>
<subTask task="task_once"/>
</repeatedTask>
</listOfTasks>
<!-- The tasks are: task_utc task_repeat task_utc_repeat task_utc_set_model
task_functional_range1 task_functional_range2 -->
<listOfDataGenerators>
<dataGenerator id="t_task_utc">
<listOfVariables>
<variable id="t_task_utc_t" taskReference="task_utc" target="/cellml:model/cellml:component/cellml:variable[@name='time']"/>
</listOfVariables>
<m:math>
<m:ci>t_task_utc_t</m:ci>
</m:math>
</dataGenerator>
<dataGenerator id="t_task_repeat">
<listOfVariables>
<variable id="t_task_repeat_t" taskReference="task_repeat" target="/cellml:model/cellml:component/cellml:variable[@name='time']"/>
</listOfVariables>
<m:math>
<m:ci>t_task_repeat_t</m:ci>
</m:math>
</dataGenerator>
<dataGenerator id="t_task_utc_repeat">
<listOfVariables>
<variable id="t_task_utc_repeat_t" taskReference="task_utc_repeat" target="/cellml:model/cellml:component/cellml:variable[@name='time']"/>
</listOfVariables>
<m:math>
<m:ci>t_task_utc_repeat_t</m:ci>
</m:math>
</dataGenerator>
<dataGenerator id="t_task_utc_set_model">
<listOfVariables>
<variable id="t_task_utc_set_model_t" taskReference="task_utc_set_model" target="/cellml:model/cellml:component/cellml:variable[@name='time']"/>
</listOfVariables>
<m:math>
<m:ci>t_task_utc_set_model_t</m:ci>
</m:math>
</dataGenerator>
<dataGenerator id="t_task_functional_range1">
<listOfVariables>
<variable id="t_task_functional_range1_t" taskReference="task_functional_range1" target="/cellml:model/cellml:component/cellml:variable[@name='time']"/>
</listOfVariables>
<m:math>
<m:ci>t_task_functional_range1_t</m:ci>
</m:math>
</dataGenerator>
<dataGenerator id="t_task_functional_range2">
<listOfVariables>
<variable id="t_task_functional_range2_t" taskReference="task_functional_range2" target="/cellml:model/cellml:component/cellml:variable[@name='time']"/>
</listOfVariables>
<m:math>
<m:ci>t_task_functional_range2_t</m:ci>
</m:math>
</dataGenerator>
<dataGenerator id="V_task_utc">
<listOfVariables>
<variable id="V_task_utc_V" taskReference="task_utc" target="/cellml:model/cellml:component/cellml:variable[@name='V']"/>
</listOfVariables>
<m:math>
<m:ci>V_task_utc_V</m:ci>
</m:math>
</dataGenerator>
<dataGenerator id="V_task_repeat">
<listOfVariables>
<variable id="V_task_repeat_V" taskReference="task_repeat" target="/cellml:model/cellml:component/cellml:variable[@name='V']"/>
</listOfVariables>
<m:math>
<m:ci>V_task_repeat_V</m:ci>
</m:math>
</dataGenerator>
<dataGenerator id="V_task_utc_repeat">
<listOfVariables>
<variable id="V_task_utc_repeat_V" taskReference="task_utc_repeat" target="/cellml:model/cellml:component/cellml:variable[@name='V']"/>
</listOfVariables>
<m:math>
<m:ci>V_task_utc_repeat_V</m:ci>
</m:math>
</dataGenerator>
<dataGenerator id="V_task_utc_set_model">
<listOfVariables>
<variable id="V_task_utc_set_model_V" taskReference="task_utc_set_model" target="/cellml:model/cellml:component/cellml:variable[@name='V']"/>
</listOfVariables>
<m:math>
<m:ci>V_task_utc_set_model_V</m:ci>
</m:math>
</dataGenerator>
<dataGenerator id="V_task_functional_range1">
<listOfVariables>
<variable id="V_task_functional_range1_V" taskReference="task_functional_range1" target="/cellml:model/cellml:component/cellml:variable[@name='V']"/>
</listOfVariables>
<m:math>
<m:ci>V_task_functional_range1_V</m:ci>
</m:math>
</dataGenerator>
<dataGenerator id="V_task_functional_range2">
<listOfVariables>
<variable id="V_task_functional_range2_V" taskReference="task_functional_range2" target="/cellml:model/cellml:component/cellml:variable[@name='V']"/>
</listOfVariables>
<m:math>
<m:ci>V_task_functional_range2_V</m:ci>
</m:math>
</dataGenerator>
</listOfDataGenerators>
<listOfOutputs>
<plot2D id="plot_utc" name="Simple uniform timecourse">
<listOfCurves>
<curve id="c1" logX="false" logY="false" xDataReference="t_task_utc" yDataReference="V_task_utc"/>
</listOfCurves>
</plot2D>
<plot2D id="plot_repeat" name="Simple repetition">
<listOfCurves>
<curve id="c2" logX="false" logY="false" xDataReference="t_task_repeat" yDataReference="V_task_repeat"/>
</listOfCurves>
</plot2D>
<plot2D id="plot_utc_repeat" name="Uniform timecourse by repeatedTask">
<listOfCurves>
<curve id="c3" logX="false" logY="false" xDataReference="t_task_utc_repeat" yDataReference="V_task_utc_repeat"/>
</listOfCurves>
</plot2D>
<plot2D id="plot_utc_set_model" name="Setting model variable">
<listOfCurves>
<curve id="c4" logX="false" logY="false" xDataReference="t_task_utc_set_model" yDataReference="V_task_utc_set_model"/>
</listOfCurves>
</plot2D>
<plot2D id="plot_functional_range1" name="Test functional range">
<listOfCurves>
<curve id="c5" logX="false" logY="false" xDataReference="t_task_functional_range1" yDataReference="V_task_functional_range1"/>
</listOfCurves>
</plot2D>
<plot2D id="plot_functional_range2" name="Test functional range with shorthands">
<listOfCurves>
<curve id="c6" logX="false" logY="false" xDataReference="t_task_functional_range2" yDataReference="V_task_functional_range2"/>
</listOfCurves>
</plot2D>
</listOfOutputs>
</sedML>