Free cookie consent management tool by TermsFeed Policy Generator

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

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

Location:
trunk/sources/HeuristicLab.Problems.Scheduling/3.3/Evaluators
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Problems.Scheduling/3.3/Evaluators/ScheduleEvaluator.cs

    r9456 r10291  
    3131  [Item("Schedule Evaluator", "Represents a base class for schedule evaluators.")]
    3232  [StorableClass]
    33   public abstract class ScheduleEvaluator : SingleSuccessorOperator, IScheduleEvaluator {
     33  public abstract class ScheduleEvaluator : InstrumentedOperator, IScheduleEvaluator {
    3434
    3535    public ILookupParameter<DoubleValue> QualityParameter {
     
    5151    protected abstract double Evaluate(Schedule schedule);
    5252
    53     public override IOperation Apply() {
     53    public override IOperation InstrumentedApply() {
    5454      QualityParameter.ActualValue = new DoubleValue(Evaluate(ScheduleParameter.ActualValue));
    55       return base.Apply();
     55      return base.InstrumentedApply();
    5656    }
    5757  }
  • trunk/sources/HeuristicLab.Problems.Scheduling/3.3/Evaluators/SchedulingEvaluator.cs

    r9456 r10291  
    3232  [Item("SchedulingEvaluator", "First applies the decoder operator to obtain a schedule from an encoding and then applies the evaluator to obtain a quality.")]
    3333  [StorableClass]
    34   public class SchedulingEvaluator : SingleSuccessorOperator, ISchedulingEvaluator {
     34  public class SchedulingEvaluator : InstrumentedOperator, ISchedulingEvaluator {
    3535
    3636    public IValueLookupParameter<IScheduleDecoder> ScheduleDecoderParameter {
    37       get { return (IValueLookupParameter<IScheduleDecoder>) Parameters["ScheduleDecoder"]; }
     37      get { return (IValueLookupParameter<IScheduleDecoder>)Parameters["ScheduleDecoder"]; }
    3838    }
    3939    ILookupParameter<IScheduleDecoder> ISchedulingEvaluator.ScheduleDecoderParameter {
     
    4141    }
    4242    public IValueLookupParameter<IScheduleEvaluator> ScheduleEvaluatorParameter {
    43       get { return (IValueLookupParameter<IScheduleEvaluator>) Parameters["ScheduleEvaluator"]; }
     43      get { return (IValueLookupParameter<IScheduleEvaluator>)Parameters["ScheduleEvaluator"]; }
    4444    }
    4545    ILookupParameter<IScheduleEvaluator> ISchedulingEvaluator.ScheduleEvaluatorParameter {
     
    6565    }
    6666
    67     public override IOperation Apply() {
     67    public override IOperation InstrumentedApply() {
    6868      var decoder = ScheduleDecoderParameter.ActualValue;
    6969      var evaluator = ScheduleEvaluatorParameter.ActualValue;
    7070      if (evaluator == null) throw new InvalidOperationException("A ScheduleEvaluator could not be found.");
    7171
    72       var operations = new OperationCollection(base.Apply());
     72      var operations = new OperationCollection(base.InstrumentedApply());
    7373      operations.Insert(0, ExecutionContext.CreateChildOperation(evaluator));
    7474      if (decoder != null) // decode before evaluating
Note: See TracChangeset for help on using the changeset viewer.