| 1 | package de.uka.ipd.sdq.workflow.pcm.runconfig; |
| 2 | |
| 3 | import java.util.ArrayList; |
| 4 | import java.util.List; |
| 5 | |
| 6 | /** |
| 7 | * Experiment run descriptor for sensitivity analyses. |
| 8 | * This descriptor contains the values chosen for each variable of the sensitivity analysis. |
| 9 | * It provides an experiment name based on this information. |
| 10 | * |
| 11 | */ |
| 12 | public class ExperimentRunDescriptor { |
| 13 | |
| 14 | private String name; |
| 15 | private ArrayList<ParameterDescriptor> parameterList; |
| 16 | |
| 17 | public ExperimentRunDescriptor(String name, List<SensitivityAnalysisConfiguration> sconfList) { |
| 18 | this.name = name; |
| 19 | this.parameterList = new ArrayList<ParameterDescriptor>(); |
| 20 | |
| 21 | for(SensitivityAnalysisConfiguration sac : sconfList){ |
| 22 | ParameterDescriptor pd = new ParameterDescriptor(sac.getShortName(), sac.getVariable(), sac.getCurrent(), sac.getRunNo()); |
| 23 | parameterList.add(pd); |
| 24 | } |
| 25 | |
| 26 | } |
| 27 | |
| 28 | public String getRunIdentifier() { |
| 29 | String result = null; |
| 30 | for (ParameterDescriptor pd : parameterList){ |
| 31 | result = result == null ? "" : result + "."; |
| 32 | result += pd.getRunNo(); |
| 33 | } |
| 34 | return result; |
| 35 | } |
| 36 | |
| 37 | public String getNameExperimentRun() { |
| 38 | return name + " No. " + getRunIdentifier(); |
| 39 | } |
| 40 | |
| 41 | public List<ParameterDescriptor> getParameters() { |
| 42 | return parameterList; |
| 43 | } |
| 44 | |
| 45 | } |