Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
05/03/13 10:08:38 (11 years ago)
Author:
ascheibe
Message:

#1886 added configuration of frequency with which the ab measures are calculated

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/HeuristicLab.Analysis.AlgorithmBehavior/HeuristicLab.Analysis.AlgorithmBehavior.Analyzers/3.3/AfterMutationCombinedOperator.cs

    r9054 r9431  
    2222using HeuristicLab.Common;
    2323using HeuristicLab.Core;
     24using HeuristicLab.Data;
    2425using HeuristicLab.Optimization;
    2526using HeuristicLab.Optimization.Operators;
     
    3637    public IValueParameter<SingleObjectiveSolutionSimilarityCalculator> SimilarityCalculatorParameter {
    3738      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"]; }
    3845    }
    3946
     
    6067      Parameters.Add(new LookupParameter<IEvaluator>("Evaluator", "The operator which is used to evaluate new solutions."));
    6168      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."));
    6271
    6372      SimilarityCalculatorParameter.ValueChanged += new System.EventHandler(SimilarityCalculatorParameter_ValueChanged);
     
    8796      Operators.Add(solToPopAnalyzer);
    8897    }
     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    }
    89106  }
    90107}
Note: See TracChangeset for help on using the changeset viewer.