Expands all parameter permutations. It is used to create experiment lists
Expand All Parameter Permutations
Sometimes one may want the result as a function of one or more values. In order to get a grid of all permutations you my use this expandset.xsl template.
This template takes a source file of the form:
<?xml version="1.0" encoding="UTF-8"?> <setup> <param name="gmaxvr"> <val>7</val> <val>8</val> <val>9</val> </param> <param name="rgkmax"> <val>11</val> <val>12</val> </param> <param name="swidth"> <val>0.001</val> <val>0.002</val> </param> <param name="spinpol"> <val>true</val> <val>false</val> </param> <param name="lmaxvr"> <val>14</val> </param> </setup>
and expands all permutations into parametersets for further use in input templates.
Apply expandset.xsl
xsltproc expandset.xsl setup.xsl
in this case the output looks like
<?xml version="1.0" encoding="UTF-8" ?> <?xml version="1.0" encoding="UTF-8"?> <experiment> <set gmaxvr="7" rgkmax="11" swidth="0.001" spinpol="true" lmaxvr="14" path="gmaxvr_7/rgkmax_11/swidth_0.001/spinpol_true/lmaxvr_14/"/> <set gmaxvr="7" rgkmax="11" swidth="0.001" spinpol="false" lmaxvr="14" path="gmaxvr_7/rgkmax_11/swidth_0.001/spinpol_false/lmaxvr_14/"/> <set gmaxvr="7" rgkmax="11" swidth="0.002" spinpol="true" lmaxvr="14" path="gmaxvr_7/rgkmax_11/swidth_0.002/spinpol_true/lmaxvr_14/"/> <set gmaxvr="7" rgkmax="11" swidth="0.002" spinpol="false" lmaxvr="14" path="gmaxvr_7/rgkmax_11/swidth_0.002/spinpol_false/lmaxvr_14/"/> <set gmaxvr="7" rgkmax="12" swidth="0.001" spinpol="true" lmaxvr="14" path="gmaxvr_7/rgkmax_12/swidth_0.001/spinpol_true/lmaxvr_14/"/> <set gmaxvr="7" rgkmax="12" swidth="0.001" spinpol="false" lmaxvr="14" path="gmaxvr_7/rgkmax_12/swidth_0.001/spinpol_false/lmaxvr_14/"/> <set gmaxvr="7" rgkmax="12" swidth="0.002" spinpol="true" lmaxvr="14" path="gmaxvr_7/rgkmax_12/swidth_0.002/spinpol_true/lmaxvr_14/"/> <set gmaxvr="7" rgkmax="12" swidth="0.002" spinpol="false" lmaxvr="14" path="gmaxvr_7/rgkmax_12/swidth_0.002/spinpol_false/lmaxvr_14/"/> <set gmaxvr="8" rgkmax="11" swidth="0.001" spinpol="true" lmaxvr="14" path="gmaxvr_8/rgkmax_11/swidth_0.001/spinpol_true/lmaxvr_14/"/> <set gmaxvr="8" rgkmax="11" swidth="0.001" spinpol="false" lmaxvr="14" path="gmaxvr_8/rgkmax_11/swidth_0.001/spinpol_false/lmaxvr_14/"/> <set gmaxvr="8" rgkmax="11" swidth="0.002" spinpol="true" lmaxvr="14" path="gmaxvr_8/rgkmax_11/swidth_0.002/spinpol_true/lmaxvr_14/"/> <set gmaxvr="8" rgkmax="11" swidth="0.002" spinpol="false" lmaxvr="14" path="gmaxvr_8/rgkmax_11/swidth_0.002/spinpol_false/lmaxvr_14/"/> <set gmaxvr="8" rgkmax="12" swidth="0.001" spinpol="true" lmaxvr="14" path="gmaxvr_8/rgkmax_12/swidth_0.001/spinpol_true/lmaxvr_14/"/> <set gmaxvr="8" rgkmax="12" swidth="0.001" spinpol="false" lmaxvr="14" path="gmaxvr_8/rgkmax_12/swidth_0.001/spinpol_false/lmaxvr_14/"/> <set gmaxvr="8" rgkmax="12" swidth="0.002" spinpol="true" lmaxvr="14" path="gmaxvr_8/rgkmax_12/swidth_0.002/spinpol_true/lmaxvr_14/"/> <set gmaxvr="8" rgkmax="12" swidth="0.002" spinpol="false" lmaxvr="14" path="gmaxvr_8/rgkmax_12/swidth_0.002/spinpol_false/lmaxvr_14/"/> <set gmaxvr="9" rgkmax="11" swidth="0.001" spinpol="true" lmaxvr="14" path="gmaxvr_9/rgkmax_11/swidth_0.001/spinpol_true/lmaxvr_14/"/> <set gmaxvr="9" rgkmax="11" swidth="0.001" spinpol="false" lmaxvr="14" path="gmaxvr_9/rgkmax_11/swidth_0.001/spinpol_false/lmaxvr_14/"/> <set gmaxvr="9" rgkmax="11" swidth="0.002" spinpol="true" lmaxvr="14" path="gmaxvr_9/rgkmax_11/swidth_0.002/spinpol_true/lmaxvr_14/"/> <set gmaxvr="9" rgkmax="11" swidth="0.002" spinpol="false" lmaxvr="14" path="gmaxvr_9/rgkmax_11/swidth_0.002/spinpol_false/lmaxvr_14/"/> <set gmaxvr="9" rgkmax="12" swidth="0.001" spinpol="true" lmaxvr="14" path="gmaxvr_9/rgkmax_12/swidth_0.001/spinpol_true/lmaxvr_14/"/> <set gmaxvr="9" rgkmax="12" swidth="0.001" spinpol="false" lmaxvr="14" path="gmaxvr_9/rgkmax_12/swidth_0.001/spinpol_false/lmaxvr_14/"/> <set gmaxvr="9" rgkmax="12" swidth="0.002" spinpol="true" lmaxvr="14" path="gmaxvr_9/rgkmax_12/swidth_0.002/spinpol_true/lmaxvr_14/"/> <set gmaxvr="9" rgkmax="12" swidth="0.002" spinpol="false" lmaxvr="14" path="gmaxvr_9/rgkmax_12/swidth_0.002/spinpol_false/lmaxvr_14/"/> </experiment>
Dependent Parameters
If You have dependent parameters, meaning parameters that should change together with another this template supports following syntax:
<?xml version="1.0" encoding="UTF-8"?> <setup> <param name="gmaxvr"> <val>7 </val> <val>8 <dep name="rgkmax" val="10"/></val> <val>9 <dep name="rgkmax" val="11"/></val> </param> <param name="swidth"> <val>0.001</val> <val>0.002</val> </param> <param name="spinpol"> <val>true</val> <val>false</val> </param> <param name="lmaxvr"> <val>14</val> </param> </setup>
You can add any number of <dep> values inside the val element. This values are simply written into the <set> element together with the attribute for the <val> element.
For large series of values one can use something like the series expansion template to generate the setup.xml.