- Timestamp:
- 01/07/14 11:14:18 (11 years ago)
- Location:
- trunk/sources
- Files:
-
- 1 added
- 67 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/sources/HeuristicLab.Clients.OKB/3.3/RunCreation/EmptySolutionCreator.cs
r9456 r10291 32 32 [StorableClass] 33 33 [NonDiscoverableType] 34 public sealed class EmptySolutionCreator : Operator, ISolutionCreator {34 public sealed class EmptySolutionCreator : SingleSuccessorOperator, ISolutionCreator { 35 35 private string exceptionMessage; 36 36 -
trunk/sources/HeuristicLab.Core/3.3/HeuristicLab.Core-3.3.csproj
r9178 r10291 150 150 <Compile Include="Interfaces\ICheckedMultiOperator.cs" /> 151 151 <Compile Include="Interfaces\IConstrainedValueParameter.cs" /> 152 <Compile Include="Interfaces\IInstrumentedOperator.cs" /> 152 153 <Compile Include="Interfaces\IMultiOperator.cs" /> 153 154 <Compile Include="Interfaces\IFixedValueParameter.cs" /> -
trunk/sources/HeuristicLab.Encodings.BinaryVectorEncoding/3.3/BinaryVectorCreator.cs
r9456 r10291 34 34 [Item("BinaryVectorCreator", "A base class for operators creating bool-valued vectors.")] 35 35 [StorableClass] 36 public abstract class BinaryVectorCreator : SingleSuccessorOperator, IBinaryVectorCreator, IStochasticOperator {36 public abstract class BinaryVectorCreator : InstrumentedOperator, IBinaryVectorCreator, IStochasticOperator { 37 37 public override bool CanChangeName { 38 38 get { return false; } … … 58 58 } 59 59 60 public sealed override IOperation Apply() {60 public sealed override IOperation InstrumentedApply() { 61 61 BinaryVectorParameter.ActualValue = Create(RandomParameter.ActualValue, LengthParameter.ActualValue); 62 return base. Apply();62 return base.InstrumentedApply(); 63 63 } 64 64 -
trunk/sources/HeuristicLab.Encodings.BinaryVectorEncoding/3.3/BinaryVectorCrossover.cs
r9456 r10291 33 33 [Item("BinaryVectorCrossover", "A base class for operators that perform a crossover of bool-valued vectors.")] 34 34 [StorableClass] 35 public abstract class BinaryVectorCrossover : SingleSuccessorOperator, IBinaryVectorCrossover, IStochasticOperator {35 public abstract class BinaryVectorCrossover : InstrumentedOperator, IBinaryVectorCrossover, IStochasticOperator { 36 36 public override bool CanChangeName { 37 37 get { return false; } … … 59 59 } 60 60 61 public sealed override IOperation Apply() {61 public sealed override IOperation InstrumentedApply() { 62 62 ChildParameter.ActualValue = Cross(RandomParameter.ActualValue, ParentsParameter.ActualValue); 63 return base. Apply();63 return base.InstrumentedApply(); 64 64 } 65 65 -
trunk/sources/HeuristicLab.Encodings.BinaryVectorEncoding/3.3/BinaryVectorManipulator.cs
r9456 r10291 33 33 [Item("BinaryVectorManipulator", "A base class for operators that manipulate bool-valued vectors.")] 34 34 [StorableClass] 35 public abstract class BinaryVectorManipulator : SingleSuccessorOperator, IBinaryVectorManipulator, IStochasticOperator {35 public abstract class BinaryVectorManipulator : InstrumentedOperator, IBinaryVectorManipulator, IStochasticOperator { 36 36 public override bool CanChangeName { 37 37 get { return false; } … … 53 53 } 54 54 55 public sealed override IOperation Apply() {55 public sealed override IOperation InstrumentedApply() { 56 56 Manipulate(RandomParameter.ActualValue, BinaryVectorParameter.ActualValue); 57 return base. Apply();57 return base.InstrumentedApply(); 58 58 } 59 59 -
trunk/sources/HeuristicLab.Encodings.IntegerVectorEncoding/3.3/IntegerVectorCreator.cs
r9456 r10291 34 34 [Item("IntegerVectorCreator", "A base class for operators creating int-valued vectors.")] 35 35 [StorableClass] 36 public abstract class IntegerVectorCreator : SingleSuccessorOperator, IIntegerVectorCreator, IStochasticOperator {36 public abstract class IntegerVectorCreator : InstrumentedOperator, IIntegerVectorCreator, IStochasticOperator { 37 37 public override bool CanChangeName { 38 38 get { return false; } … … 79 79 #endregion 80 80 81 public sealed override IOperation Apply() {81 public sealed override IOperation InstrumentedApply() { 82 82 IntegerVectorParameter.ActualValue = Create(RandomParameter.ActualValue, LengthParameter.ActualValue, BoundsParameter.ActualValue); 83 return base. Apply();83 return base.InstrumentedApply(); 84 84 } 85 85 -
trunk/sources/HeuristicLab.Encodings.IntegerVectorEncoding/3.3/IntegerVectorCrossover.cs
r9456 r10291 58 58 } 59 59 60 public sealed override IOperation Apply() {60 public sealed override IOperation InstrumentedApply() { 61 61 ChildParameter.ActualValue = Cross(RandomParameter.ActualValue, ParentsParameter.ActualValue); 62 return base. Apply();62 return base.InstrumentedApply(); 63 63 } 64 64 -
trunk/sources/HeuristicLab.Encodings.IntegerVectorEncoding/3.3/IntegerVectorManipulator.cs
r9456 r10291 52 52 } 53 53 54 public sealed override IOperation Apply() {54 public sealed override IOperation InstrumentedApply() { 55 55 Manipulate(RandomParameter.ActualValue, IntegerVectorParameter.ActualValue); 56 return base. Apply();56 return base.InstrumentedApply(); 57 57 } 58 58 -
trunk/sources/HeuristicLab.Encodings.IntegerVectorEncoding/3.3/IntegerVectorOperator.cs
r9456 r10291 29 29 [Item("IntegerVectorOperator", "Base class for integer vectoro operators.")] 30 30 [StorableClass] 31 public abstract class IntegerVectorOperator : SingleSuccessorOperator, IIntegerVectorOperator {31 public abstract class IntegerVectorOperator : InstrumentedOperator, IIntegerVectorOperator { 32 32 33 33 [StorableConstructor] -
trunk/sources/HeuristicLab.Encodings.PermutationEncoding/3.3/Creators/RandomPermutationCreator.cs
r9456 r10291 34 34 [Item("RandomPermutationCreator", "An operator which creates a new random permutation of integer values.")] 35 35 [StorableClass] 36 public sealed class RandomPermutationCreator : SingleSuccessorOperator, IPermutationCreator, IStochasticOperator {36 public sealed class RandomPermutationCreator : InstrumentedOperator, IPermutationCreator, IStochasticOperator { 37 37 public override bool CanChangeName { 38 38 get { return false; } … … 72 72 } 73 73 74 public override IOperation Apply() {74 public override IOperation InstrumentedApply() { 75 75 PermutationParameter.ActualValue = new Permutation(PermutationType, LengthParameter.ActualValue.Value, RandomParameter.ActualValue); 76 return base. Apply();76 return base.InstrumentedApply(); 77 77 } 78 78 } -
trunk/sources/HeuristicLab.Encodings.PermutationEncoding/3.3/PermutationCrossover.cs
r9456 r10291 33 33 [Item("PermutationCrossover", "A base class for permutation crossover operators.")] 34 34 [StorableClass] 35 public abstract class PermutationCrossover : SingleSuccessorOperator, IPermutationCrossover, IStochasticOperator {35 public abstract class PermutationCrossover : InstrumentedOperator, IPermutationCrossover, IStochasticOperator { 36 36 public override bool CanChangeName { 37 37 get { return false; } … … 60 60 } 61 61 62 public sealed override IOperation Apply() {62 public sealed override IOperation InstrumentedApply() { 63 63 ChildParameter.ActualValue = Cross(RandomParameter.ActualValue, ParentsParameter.ActualValue); 64 return base. Apply();64 return base.InstrumentedApply(); 65 65 } 66 66 -
trunk/sources/HeuristicLab.Encodings.PermutationEncoding/3.3/PermutationManipulator.cs
r9456 r10291 33 33 [Item("PermutationManipulator", "A base class for permutation manipulation operators.")] 34 34 [StorableClass] 35 public abstract class PermutationManipulator : SingleSuccessorOperator, IPermutationManipulator, IStochasticOperator {35 public abstract class PermutationManipulator : InstrumentedOperator, IPermutationManipulator, IStochasticOperator { 36 36 public override bool CanChangeName { 37 37 get { return false; } … … 54 54 } 55 55 56 public sealed override IOperation Apply() {56 public sealed override IOperation InstrumentedApply() { 57 57 Manipulate(RandomParameter.ActualValue, PermutationParameter.ActualValue); 58 return base. Apply();58 return base.InstrumentedApply(); 59 59 } 60 60 -
trunk/sources/HeuristicLab.Encodings.RealVectorEncoding/3.3/RealVectorCreator.cs
r9456 r10291 34 34 [Item("RealVectorCreator", "A base class for operators creating real-valued vectors.")] 35 35 [StorableClass] 36 public abstract class RealVectorCreator : SingleSuccessorOperator, IRealVectorCreator, IStochasticOperator {36 public abstract class RealVectorCreator : InstrumentedOperator, IRealVectorCreator, IStochasticOperator { 37 37 public override bool CanChangeName { 38 38 get { return false; } … … 63 63 } 64 64 65 public sealed override IOperation Apply() {65 public sealed override IOperation InstrumentedApply() { 66 66 RealVectorParameter.ActualValue = Create(RandomParameter.ActualValue, LengthParameter.ActualValue, BoundsParameter.ActualValue); 67 return base. Apply();67 return base.InstrumentedApply(); 68 68 } 69 69 -
trunk/sources/HeuristicLab.Encodings.RealVectorEncoding/3.3/RealVectorCrossover.cs
r9456 r10291 35 35 [Item("RealVectorCrossover", "A base class for operators that perform a crossover of real-valued vectors.")] 36 36 [StorableClass] 37 public abstract class RealVectorCrossover : SingleSuccessorOperator, IRealVectorCrossover, IStochasticOperator {37 public abstract class RealVectorCrossover : InstrumentedOperator, IRealVectorCrossover, IStochasticOperator { 38 38 public override bool CanChangeName { 39 39 get { return false; } … … 96 96 } 97 97 98 public sealed override IOperation Apply() {98 public sealed override IOperation InstrumentedApply() { 99 99 RealVector result = Cross(RandomParameter.ActualValue, ParentsParameter.ActualValue); 100 100 ChildParameter.ActualValue = result; 101 101 102 IOperation successor = base. Apply();102 IOperation successor = base.InstrumentedApply(); 103 103 if (BoundsChecker != null) { 104 104 IOperation checkerOperation = ExecutionContext.CreateChildOperation(BoundsChecker); -
trunk/sources/HeuristicLab.Encodings.RealVectorEncoding/3.3/RealVectorManipulator.cs
r9456 r10291 35 35 [Item("RealVectorManipulator", "A base class for operators that manipulate real-valued vectors.")] 36 36 [StorableClass] 37 public abstract class RealVectorManipulator : SingleSuccessorOperator, IRealVectorManipulator, IStochasticOperator {37 public abstract class RealVectorManipulator : InstrumentedOperator, IRealVectorManipulator, IStochasticOperator { 38 38 public override bool CanChangeName { 39 39 get { return false; } … … 90 90 } 91 91 92 public sealed override IOperation Apply() {92 public sealed override IOperation InstrumentedApply() { 93 93 RealVector vector = RealVectorParameter.ActualValue; 94 94 Manipulate(RandomParameter.ActualValue, vector); 95 95 96 IOperation successor = base. Apply();96 IOperation successor = base.InstrumentedApply(); 97 97 if (BoundsChecker != null) { 98 98 IOperation checkerOperation = ExecutionContext.CreateChildOperation(BoundsChecker); -
trunk/sources/HeuristicLab.Encodings.ScheduleEncoding/3.3/JobSequenceMatrix/Crossovers/JSMCrossover.cs
r9456 r10291 40 40 public abstract JSMEncoding Cross(IRandom random, JSMEncoding parent1, JSMEncoding parent2); 41 41 42 public override IOperation Apply() {42 public override IOperation InstrumentedApply() { 43 43 var parents = ParentsParameter.ActualValue; 44 44 … … 46 46 Cross(RandomParameter.ActualValue, parents[0] as JSMEncoding, parents[1] as JSMEncoding); 47 47 48 return base. Apply();48 return base.InstrumentedApply(); 49 49 } 50 50 } -
trunk/sources/HeuristicLab.Encodings.ScheduleEncoding/3.3/JobSequenceMatrix/Manipulators/JSMManipulator.cs
r9456 r10291 39 39 protected abstract void Manipulate(IRandom random, IScheduleEncoding individual); 40 40 41 public override IOperation Apply() {41 public override IOperation InstrumentedApply() { 42 42 var solution = ScheduleEncodingParameter.ActualValue as JSMEncoding; 43 43 if (solution == null) throw new InvalidOperationException("ScheduleEncoding was not found or is not of type JSMEncoding."); 44 44 Manipulate(RandomParameter.ActualValue, solution); 45 return base. Apply();45 return base.InstrumentedApply(); 46 46 } 47 47 -
trunk/sources/HeuristicLab.Encodings.ScheduleEncoding/3.3/PermutationWithRepetition/Crossovers/PWRCrossover.cs
r9456 r10291 40 40 public abstract PWREncoding Cross(IRandom random, PWREncoding parent1, PWREncoding parent2); 41 41 42 public override IOperation Apply() {42 public override IOperation InstrumentedApply() { 43 43 var parents = ParentsParameter.ActualValue; 44 44 … … 46 46 Cross(RandomParameter.ActualValue, parents[0] as PWREncoding, parents[1] as PWREncoding); 47 47 48 return base. Apply();48 return base.InstrumentedApply(); 49 49 } 50 50 } -
trunk/sources/HeuristicLab.Encodings.ScheduleEncoding/3.3/PermutationWithRepetition/Manipulators/PWRManipulator.cs
r9456 r10291 40 40 protected abstract void Manipulate(IRandom random, PWREncoding individual); 41 41 42 public override IOperation Apply() {42 public override IOperation InstrumentedApply() { 43 43 var solution = ScheduleEncodingParameter.ActualValue as PWREncoding; 44 44 if (solution == null) throw new InvalidOperationException("ScheduleEncoding was not found or is not of type PWREncoding."); 45 45 Manipulate(RandomParameter.ActualValue, solution); 46 return base. Apply();46 return base.InstrumentedApply(); 47 47 } 48 48 -
trunk/sources/HeuristicLab.Encodings.ScheduleEncoding/3.3/PriorityRulesVector/Crossovers/PRVCrossover.cs
r9456 r10291 40 40 public abstract PRVEncoding Cross(IRandom random, PRVEncoding parent1, PRVEncoding parent2); 41 41 42 public override IOperation Apply() {42 public override IOperation InstrumentedApply() { 43 43 var parents = ParentsParameter.ActualValue; 44 44 ChildParameter.ActualValue = 45 45 Cross(RandomParameter.ActualValue, parents[0] as PRVEncoding, parents[1] as PRVEncoding); 46 return base. Apply();46 return base.InstrumentedApply(); 47 47 } 48 48 } -
trunk/sources/HeuristicLab.Encodings.ScheduleEncoding/3.3/PriorityRulesVector/Manipulators/PRVManipulator.cs
r9456 r10291 39 39 protected abstract void Manipulate(IRandom random, PRVEncoding individual); 40 40 41 public override IOperation Apply() {41 public override IOperation InstrumentedApply() { 42 42 var solution = ScheduleEncodingParameter.ActualValue as PRVEncoding; 43 43 if (solution == null) throw new InvalidOperationException("ScheduleEncoding was not found or is not of type PRVEncoding."); 44 44 Manipulate(RandomParameter.ActualValue, solution); 45 return base. Apply();45 return base.InstrumentedApply(); 46 46 } 47 47 -
trunk/sources/HeuristicLab.Encodings.ScheduleEncoding/3.3/ScheduleCreator.cs
r9456 r10291 29 29 [Item("ScheduleCreator", "Represents the generalized form of creators for Scheduling Problems.")] 30 30 [StorableClass] 31 public abstract class ScheduleCreator : SingleSuccessorOperator, IScheduleCreator {31 public abstract class ScheduleCreator : InstrumentedOperator, IScheduleCreator { 32 32 33 33 public ILookupParameter<IScheduleEncoding> ScheduleEncodingParameter { … … 43 43 } 44 44 45 public override IOperation Apply() {45 public override IOperation InstrumentedApply() { 46 46 ScheduleEncodingParameter.ActualValue = CreateSolution(); 47 return base. Apply();47 return base.InstrumentedApply(); 48 48 } 49 49 -
trunk/sources/HeuristicLab.Encodings.ScheduleEncoding/3.3/ScheduleCrossover.cs
r9456 r10291 30 30 [Item("ScheduleCrossover", "A scheduling crossover operation.")] 31 31 [StorableClass] 32 public abstract class ScheduleCrossover : SingleSuccessorOperator, IScheduleCrossover, IStochasticOperator {32 public abstract class ScheduleCrossover : InstrumentedOperator, IScheduleCrossover, IStochasticOperator { 33 33 34 34 public ILookupParameter<IScheduleEncoding> ChildParameter { -
trunk/sources/HeuristicLab.Encodings.ScheduleEncoding/3.3/ScheduleEncoding/Crossovers/DirectScheduleCrossover.cs
r9456 r10291 45 45 public abstract Schedule Cross(IRandom random, Schedule parent1, Schedule parent2); 46 46 47 public override IOperation Apply() {47 public override IOperation InstrumentedApply() { 48 48 var parents = ParentsParameter.ActualValue; 49 49 ChildParameter.ActualValue = 50 50 Cross(RandomParameter.ActualValue, parents[0] as Schedule, parents[1] as Schedule); 51 return base. Apply();51 return base.InstrumentedApply(); 52 52 } 53 53 } -
trunk/sources/HeuristicLab.Encodings.ScheduleEncoding/3.3/ScheduleEncoding/Manipulators/DirectScheduleManipulator.cs
r9456 r10291 40 40 protected abstract void Manipulate(IRandom random, Schedule individual); 41 41 42 public override IOperation Apply() {42 public override IOperation InstrumentedApply() { 43 43 var schedule = ScheduleEncodingParameter.ActualValue as Schedule; 44 44 if (schedule == null) throw new InvalidOperationException("ScheduleEncoding was not found or is not of type Schedule."); 45 45 Manipulate(RandomParameter.ActualValue, schedule); 46 return base. Apply();46 return base.InstrumentedApply(); 47 47 } 48 48 -
trunk/sources/HeuristicLab.Encodings.ScheduleEncoding/3.3/ScheduleManipulator.cs
r9456 r10291 30 30 [Item("ScheduleManipulator", "A scheduling manipulation operation.")] 31 31 [StorableClass] 32 public abstract class ScheduleManipulator : SingleSuccessorOperator, IScheduleManipulator, IStochasticOperator {32 public abstract class ScheduleManipulator : InstrumentedOperator, IScheduleManipulator, IStochasticOperator { 33 33 34 34 public ILookupParameter<IScheduleEncoding> ScheduleEncodingParameter { -
trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Creators/FullTreeCreator.cs
r9456 r10291 94 94 } 95 95 96 public override IOperation Apply() {96 public override IOperation InstrumentedApply() { 97 97 if (ClonedSymbolicExpressionTreeGrammarParameter.ActualValue == null) { 98 98 SymbolicExpressionTreeGrammarParameter.ActualValue.ReadOnly = true; … … 104 104 (ISymbolicExpressionGrammar)SymbolicExpressionTreeGrammarParameter.ActualValue.Clone())); 105 105 } 106 return base. Apply();106 return base.InstrumentedApply(); 107 107 } 108 108 -
trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Creators/GrowTreeCreator.cs
r9456 r10291 94 94 } 95 95 96 public override IOperation Apply() {96 public override IOperation InstrumentedApply() { 97 97 if (ClonedSymbolicExpressionTreeGrammarParameter.ActualValue == null) { 98 98 SymbolicExpressionTreeGrammarParameter.ActualValue.ReadOnly = true; … … 104 104 (ISymbolicExpressionGrammar)SymbolicExpressionTreeGrammarParameter.ActualValue.Clone())); 105 105 } 106 return base. Apply();106 return base.InstrumentedApply(); 107 107 } 108 108 -
trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Creators/ProbabilisticTreeCreator.cs
r9456 r10291 87 87 } 88 88 89 public override IOperation Apply() {89 public override IOperation InstrumentedApply() { 90 90 if (ClonedSymbolicExpressionTreeGrammarParameter.ActualValue == null) { 91 91 SymbolicExpressionTreeGrammarParameter.ActualValue.ReadOnly = true; … … 96 96 globalScope.Variables.Add(new Variable(ClonedSymbolicExpressionTreeGrammarParameterName, (ISymbolicExpressionGrammar)SymbolicExpressionTreeGrammarParameter.ActualValue.Clone())); 97 97 } 98 return base. Apply();98 return base.InstrumentedApply(); 99 99 } 100 100 -
trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Creators/RampedHalfAndHalfTreeCreator.cs
r9456 r10291 95 95 } 96 96 97 public override IOperation Apply() {97 public override IOperation InstrumentedApply() { 98 98 if (ClonedSymbolicExpressionTreeGrammarParameter.ActualValue == null) { 99 99 SymbolicExpressionTreeGrammarParameter.ActualValue.ReadOnly = true; … … 105 105 (ISymbolicExpressionGrammar)SymbolicExpressionTreeGrammarParameter.ActualValue.Clone())); 106 106 } 107 return base. Apply();107 return base.InstrumentedApply(); 108 108 } 109 109 -
trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Creators/SymbolicExpressionTreeCreator.cs
r9456 r10291 54 54 } 55 55 56 public override IOperation Apply() {56 public override IOperation InstrumentedApply() { 57 57 SymbolicExpressionTree = Create(Random); 58 return base. Apply();58 return base.InstrumentedApply(); 59 59 } 60 60 -
trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Crossovers/SymbolicExpressionTreeCrossover.cs
r9456 r10291 63 63 } 64 64 65 public sealed override IOperation Apply() {65 public sealed override IOperation InstrumentedApply() { 66 66 if (Parents.Length != 2) 67 67 throw new ArgumentException("Number of parents must be exactly two for symbolic expression tree crossover operators."); … … 70 70 71 71 Child = result; 72 return base. Apply();72 return base.InstrumentedApply(); 73 73 } 74 74 -
trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/Manipulators/SymbolicExpressionTreeManipulator.cs
r9456 r10291 22 22 using HeuristicLab.Common; 23 23 using HeuristicLab.Core; 24 using HeuristicLab.Data;25 24 using HeuristicLab.Parameters; 26 25 using HeuristicLab.Persistence.Default.CompositeSerializers.Storable; … … 55 54 } 56 55 57 public sealed override IOperation Apply() {56 public sealed override IOperation InstrumentedApply() { 58 57 ISymbolicExpressionTree tree = SymbolicExpressionTreeParameter.ActualValue; 59 58 Manipulate(RandomParameter.ActualValue, tree); 60 59 61 return base. Apply();60 return base.InstrumentedApply(); 62 61 } 63 62 -
trunk/sources/HeuristicLab.Encodings.SymbolicExpressionTreeEncoding/3.4/SymbolicExpressionTreeOperator.cs
r9456 r10291 34 34 [Item("SymbolicExpressionTreeOperator", "A base class for operators for symbolic expression trees.")] 35 35 [StorableClass] 36 public abstract class SymbolicExpressionTreeOperator : SingleSuccessorOperator, IStochasticOperator, ISymbolicExpressionTreeOperator {36 public abstract class SymbolicExpressionTreeOperator : InstrumentedOperator, IStochasticOperator, ISymbolicExpressionTreeOperator { 37 37 private const string RandomParameterName = "Random"; 38 38 -
trunk/sources/HeuristicLab.Operators/3.3/InstrumentedOperator.cs
r10261 r10291 20 20 #endregion 21 21 22 using System.Collections.Generic; 22 23 using System.Linq; 23 24 using HeuristicLab.Common; … … 29 30 [Item("InstrumentedOperator", "A operator that can execute pre- and post actions.")] 30 31 [StorableClass] 31 public abstract class InstrumentedOperator : SingleSuccessorOperator {32 public abstract class InstrumentedOperator : SingleSuccessorOperator, IInstrumentedOperator { 32 33 private const string BeforeExecutionOperatorsParameterName = "BeforeExecutionOperators"; 33 34 private const string AfterExecutionOperatorsParameterName = "AfterExecutionOperators"; … … 40 41 } 41 42 43 44 IEnumerable<IOperator> IInstrumentedOperator.BeforeExecutionOperators { get { return BeforeExecutionOperators; } } 42 45 public OperatorList BeforeExecutionOperators { 43 46 get { return BeforeExecutionOperatorsParameter.Value; } 44 47 } 48 IEnumerable<IOperator> IInstrumentedOperator.AfterExecutionOperators { get { return AfterExecutionOperators; } } 45 49 public OperatorList AfterExecutionOperators { 46 50 get { return AfterExecutionOperatorsParameter.Value; } -
trunk/sources/HeuristicLab.Optimization.Operators/3.3/ParentCopyCrossover.cs
r9456 r10291 29 29 [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.")] 30 30 [StorableClass] 31 public class ParentCopyCrossover : SingleSuccessorOperator, ICrossover, IStochasticOperator {31 public class ParentCopyCrossover : InstrumentedOperator, ICrossover, IStochasticOperator { 32 32 public ILookupParameter<IRandom> RandomParameter { 33 33 get { return (ILookupParameter<IRandom>)Parameters["Random"]; } … … 43 43 } 44 44 45 public override IOperation Apply() {45 public override IOperation InstrumentedApply() { 46 46 IScope scope = ExecutionContext.Scope; 47 47 int index = RandomParameter.ActualValue.Next(scope.SubScopes.Count); … … 51 51 scope.Variables.Add((IVariable)var.Clone()); 52 52 53 return base. Apply();53 return base.InstrumentedApply(); 54 54 } 55 55 -
trunk/sources/HeuristicLab.Optimization/3.3/Problems/UserDefinedProblem.cs
r9456 r10291 235 235 private sealed class EmptyUserDefinedProblemEvaluator : ParameterizedNamedItem, ISingleObjectiveEvaluator { 236 236 237 public IEnumerable<IOperator> BeforeExecutionOperators { get { throw new NotSupportedException(); } } 238 public IEnumerable<IOperator> AfterExecutionOperators { get { throw new NotSupportedException(); } } 239 237 240 [StorableConstructor] 238 241 private EmptyUserDefinedProblemEvaluator(bool deserializing) : base(deserializing) { } -
trunk/sources/HeuristicLab.Problems.ArtificialAnt/3.4/Evaluator.cs
r9456 r10291 32 32 [Item("ArtificialAntEvaluator", "Evaluates an artificial ant solution.")] 33 33 [StorableClass] 34 public class Evaluator : SingleSuccessorOperator, ISingleObjectiveEvaluator {34 public class Evaluator : InstrumentedOperator, ISingleObjectiveEvaluator { 35 35 36 36 public ILookupParameter<DoubleValue> QualityParameter { … … 60 60 } 61 61 62 public sealed override IOperation Apply() {62 public sealed override IOperation InstrumentedApply() { 63 63 SymbolicExpressionTree expression = SymbolicExpressionTreeParameter.ActualValue; 64 64 BoolMatrix world = WorldParameter.ActualValue; … … 72 72 73 73 QualityParameter.ActualValue = new DoubleValue(interpreter.FoodEaten); 74 return null;74 return base.InstrumentedApply(); 75 75 } 76 76 } -
trunk/sources/HeuristicLab.Problems.DataAnalysis.Symbolic.Classification/3.4/MultiObjective/SymbolicClassificationMultiObjectiveMeanSquaredErrorTreeSizeEvaluator.cs
r9456 r10291 44 44 public override IEnumerable<bool> Maximization { get { return new bool[2] { false, false }; } } 45 45 46 public override IOperation Apply() {46 public override IOperation InstrumentedApply() { 47 47 IEnumerable<int> rows = GenerateRowsToEvaluate(); 48 48 var solution = SymbolicExpressionTreeParameter.ActualValue; 49 49 double[] qualities = Calculate(SymbolicDataAnalysisTreeInterpreterParameter.ActualValue, solution, EstimationLimitsParameter.ActualValue.Lower, EstimationLimitsParameter.ActualValue.Upper, ProblemDataParameter.ActualValue, rows); 50 50 QualitiesParameter.ActualValue = new DoubleArray(qualities); 51 return base. Apply();51 return base.InstrumentedApply(); 52 52 } 53 53 -
trunk/sources/HeuristicLab.Problems.DataAnalysis.Symbolic.Classification/3.4/MultiObjective/SymbolicClassificationMultiObjectivePearsonRSquaredTreeSizeEvaluator.cs
r9456 r10291 44 44 public override IEnumerable<bool> Maximization { get { return new bool[2] { true, false }; } } 45 45 46 public override IOperation Apply() {46 public override IOperation InstrumentedApply() { 47 47 IEnumerable<int> rows = GenerateRowsToEvaluate(); 48 48 var solution = SymbolicExpressionTreeParameter.ActualValue; 49 49 double[] qualities = Calculate(SymbolicDataAnalysisTreeInterpreterParameter.ActualValue, solution, EstimationLimitsParameter.ActualValue.Lower, EstimationLimitsParameter.ActualValue.Upper, ProblemDataParameter.ActualValue, rows, ApplyLinearScalingParameter.ActualValue.Value); 50 50 QualitiesParameter.ActualValue = new DoubleArray(qualities); 51 return base. Apply();51 return base.InstrumentedApply(); 52 52 } 53 53 -
trunk/sources/HeuristicLab.Problems.DataAnalysis.Symbolic.Classification/3.4/SingleObjective/SymbolicClassificationSingleObjectiveBoundedMeanSquaredErrorEvaluator.cs
r9456 r10291 44 44 public override bool Maximization { get { return false; } } 45 45 46 public override IOperation Apply() {46 public override IOperation InstrumentedApply() { 47 47 IEnumerable<int> rows = GenerateRowsToEvaluate(); 48 48 var solution = SymbolicExpressionTreeParameter.ActualValue; 49 49 double quality = Calculate(SymbolicDataAnalysisTreeInterpreterParameter.ActualValue, solution, EstimationLimitsParameter.ActualValue.Lower, EstimationLimitsParameter.ActualValue.Upper, ProblemDataParameter.ActualValue, rows, ApplyLinearScalingParameter.ActualValue.Value); 50 50 QualityParameter.ActualValue = new DoubleValue(quality); 51 return base. Apply();51 return base.InstrumentedApply(); 52 52 } 53 53 -
trunk/sources/HeuristicLab.Problems.DataAnalysis.Symbolic.Classification/3.4/SingleObjective/SymbolicClassificationSingleObjectiveMeanSquaredErrorEvaluator.cs
r9456 r10291 45 45 public override bool Maximization { get { return false; } } 46 46 47 public override IOperation Apply() {47 public override IOperation InstrumentedApply() { 48 48 IEnumerable<int> rows = GenerateRowsToEvaluate(); 49 49 var solution = SymbolicExpressionTreeParameter.ActualValue; 50 50 double quality = Calculate(SymbolicDataAnalysisTreeInterpreterParameter.ActualValue, solution, EstimationLimitsParameter.ActualValue.Lower, EstimationLimitsParameter.ActualValue.Upper, ProblemDataParameter.ActualValue, rows, ApplyLinearScalingParameter.ActualValue.Value); 51 51 QualityParameter.ActualValue = new DoubleValue(quality); 52 return base. Apply();52 return base.InstrumentedApply(); 53 53 } 54 54 -
trunk/sources/HeuristicLab.Problems.DataAnalysis.Symbolic.Classification/3.4/SingleObjective/SymbolicClassificationSingleObjectivePearsonRSquaredEvaluator.cs
r9456 r10291 44 44 public override bool Maximization { get { return true; } } 45 45 46 public override IOperation Apply() {46 public override IOperation InstrumentedApply() { 47 47 IEnumerable<int> rows = GenerateRowsToEvaluate(); 48 48 var solution = SymbolicExpressionTreeParameter.ActualValue; 49 49 double quality = Calculate(SymbolicDataAnalysisTreeInterpreterParameter.ActualValue, solution, EstimationLimitsParameter.ActualValue.Lower, EstimationLimitsParameter.ActualValue.Upper, ProblemDataParameter.ActualValue, rows, ApplyLinearScalingParameter.ActualValue.Value); 50 50 QualityParameter.ActualValue = new DoubleValue(quality); 51 return base. Apply();51 return base.InstrumentedApply(); 52 52 } 53 53 -
trunk/sources/HeuristicLab.Problems.DataAnalysis.Symbolic.Classification/3.4/SingleObjective/SymbolicClassificationSingleObjectivePenaltyScoreEvaluator.cs
r9456 r10291 64 64 65 65 66 public override IOperation Apply() {66 public override IOperation InstrumentedApply() { 67 67 double quality = Evaluate(ExecutionContext, SymbolicExpressionTreeParameter.ActualValue, ProblemDataParameter.ActualValue, GenerateRowsToEvaluate()); 68 68 QualityParameter.ActualValue = new DoubleValue(quality); 69 return base. Apply();69 return base.InstrumentedApply(); 70 70 } 71 71 -
trunk/sources/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression/3.4/MultiObjective/SymbolicRegressionMultiObjectiveMeanSquaredErrorTreeSizeEvaluator.cs
r9456 r10291 44 44 public override IEnumerable<bool> Maximization { get { return new bool[2] { false, false }; } } 45 45 46 public override Core.IOperationApply() {46 public override IOperation InstrumentedApply() { 47 47 IEnumerable<int> rows = GenerateRowsToEvaluate(); 48 48 var solution = SymbolicExpressionTreeParameter.ActualValue; 49 49 double[] qualities = Calculate(SymbolicDataAnalysisTreeInterpreterParameter.ActualValue, solution, EstimationLimitsParameter.ActualValue.Lower, EstimationLimitsParameter.ActualValue.Upper, ProblemDataParameter.ActualValue, rows, ApplyLinearScalingParameter.ActualValue.Value); 50 50 QualitiesParameter.ActualValue = new DoubleArray(qualities); 51 return base. Apply();51 return base.InstrumentedApply(); 52 52 } 53 53 -
trunk/sources/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression/3.4/MultiObjective/SymbolicRegressionMultiObjectivePearsonRSquaredTreeSizeEvaluator.cs
r9456 r10291 44 44 public override IEnumerable<bool> Maximization { get { return new bool[2] { true, false }; } } 45 45 46 public override IOperation Apply() {46 public override IOperation InstrumentedApply() { 47 47 IEnumerable<int> rows = GenerateRowsToEvaluate(); 48 48 var solution = SymbolicExpressionTreeParameter.ActualValue; 49 49 double[] qualities = Calculate(SymbolicDataAnalysisTreeInterpreterParameter.ActualValue, solution, EstimationLimitsParameter.ActualValue.Lower, EstimationLimitsParameter.ActualValue.Upper, ProblemDataParameter.ActualValue, rows, ApplyLinearScalingParameter.ActualValue.Value); 50 50 QualitiesParameter.ActualValue = new DoubleArray(qualities); 51 return base. Apply();51 return base.InstrumentedApply(); 52 52 } 53 53 -
trunk/sources/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression/3.4/SingleObjective/Evaluators/SymbolicRegressionConstantOptimizationEvaluator.cs
r9456 r10291 102 102 } 103 103 104 public override IOperation Apply() {104 public override IOperation InstrumentedApply() { 105 105 var solution = SymbolicExpressionTreeParameter.ActualValue; 106 106 double quality; … … 121 121 QualityParameter.ActualValue = new DoubleValue(quality); 122 122 123 if (Successor != null) 124 return ExecutionContext.CreateOperation(Successor); 125 else 126 return null; 123 return base.InstrumentedApply(); 127 124 } 128 125 -
trunk/sources/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression/3.4/SingleObjective/Evaluators/SymbolicRegressionSingleObjectiveMaxAbsoluteErrorEvaluator.cs
r9456 r10291 42 42 public SymbolicRegressionSingleObjectiveMaxAbsoluteErrorEvaluator() : base() { } 43 43 44 public override IOperation Apply() {44 public override IOperation InstrumentedApply() { 45 45 var solution = SymbolicExpressionTreeParameter.ActualValue; 46 46 IEnumerable<int> rows = GenerateRowsToEvaluate(); … … 49 49 QualityParameter.ActualValue = new DoubleValue(quality); 50 50 51 return base. Apply();51 return base.InstrumentedApply(); 52 52 } 53 53 -
trunk/sources/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression/3.4/SingleObjective/Evaluators/SymbolicRegressionSingleObjectiveMeanAbsoluteErrorEvaluator.cs
r9456 r10291 42 42 public SymbolicRegressionSingleObjectiveMeanAbsoluteErrorEvaluator() : base() { } 43 43 44 public override IOperation Apply() {44 public override IOperation InstrumentedApply() { 45 45 var solution = SymbolicExpressionTreeParameter.ActualValue; 46 46 IEnumerable<int> rows = GenerateRowsToEvaluate(); … … 49 49 QualityParameter.ActualValue = new DoubleValue(quality); 50 50 51 return base. Apply();51 return base.InstrumentedApply(); 52 52 } 53 53 -
trunk/sources/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression/3.4/SingleObjective/Evaluators/SymbolicRegressionSingleObjectiveMeanSquaredErrorEvaluator.cs
r9456 r10291 42 42 public SymbolicRegressionSingleObjectiveMeanSquaredErrorEvaluator() : base() { } 43 43 44 public override IOperation Apply() {44 public override IOperation InstrumentedApply() { 45 45 var solution = SymbolicExpressionTreeParameter.ActualValue; 46 46 IEnumerable<int> rows = GenerateRowsToEvaluate(); … … 49 49 QualityParameter.ActualValue = new DoubleValue(quality); 50 50 51 return base. Apply();51 return base.InstrumentedApply(); 52 52 } 53 53 -
trunk/sources/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression/3.4/SingleObjective/Evaluators/SymbolicRegressionSingleObjectivePearsonRSquaredEvaluator.cs
r9456 r10291 44 44 public override bool Maximization { get { return true; } } 45 45 46 public override IOperation Apply() {46 public override IOperation InstrumentedApply() { 47 47 var solution = SymbolicExpressionTreeParameter.ActualValue; 48 48 IEnumerable<int> rows = GenerateRowsToEvaluate(); … … 51 51 QualityParameter.ActualValue = new DoubleValue(quality); 52 52 53 return base. Apply();53 return base.InstrumentedApply(); 54 54 } 55 55 -
trunk/sources/HeuristicLab.Problems.DataAnalysis.Symbolic.TimeSeriesPrognosis/3.4/SingleObjective/SymbolicTimeSeriesPrognosisSingleObjectiveMeanSquaredErrorEvaluator.cs
r9462 r10291 44 44 public override bool Maximization { get { return false; } } 45 45 46 public override IOperation Apply() {46 public override IOperation InstrumentedApply() { 47 47 var solution = SymbolicExpressionTreeParameter.ActualValue; 48 48 IEnumerable<int> rows = GenerateRowsToEvaluate(); … … 56 56 QualityParameter.ActualValue = new DoubleValue(quality); 57 57 58 return base. Apply();58 return base.InstrumentedApply(); 59 59 } 60 60 -
trunk/sources/HeuristicLab.Problems.DataAnalysis.Symbolic/3.4/Evaluators/SymbolicDataAnalysisEvaluator.cs
r9456 r10291 35 35 namespace HeuristicLab.Problems.DataAnalysis.Symbolic { 36 36 [StorableClass] 37 public abstract class SymbolicDataAnalysisEvaluator<T> : SingleSuccessorOperator,37 public abstract class SymbolicDataAnalysisEvaluator<T> : InstrumentedOperator, 38 38 ISymbolicDataAnalysisEvaluator<T>, ISymbolicDataAnalysisInterpreterOperator, ISymbolicDataAnalysisBoundedOperator, IStochasticOperator 39 39 where T : class, IDataAnalysisProblemData { -
trunk/sources/HeuristicLab.Problems.DataAnalysis.Trading/3.4/Symbolic/SingleObjective/ProfitEvaluator.cs
r9989 r10291 47 47 public override bool Maximization { get { return true; } } 48 48 49 public override IOperation Apply() {49 public override IOperation InstrumentedApply() { 50 50 var solution = SymbolicExpressionTreeParameter.ActualValue; 51 51 IEnumerable<int> rows = GenerateRowsToEvaluate(); … … 54 54 QualityParameter.ActualValue = new DoubleValue(quality); 55 55 56 return base. Apply();56 return base.InstrumentedApply(); 57 57 } 58 58 -
trunk/sources/HeuristicLab.Problems.DataAnalysis.Trading/3.4/Symbolic/SingleObjective/SharpeRatioEvaluator.cs
r9989 r10291 47 47 public override bool Maximization { get { return true; } } 48 48 49 public override IOperation Apply() {49 public override IOperation InstrumentedApply() { 50 50 var solution = SymbolicExpressionTreeParameter.ActualValue; 51 51 IEnumerable<int> rows = GenerateRowsToEvaluate(); … … 54 54 QualityParameter.ActualValue = new DoubleValue(quality); 55 55 56 return base. Apply();56 return base.InstrumentedApply(); 57 57 } 58 58 -
trunk/sources/HeuristicLab.Problems.Knapsack/3.3/Evaluators/KnapsackEvaluator.cs
r9456 r10291 35 35 [Item("KnapsackEvaluator", "Evaluates solutions for the Knapsack problem.")] 36 36 [StorableClass] 37 public class KnapsackEvaluator : SingleSuccessorOperator, IKnapsackEvaluator {37 public class KnapsackEvaluator : InstrumentedOperator, IKnapsackEvaluator { 38 38 public ILookupParameter<DoubleValue> QualityParameter { 39 39 get { return (ILookupParameter<DoubleValue>)Parameters["Quality"]; } … … 129 129 } 130 130 131 public sealed override IOperation Apply() {131 public sealed override IOperation InstrumentedApply() { 132 132 BinaryVector v = BinaryVectorParameter.ActualValue; 133 133 … … 143 143 AppliedPenaltyParameter.ActualValue = evaluation.AppliedPenalty; 144 144 145 return base. Apply();145 return base.InstrumentedApply(); 146 146 } 147 147 } -
trunk/sources/HeuristicLab.Problems.LawnMower/3.3/Evaluator.cs
r9456 r10291 32 32 [StorableClass] 33 33 [Item("Lawn Mower Evaluator", "Evaluator for the lawn mower demo GP problem.")] 34 public class Evaluator : SingleSuccessorOperator, ISingleObjectiveEvaluator {34 public class Evaluator : InstrumentedOperator, ISingleObjectiveEvaluator { 35 35 36 36 private const string QualityParameterName = "Quality"; … … 72 72 return new Evaluator(this, cloner); 73 73 } 74 public override IOperation Apply() {74 public override IOperation InstrumentedApply() { 75 75 int length = LawnLengthParameter.ActualValue.Value; 76 76 int width = LawnWidthParameter.ActualValue.Value; … … 88 88 89 89 QualityParameter.ActualValue = new DoubleValue(numberOfMowedCells); 90 return base. Apply();90 return base.InstrumentedApply(); 91 91 } 92 92 } -
trunk/sources/HeuristicLab.Problems.LinearAssignment/3.3/LAPEvaluator.cs
r9456 r10291 32 32 [Item("LAPEvaluator", "Evaluates a solution to the linear assignment problem.")] 33 33 [StorableClass] 34 public class LAPEvaluator : SingleSuccessorOperator, ILAPEvaluator {34 public class LAPEvaluator : InstrumentedOperator, ILAPEvaluator { 35 35 36 36 public ILookupParameter<DoubleMatrix> CostsParameter { … … 47 47 protected LAPEvaluator(bool deserializing) : base(deserializing) { } 48 48 protected LAPEvaluator(LAPEvaluator original, Cloner cloner) : base(original, cloner) { } 49 public LAPEvaluator() : base() { 49 public LAPEvaluator() 50 : base() { 50 51 Parameters.Add(new LookupParameter<DoubleMatrix>("Costs", LinearAssignmentProblem.CostsDescription)); 51 52 Parameters.Add(new LookupParameter<Permutation>("Assignment", "The assignment solution to evaluate.")); … … 57 58 } 58 59 59 public override IOperation Apply() {60 public override IOperation InstrumentedApply() { 60 61 var costs = CostsParameter.ActualValue; 61 62 var assignment = AssignmentParameter.ActualValue; … … 69 70 70 71 QualityParameter.ActualValue = new DoubleValue(quality); 71 return base. Apply();72 return base.InstrumentedApply(); 72 73 } 73 74 } -
trunk/sources/HeuristicLab.Problems.OneMax/3.3/Evaluators/OneMaxEvaluator.cs
r9456 r10291 34 34 [Item("OneMaxEvaluator", "Evaluates solutions for the OneMax problem.")] 35 35 [StorableClass] 36 public class OneMaxEvaluator : SingleSuccessorOperator, IOneMaxEvaluator {36 public class OneMaxEvaluator : InstrumentedOperator, IOneMaxEvaluator { 37 37 public ILookupParameter<DoubleValue> QualityParameter { 38 38 get { return (ILookupParameter<DoubleValue>)Parameters["Quality"]; } … … 56 56 } 57 57 58 public sealed override IOperation Apply() {58 public sealed override IOperation InstrumentedApply() { 59 59 BinaryVector v = BinaryVectorParameter.ActualValue; 60 60 … … 67 67 QualityParameter.ActualValue = new DoubleValue(quality); 68 68 69 return base. Apply();69 return base.InstrumentedApply(); 70 70 } 71 71 } -
trunk/sources/HeuristicLab.Problems.QuadraticAssignment/3.3/Evaluators/QAPEvaluator.cs
r9456 r10291 30 30 namespace HeuristicLab.Problems.QuadraticAssignment { 31 31 [StorableClass] 32 public class QAPEvaluator : SingleSuccessorOperator, IQAPEvaluator {32 public class QAPEvaluator : InstrumentedOperator, IQAPEvaluator { 33 33 34 34 public ILookupParameter<Permutation> PermutationParameter { … … 78 78 } 79 79 80 public override IOperation Apply() {80 public override IOperation InstrumentedApply() { 81 81 Permutation assignment = PermutationParameter.ActualValue; 82 82 DoubleMatrix weights = WeightsParameter.ActualValue; … … 86 86 QualityParameter.ActualValue = new DoubleValue(quality); 87 87 88 return base. Apply();88 return base.InstrumentedApply(); 89 89 } 90 90 } -
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 -
trunk/sources/HeuristicLab.Problems.TestFunctions/3.3/Evaluators/SingleObjectiveTestFunctionProblemEvaluator.cs
r9980 r10291 34 34 [Item("Evaluator", "Base calls for single objective test function evaluators.")] 35 35 [StorableClass] 36 public abstract class SingleObjectiveTestFunctionProblemEvaluator : SingleSuccessorOperator, ISingleObjectiveTestFunctionProblemEvaluator {36 public abstract class SingleObjectiveTestFunctionProblemEvaluator : InstrumentedOperator, ISingleObjectiveTestFunctionProblemEvaluator { 37 37 /// <summary> 38 38 /// The name of the function … … 86 86 } 87 87 88 public override IOperation Apply() {88 public override IOperation InstrumentedApply() { 89 89 RealVector point = PointParameter.ActualValue; 90 90 double quality = Evaluate(point); 91 91 QualityParameter.ActualValue = new DoubleValue(quality); 92 return base. Apply();92 return base.InstrumentedApply(); 93 93 } 94 94 -
trunk/sources/HeuristicLab.Problems.TravelingSalesman/3.3/Evaluators/TSPCoordinatesPathEvaluator.cs
r9456 r10291 84 84 } 85 85 86 public sealed override IOperation Apply() {86 public sealed override IOperation InstrumentedApply() { 87 87 if (UseDistanceMatrixParameter.ActualValue.Value) { 88 88 Permutation p = PermutationParameter.ActualValue; … … 120 120 QualityParameter.ActualValue = new DoubleValue(length); 121 121 } 122 return base. Apply();122 return base.InstrumentedApply(); 123 123 } 124 124 -
trunk/sources/HeuristicLab.Problems.TravelingSalesman/3.3/Evaluators/TSPDistanceMatrixEvaluator.cs
r9456 r10291 69 69 } 70 70 71 public override IOperation Apply() {71 public override IOperation InstrumentedApply() { 72 72 Permutation p = PermutationParameter.ActualValue; 73 73 DistanceMatrix dm = DistanceMatrixParameter.ActualValue; 74 74 75 75 QualityParameter.ActualValue = new DoubleValue(Apply(dm, p)); 76 return base. Apply();76 return base.InstrumentedApply(); 77 77 } 78 78 } -
trunk/sources/HeuristicLab.Problems.TravelingSalesman/3.3/Evaluators/TSPEvaluator.cs
r9456 r10291 33 33 [Item("TSPEvaluator", "A base class for operators which evaluate TSP solutions.")] 34 34 [StorableClass] 35 public abstract class TSPEvaluator : SingleSuccessorOperator, ITSPEvaluator {35 public abstract class TSPEvaluator : InstrumentedOperator, ITSPEvaluator { 36 36 public override bool CanChangeName { 37 37 get { return false; } -
trunk/sources/HeuristicLab.Selection/3.3/Selector.cs
r9456 r10291 33 33 [Item("Selector", "A base class for selection operators.")] 34 34 [StorableClass] 35 public abstract class Selector : SingleSuccessorOperator {35 public abstract class Selector : InstrumentedOperator { 36 36 public override bool CanChangeName { 37 37 get { return false; } … … 54 54 } 55 55 56 public sealed override IOperation Apply() {56 public sealed override IOperation InstrumentedApply() { 57 57 List<IScope> scopes = new List<IScope>(CurrentScope.SubScopes); 58 58 IScope[] selected = Select(scopes); … … 66 66 CurrentScope.SubScopes.Add(selectedScope); 67 67 68 return base. Apply();68 return base.InstrumentedApply(); 69 69 } 70 70
Note: See TracChangeset
for help on using the changeset viewer.