#2119 closed enhancement (done)
Implement an operator base class for instrumentation
Reported by: | ascheibe | Owned by: | mkommend |
---|---|---|---|
Priority: | medium | Milestone: | HeuristicLab 3.3.10 |
Component: | Operators | Version: | 3.3.9 |
Keywords: | Cc: |
Description
Especially for analyzing algorithms and operators, it would be helpful to have operators which can be configured to execute pre- and post processing actions.
Attachments (1)
Change History (34)
comment:1 Changed 11 years ago by ascheibe
- Owner changed from ascheibe to mkommend
- Status changed from new to assigned
comment:2 Changed 11 years ago by mkommend
- Status changed from assigned to accepted
comment:3 Changed 11 years ago by mkommend
comment:4 Changed 11 years ago by mkommend
Added a sample algorithm which counts the crossover events for a tsp problem. The sample can only be opened when the base class of PermutationCrossover is InstrumentedOperator.
comment:5 Changed 11 years ago by mkommend
- Owner changed from mkommend to gkronber
- Status changed from accepted to reviewing
comment:6 Changed 11 years ago by mkommend
- Owner changed from gkronber to architects
comment:7 Changed 11 years ago by mkommend
- Owner changed from architects to mkommend
- Status changed from reviewing to assigned
comment:8 Changed 11 years ago by mkommend
- Status changed from assigned to accepted
comment:9 Changed 11 years ago by mkommend
r10231: Improvements to the InstrumentedOperator class:
- skipped generation of operations if no instrumentation is performed
- changed type of operators parameters to OperatorList
comment:10 Changed 11 years ago by mkommend
- Owner changed from mkommend to architects
- Status changed from accepted to reviewing
comment:11 Changed 11 years ago by gkronber
- Owner changed from architects to mkommend
- Status changed from reviewing to assigned
Discussed in architects meeting.
comment:12 Changed 11 years ago by mkommend
r10261: Chained execution contexts of before and after operators in the instrumented operator to enable a parameter lookup.
comment:13 Changed 11 years ago by mkommend
- Status changed from assigned to accepted
r10291: Added interface for instrumented operators and adapted problem and encoding specific operators to provide instrumentation capabilities.
All SolutionCreators, Crossovers, Manipulators, Evaluators and Selecters except the following are now derived from the InstrumentedOperator:
- VRP related operators
- OKB relatored operators
- Move related operators
- UserDefinedOperators
- RealVectorParticleCreator (Encodings.RealVector)
- ExternalEvaluator
- GenderSpecificSelector
- OffspringSelector
comment:14 Changed 11 years ago by mkommend
r10292: Reverted accidental changes in OKB.EmptySolutionCreator and UserDefinedProblem.
comment:15 Changed 11 years ago by mkommend
- Owner changed from mkommend to svonolfe
- Status changed from accepted to assigned
comment:16 Changed 11 years ago by mkommend
Please adapt the VRP related operators.
comment:17 Changed 11 years ago by mkommend
r10295: Adapted all MultiOperators to subclass InstrumentedOperator.
comment:18 Changed 11 years ago by svonolfe
r10298 : Adapted all VRP related operators to subclass InstrumentedOperator
comment:19 Changed 11 years ago by svonolfe
- Owner changed from svonolfe to mkommend
comment:20 Changed 11 years ago by svonolfe
r10299: Adapted all FLA related operators to subclass InstrumentedOperator
comment:21 Changed 11 years ago by jkarder
r10309: Adapted MultiIntValueCrossover to subclass InstrumentedOperator.
comment:22 Changed 11 years ago by mkommend
- Owner changed from mkommend to gkronber
- Status changed from assigned to reviewing
comment:23 follow-up: ↓ 24 Changed 11 years ago by gkronber
- Owner changed from gkronber to mkommend
I think these two changes are not correct. It seems the selection is already done correctly in the base class (StochasticMultiOperator). Please recheck these changes and correct if necessary:
- https://dev.heuristiclab.com/trac/hl/core/changeset/10298/trunk/sources/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/General/Manipulators/BiasedMultiVRPSolutionManipulator.cs
- https://dev.heuristiclab.com/trac/hl/core/changeset/10298/trunk/sources/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/General/Crossovers/BiasedMultiVRPSolutionCrossover.cs
Reviewed: r10309,r10399,r10298, r10295, r10292, r10291, r10261, r10231, r10149. Important part is r10149.
In reviewing I noticed that weighted (proportional) sampling is implemented in each StochasticMultiOperator. I think we should use the static methods from HeuristicLab.Random instead. The code looks the same so hopefully there would not be a change in behaviour.
comment:24 in reply to: ↑ 23 Changed 11 years ago by mkommend
Replying to gkronber:
I think these two changes are not correct. It seems the selection is already done correctly in the base class (StochasticMultiOperator). Please recheck these changes and correct if necessary:
- https://dev.heuristiclab.com/trac/hl/core/changeset/10298/trunk/sources/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/General/Manipulators/BiasedMultiVRPSolutionManipulator.cs
- https://dev.heuristiclab.com/trac/hl/core/changeset/10298/trunk/sources/HeuristicLab.Problems.VehicleRouting/3.4/Encodings/General/Crossovers/BiasedMultiVRPSolutionCrossover.cs
These two code duplications are necessary, because the biased operators update the selection probabilities during the algorithm run and therefore could not reuse the already implemented functionality. SVonolfe added a comment in the classes with r10472.
comment:25 Changed 11 years ago by mkommend
- Owner changed from mkommend to gkronber
comment:26 follow-up: ↓ 30 Changed 11 years ago by gkronber
r10474 using RandomEnumerable.SampleProportional in BiasedMultiVRPOperators. This should also be changed in StochasticMultiOperator but is not easily possible because of plugin dependency HeuristicLab.Random -> HeuristicLab.Operators.
comment:27 Changed 11 years ago by gkronber
If there are no further problems this ticket is ready for release.
comment:28 Changed 11 years ago by mkommend
- Owner changed from gkronber to mkommend
- Status changed from reviewing to readytorelease
comment:29 Changed 11 years ago by gkronber
comment:30 in reply to: ↑ 26 Changed 11 years ago by mkommend
Replying to gkronber:
r10474 using RandomEnumerable.SampleProportional in BiasedMultiVRPOperators. This should also be changed in StochasticMultiOperator but is not easily possible because of plugin dependency HeuristicLab.Random -> HeuristicLab.Operators.
r10474 is not related to this ticket and will be merged to the stable with #2146.
comment:31 Changed 11 years ago by mkommend
comment:32 Changed 11 years ago by mkommend
- Resolution set to done
- Status changed from readytorelease to closed
r10149: Implemented instrumentation for operators.