Changeset 12321 for branches/HeuristicLab.VariableInteractionNetworks/HeuristicLab.VariableInteractionNetworks/3.3/CreateTargetVariationExperimentDialog.cs
- Timestamp:
- 04/16/15 13:57:16 (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HeuristicLab.VariableInteractionNetworks/HeuristicLab.VariableInteractionNetworks/3.3/CreateTargetVariationExperimentDialog.cs
r12320 r12321 25 25 public Experiment Experiment { get; private set; } 26 26 private int repetitions; 27 28 27 29 28 public CreateTargetVariationExperimentDialog() : this(null) { } 30 29 public CreateTargetVariationExperimentDialog(IAlgorithm alg) … … 51 50 throw new InvalidOperationException("Null algorithm!"); 52 51 53 var problem = algorithm.Problem; 54 var regressionProblem = problem as IRegressionProblem; 52 var regressionProblem = algorithm.Problem as IRegressionProblem; 55 53 if (regressionProblem == null) 56 throw new Exception();54 throw new InvalidOperationException("Null regression problem!!"); 57 55 58 56 var problemData = regressionProblem.ProblemData; 59 57 var variables = problemData.InputVariables.ToList(); 58 int checksNo = 0; 60 59 61 60 for (int i = 0; i < variables.Count; i++) 62 61 { 62 if (!problemData.InputVariables.ItemChecked(problemData.InputVariables[i])) 63 continue; 64 63 65 var alg = (IAlgorithm)algorithm.Clone(); 64 66 var pd = ((IRegressionProblem)alg.Problem).ProblemData; 67 checksNo++; 65 68 66 69 // set target to false 67 70 pd.InputVariables.SetItemCheckedState(pd.InputVariables[i], false); 68 71 69 72 pd.TargetVariable = pd.InputVariables[i].Value; 73 70 74 alg.Name += "{Target variable=" + pd.TargetVariable + "}"; 71 75 72 var batchrun = new BatchRun("Batchrun" + i)76 var batchrun = new BatchRun("Batchrun" + checksNo) 73 77 { 74 78 Repetitions = repetitions,
Note: See TracChangeset
for help on using the changeset viewer.