Changeset 5303 for branches/HeuristicLab.MetaOptimization/HeuristicLab.Problems.MetaOptimization/3.3/MetaOptimizationProblem.cs
- Timestamp:
- 01/17/11 01:04:30 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HeuristicLab.MetaOptimization/HeuristicLab.Problems.MetaOptimization/3.3/MetaOptimizationProblem.cs
r5293 r5303 101 101 get { return Operators.OfType<ReferenceQualityAnalyzer>().FirstOrDefault(); } 102 102 } 103 #endregion 104 105 public MetaOptimizationProblem() : base() { 103 private RunsAnalyzer RunsAnalyzer { 104 get { return Operators.OfType<RunsAnalyzer>().FirstOrDefault(); } 105 } 106 #endregion 107 108 public MetaOptimizationProblem() 109 : base() { 106 110 Parameters.Add(new ValueParameter<EngineAlgorithm>(AlgorithmTypeParameterName, "The algorithm which's parameters should be optimized.", new GeneticAlgorithm())); 107 111 Parameters.Add(new ValueParameter<ISingleObjectiveProblem>(ProblemTypeParameterName, "The problem type.", new SingleObjectiveTestFunctionProblem())); … … 110 114 Parameters.Add(new ValueParameter<IntValue>(RepetitionsParameterName, "The number of evaluations for each problem.", new IntValue(3))); 111 115 112 var validIntManipulators = new ItemSet<IIntValueManipulator>( 116 var validIntManipulators = new ItemSet<IIntValueManipulator>(ApplicationManager.Manager.GetInstances<IIntValueManipulator>()); 113 117 var validDoubleManipulators = new ItemSet<IDoubleValueManipulator>(ApplicationManager.Manager.GetInstances<IDoubleValueManipulator>()); 114 118 var validIntCrossovers = new ItemSet<IIntValueCrossover>(ApplicationManager.Manager.GetInstances<IIntValueCrossover>()); … … 137 141 [StorableConstructor] 138 142 private MetaOptimizationProblem(bool deserializing) : base(deserializing) { } 139 private MetaOptimizationProblem(MetaOptimizationProblem original, Cloner cloner) : base(original, cloner) { 143 private MetaOptimizationProblem(MetaOptimizationProblem original, Cloner cloner) 144 : base(original, cloner) { 140 145 // todo 141 146 this.RegisterParameterEvents(); … … 157 162 ProblemTypeParameter.ValueChanged += new EventHandler(ProblemTypeParameter_ValueChanged); 158 163 } 159 164 160 165 private void InitializeOperators() { 161 166 Operators.AddRange(ApplicationManager.Manager.GetInstances<IParameterConfigurationOperator>().Cast<IOperator>()); 162 167 Operators.Add(new BestParameterConfigurationAnalyzer()); 163 168 Operators.Add(new ReferenceQualityAnalyzer()); 169 Operators.Add(new RunsAnalyzer()); 164 170 } 165 171 private void ParameterizeSolutionCreator() { … … 174 180 if (ReferenceQualityAnalyzer != null) { 175 181 ReferenceQualityAnalyzer.ParameterConfigurationParameter.ActualName = ((RandomParameterConfigurationCreator)SolutionCreator).ParameterConfigurationParameter.ActualName; 182 } 183 if (RunsAnalyzer != null) { 184 RunsAnalyzer.ParameterConfigurationParameter.ActualName = ((RandomParameterConfigurationCreator)SolutionCreator).ParameterConfigurationParameter.ActualName; 176 185 } 177 186 }
Note: See TracChangeset
for help on using the changeset viewer.