Changeset 3336 for trunk/sources/HeuristicLab.Problems.TestFunctions
- Timestamp:
- 04/13/10 18:32:07 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Problems.TestFunctions/3.3/SingleObjectiveTestFunctionProblem.cs
r3318 r3336 39 39 [Creatable("Problems")] 40 40 public sealed class SingleObjectiveTestFunctionProblem : ParameterizedNamedItem, ISingleObjectiveProblem { 41 [Storable] 42 private StrategyVectorCreator strategyVectorCreator; 43 [Storable] 44 private StrategyVectorCrossover strategyVectorCrossover; 45 [Storable] 46 private StrategyVectorManipulator strategyVectorManipulator; 47 41 48 public override Image ItemImage { 42 49 get { return HeuristicLab.Common.Resources.VS2008ImageLibrary.Type; } … … 144 151 Parameters.Add(new OptionalValueParameter<DoubleValue>("BestKnownQuality", "The quality of the best known solution of this TSP instance.", new DoubleValue(evaluator.BestKnownQuality))); 145 152 153 strategyVectorCreator = new StrategyVectorCreator(); 154 strategyVectorCreator.LengthParameter.ActualName = ProblemSizeParameter.Name; 155 strategyVectorCrossover = new StrategyVectorCrossover(); 156 strategyVectorManipulator = new StrategyVectorManipulator(); 157 146 158 creator.RealVectorParameter.ActualName = "Point"; 147 159 ParameterizeSolutionCreator(); … … 184 196 } 185 197 private void ProblemSize_ValueChanged(object sender, EventArgs e) { 198 if (ProblemSize.Value < 1) ProblemSize.Value = 1; 186 199 ParameterizeSolutionCreator(); 200 strategyVectorManipulator.GeneralLearningRateParameter.Value = new DoubleValue(1.0 / Math.Sqrt(2 * ProblemSize.Value)); 201 strategyVectorManipulator.LearningRateParameter.Value = new DoubleValue(1.0 / Math.Sqrt(2 * Math.Sqrt(ProblemSize.Value))); 187 202 } 188 203 private void SolutionCreatorParameter_ValueChanged(object sender, EventArgs e) { … … 249 264 } 250 265 } 266 } 267 private void strategyVectorCreator_BoundsParameter_ValueChanged(object sender, EventArgs e) { 268 strategyVectorManipulator.BoundsParameter.Value = strategyVectorCreator.BoundsParameter.Value; 269 } 270 private void strategyVectorCreator_StrategyParameterParameter_ActualNameChanged(object sender, EventArgs e) { 271 string name = strategyVectorCreator.StrategyParameterParameter.ActualName; 272 strategyVectorCrossover.ParentsParameter.ActualName = name; 273 strategyVectorCrossover.StrategyParameterParameter.ActualName = name; 274 strategyVectorManipulator.StrategyParameterParameter.ActualName = name; 251 275 } 252 276 #endregion … … 266 290 Evaluator.QualityParameter.ActualNameChanged += new EventHandler(Evaluator_QualityParameter_ActualNameChanged); 267 291 VisualizerParameter.ValueChanged += new EventHandler(VisualizerParameter_ValueChanged); 292 strategyVectorCreator.BoundsParameter.ValueChanged += new EventHandler(strategyVectorCreator_BoundsParameter_ValueChanged); 293 strategyVectorCreator.StrategyParameterParameter.ActualNameChanged += new EventHandler(strategyVectorCreator_StrategyParameterParameter_ActualNameChanged); 268 294 } 269 295 private void InitializeOperators() { 270 296 operators = new List<IOperator>(); 271 297 operators.AddRange(ApplicationManager.Manager.GetInstances<IRealVectorOperator>().Cast<IOperator>()); 298 operators.Add(strategyVectorCreator); 299 operators.Add(strategyVectorCrossover); 300 operators.Add(strategyVectorManipulator); 272 301 UpdateMoveEvaluators(); 273 302 ParameterizeOperators();
Note: See TracChangeset
for help on using the changeset viewer.