Changeset 9431 for branches/HeuristicLab.Analysis.AlgorithmBehavior/HeuristicLab.Analysis.AlgorithmBehavior.Analyzers/3.3/AfterMutationCombinedOperator.cs
- Timestamp:
- 05/03/13 10:08:38 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/HeuristicLab.Analysis.AlgorithmBehavior/HeuristicLab.Analysis.AlgorithmBehavior.Analyzers/3.3/AfterMutationCombinedOperator.cs
r9054 r9431 22 22 using HeuristicLab.Common; 23 23 using HeuristicLab.Core; 24 using HeuristicLab.Data; 24 25 using HeuristicLab.Optimization; 25 26 using HeuristicLab.Optimization.Operators; … … 36 37 public IValueParameter<SingleObjectiveSolutionSimilarityCalculator> SimilarityCalculatorParameter { 37 38 get { return (IValueParameter<SingleObjectiveSolutionSimilarityCalculator>)Parameters["SimilarityCalculator"]; } 39 } 40 public ValueParameter<IntValue> UpdateIntervalParameter { 41 get { return (ValueParameter<IntValue>)Parameters["UpdateInterval"]; } 42 } 43 public ILookupParameter<IntValue> GenerationsParameter { 44 get { return (ILookupParameter<IntValue>)Parameters["Generations"]; } 38 45 } 39 46 … … 60 67 Parameters.Add(new LookupParameter<IEvaluator>("Evaluator", "The operator which is used to evaluate new solutions.")); 61 68 Parameters.Add(new ValueParameter<SingleObjectiveSolutionSimilarityCalculator>("SimilarityCalculator")); 69 Parameters.Add(new ValueParameter<IntValue>("UpdateInterval", "The interval in which the operator should be applied.", new IntValue(2))); 70 Parameters.Add(new LookupParameter<IntValue>("Generations", "Nr of generations.")); 62 71 63 72 SimilarityCalculatorParameter.ValueChanged += new System.EventHandler(SimilarityCalculatorParameter_ValueChanged); … … 87 96 Operators.Add(solToPopAnalyzer); 88 97 } 98 99 public override IOperation Apply() { 100 if (GenerationsParameter.ActualValue.Value % UpdateIntervalParameter.Value.Value == 0) { 101 return base.Apply(); 102 } else { 103 return base.BaseApply(); 104 } 105 } 89 106 } 90 107 }
Note: See TracChangeset
for help on using the changeset viewer.