Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
01/07/14 11:14:18 (10 years ago)
Author:
mkommend
Message:

#2119: Added interface for instrumented operators and adapted problem and encoding specific operators to provide instrumentation capabilities.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Optimization.Operators/3.3/ParentCopyCrossover.cs

    r9456 r10291  
    2929  [Item("ParentCopyCrossover", "This operator creates an offspring by creating a clone of a randomly chosen parent. It can be used in situations where no crossover should occur after selection.")]
    3030  [StorableClass]
    31   public class ParentCopyCrossover : SingleSuccessorOperator, ICrossover, IStochasticOperator {
     31  public class ParentCopyCrossover : InstrumentedOperator, ICrossover, IStochasticOperator {
    3232    public ILookupParameter<IRandom> RandomParameter {
    3333      get { return (ILookupParameter<IRandom>)Parameters["Random"]; }
     
    4343    }
    4444
    45     public override IOperation Apply() {
     45    public override IOperation InstrumentedApply() {
    4646      IScope scope = ExecutionContext.Scope;
    4747      int index = RandomParameter.ActualValue.Next(scope.SubScopes.Count);
     
    5151        scope.Variables.Add((IVariable)var.Clone());
    5252
    53       return base.Apply();
     53      return base.InstrumentedApply();
    5454    }
    5555
Note: See TracChangeset for help on using the changeset viewer.