Free cookie consent management tool by TermsFeed Policy Generator

Opened 10 years ago

Closed 10 years ago

Last modified 10 years ago

#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)

Count Crossover events.hl (205.6 KB) - added by mkommend 10 years ago.
Added example for operator instrumentation

Download all attachments as: .zip

Change History (34)

comment:1 Changed 10 years ago by ascheibe

  • Owner changed from ascheibe to mkommend
  • Status changed from new to assigned

comment:2 Changed 10 years ago by mkommend

  • Status changed from assigned to accepted

comment:3 Changed 10 years ago by mkommend

r10149: Implemented instrumentation for operators.

Changed 10 years ago by mkommend

Added example for operator instrumentation

comment:4 Changed 10 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 10 years ago by mkommend

  • Owner changed from mkommend to gkronber
  • Status changed from accepted to reviewing

comment:6 Changed 10 years ago by mkommend

  • Owner changed from gkronber to architects

comment:7 Changed 10 years ago by mkommend

  • Owner changed from architects to mkommend
  • Status changed from reviewing to assigned

comment:8 Changed 10 years ago by mkommend

  • Status changed from assigned to accepted

comment:9 Changed 10 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 10 years ago by mkommend

  • Owner changed from mkommend to architects
  • Status changed from accepted to reviewing

comment:11 Changed 10 years ago by gkronber

  • Owner changed from architects to mkommend
  • Status changed from reviewing to assigned

Discussed in architects meeting.

The instrumentation operations should be execute with a child execution context to enable a parameter lookup for parameters defined in the instrumented operator.

The base class of the following classes should be changed to the InstrumentedOperator:

  • SolutionCreators
  • Crossovers
  • Manipulators
  • Evaluators
  • Selectors
Last edited 10 years ago by mkommend (previous) (diff)

comment:12 Changed 10 years ago by mkommend

r10261: Chained exeuction contexts of before and after operators in the instrumented operator to enable a parameter lookup.

Version 0, edited 10 years ago by mkommend (next)

comment:13 Changed 10 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 10 years ago by mkommend

r10292: Reverted accidental changes in OKB.EmptySolutionCreator and UserDefinedProblem.

comment:15 Changed 10 years ago by mkommend

  • Owner changed from mkommend to svonolfe
  • Status changed from accepted to assigned

comment:16 Changed 10 years ago by mkommend

Please adapt the VRP related operators.

comment:17 Changed 10 years ago by mkommend

r10295: Adapted all MultiOperators to subclass InstrumentedOperator.

comment:18 Changed 10 years ago by svonolfe

r10298 : Adapted all VRP related operators to subclass InstrumentedOperator

comment:19 Changed 10 years ago by svonolfe

  • Owner changed from svonolfe to mkommend

comment:20 Changed 10 years ago by svonolfe

r10299: Adapted all FLA related operators to subclass InstrumentedOperator

comment:21 Changed 10 years ago by jkarder

r10309: Adapted MultiIntValueCrossover to subclass InstrumentedOperator.

comment:22 Changed 10 years ago by mkommend

  • Owner changed from mkommend to gkronber
  • Status changed from assigned to reviewing

comment:23 follow-up: Changed 10 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:

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 10 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:

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 10 years ago by mkommend

  • Owner changed from mkommend to gkronber

comment:26 follow-up: Changed 10 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 10 years ago by gkronber

If there are no further problems this ticket is ready for release.

comment:28 Changed 10 years ago by mkommend

  • Owner changed from gkronber to mkommend
  • Status changed from reviewing to readytorelease

comment:29 Changed 10 years ago by gkronber

Please make sure to merge r10439 into stable again (#2134).

comment:30 in reply to: ↑ 26 Changed 10 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 10 years ago by mkommend

r10299: Adapted all FLA related operators to subclass InstrumentedOperator r10309: Adapted MultiIntValueCrossover to subclass InstrumentedOperator.

These two changesets are not applied on the trunk and won't be merged into stable with this ticket.

comment:32 Changed 10 years ago by mkommend

  • Resolution set to done
  • Status changed from readytorelease to closed

r10507: Merged r10149, r10231, r10261, r10291, r10292, r10295 and r10298 into stable.

comment:33 Changed 10 years ago by abeham

r10929: merged r10472 to stable (was forgotten in r10507)

Note: See TracTickets for help on using tickets.