- Timestamp:
- 01/07/14 11:14:18 (11 years ago)
- 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 31 31 [Item("Schedule Evaluator", "Represents a base class for schedule evaluators.")] 32 32 [StorableClass] 33 public abstract class ScheduleEvaluator : SingleSuccessorOperator, IScheduleEvaluator {33 public abstract class ScheduleEvaluator : InstrumentedOperator, IScheduleEvaluator { 34 34 35 35 public ILookupParameter<DoubleValue> QualityParameter { … … 51 51 protected abstract double Evaluate(Schedule schedule); 52 52 53 public override IOperation Apply() {53 public override IOperation InstrumentedApply() { 54 54 QualityParameter.ActualValue = new DoubleValue(Evaluate(ScheduleParameter.ActualValue)); 55 return base. Apply();55 return base.InstrumentedApply(); 56 56 } 57 57 } -
trunk/sources/HeuristicLab.Problems.Scheduling/3.3/Evaluators/SchedulingEvaluator.cs
r9456 r10291 32 32 [Item("SchedulingEvaluator", "First applies the decoder operator to obtain a schedule from an encoding and then applies the evaluator to obtain a quality.")] 33 33 [StorableClass] 34 public class SchedulingEvaluator : SingleSuccessorOperator, ISchedulingEvaluator {34 public class SchedulingEvaluator : InstrumentedOperator, ISchedulingEvaluator { 35 35 36 36 public IValueLookupParameter<IScheduleDecoder> ScheduleDecoderParameter { 37 get { return (IValueLookupParameter<IScheduleDecoder>) 37 get { return (IValueLookupParameter<IScheduleDecoder>)Parameters["ScheduleDecoder"]; } 38 38 } 39 39 ILookupParameter<IScheduleDecoder> ISchedulingEvaluator.ScheduleDecoderParameter { … … 41 41 } 42 42 public IValueLookupParameter<IScheduleEvaluator> ScheduleEvaluatorParameter { 43 get { return (IValueLookupParameter<IScheduleEvaluator>) 43 get { return (IValueLookupParameter<IScheduleEvaluator>)Parameters["ScheduleEvaluator"]; } 44 44 } 45 45 ILookupParameter<IScheduleEvaluator> ISchedulingEvaluator.ScheduleEvaluatorParameter { … … 65 65 } 66 66 67 public override IOperation Apply() {67 public override IOperation InstrumentedApply() { 68 68 var decoder = ScheduleDecoderParameter.ActualValue; 69 69 var evaluator = ScheduleEvaluatorParameter.ActualValue; 70 70 if (evaluator == null) throw new InvalidOperationException("A ScheduleEvaluator could not be found."); 71 71 72 var operations = new OperationCollection(base. Apply());72 var operations = new OperationCollection(base.InstrumentedApply()); 73 73 operations.Insert(0, ExecutionContext.CreateChildOperation(evaluator)); 74 74 if (decoder != null) // decode before evaluating
Note: See TracChangeset
for help on using the changeset viewer.