Opened 16 months ago

Last modified 6 weeks ago

#2521 accepted enhancement

Refactor Problem/Encoding

Reported by: abeham Owned by: mkommend
Priority: medium Milestone: HeuristicLab 4.0
Component: General Version: branch
Keywords: Cc:

Description (last modified by mkommend)

  • Merge HeuristicOptimizationProblem with BasicProblem
  • Translate Scheduling/ScheduleEncoding
  • Unify structure of Encodings
  • Decouple Solutions from ValueTypeArrays (e.g. IntVector subclass IntArray)
  • Type generation of generic types with reference between the type constraints fails
  • SingleObjectiveProgrammableProblemView -> ProgrammableProblemView
  • Swap TSolution and TEncoding
  • Introduce new parameter type that can look up problems and algorithms
  • Rename ISolution to IEncodedSolution
  • Make operators (SingleObjectiveAnalyzer<TSolution>, ...) internal
  • Introduce SolutionParameter in ISolutionCreator<TSolution>
    • Create new interface that specifies solution parameter
    • Adapt all operators to this interface
  • Make ISingleObjectiveOperaotr a meaningful interface and adapt all operators
    • Same for IMultiObjectiveOperator
  • Adapt unit tests

To discuss:

  • Add new() constraint on TEncoding and TSolution of the Problem classes to forbid the creation of a Problem with abstract or not instantiable type parameters.

Change History (48)

comment:1 Changed 16 months ago by mkommend

  • Owner set to mkommend
  • Status changed from new to accepted

r13327: Branched whole trunk for problem refactoring.

comment:2 Changed 16 months ago by mkommend

r13330: Deleted wrongly created for problem refactoring.

comment:3 Changed 16 months ago by mkommend

r13331: Branched trunk/sources for problem refactoring.

comment:4 Changed 16 months ago by abeham

  • Description modified (diff)

comment:5 Changed 16 months ago by mkommend

r13336: Refactored encodings and problems.

comment:6 Changed 16 months ago by mkommend

r13337: Added new class for problem refactoring.

comment:7 Changed 16 months ago by mkommend

r13339: Rectored problems and encodings.

comment:8 Changed 16 months ago by mkommend

r13345: refactored programmable problem

comment:9 Changed 16 months ago by mkommend

r13348: Refactored single-objective programmable problem.

comment:10 Changed 16 months ago by abeham

r13351: Adapted multi-encoding for new infrastructure

TODO: Evaluator, Analyzer, ... need to be copied

comment:11 Changed 16 months ago by abeham

r13356: working on multi-encoding

comment:12 Changed 16 months ago by abeham

r13357: changed solution name of combined encoding

comment:13 Changed 16 months ago by abeham

r13359: worked on multi-encoding (it works again). Some issues are still present:

  • The programmable template needs to be slightly updated for multi-encoding
  • The encoding is recreated every time it is compiled making it impossible to configure operators

comment:14 Changed 16 months ago by mkommend

r13350: Adapted multi-objective programmable problem. r13361: Adapted real vector encoding, test function problems, P3, CMA-ES and optimization.

comment:15 Changed 16 months ago by mkommend

r13362: Forgot to commit IMultiObjectiveProblem.

comment:16 Changed 16 months ago by mkommend

r13364: Refactored IntegerVectorEncoding, KnapsackProblem, and P3.

comment:17 Changed 16 months ago by abeham

r13365: fixed recreation of programmable problem's encoding

comment:18 Changed 16 months ago by mkommend

r13366: Adapted PermutationEncoding and TSP.

comment:19 Changed 16 months ago by mkommend

r13372: Fixed all problems.

comment:20 Changed 16 months ago by abeham

r13373: adapted templates, fixed missing reference in outdated plugin lawnmower

comment:21 Changed 16 months ago by abeham

r13374: removed obsolete file

comment:22 Changed 16 months ago by abeham

r13376: working on refactoring

comment:23 Changed 16 months ago by mkommend

r13377: Added missing interfaces to problems.

comment:24 Changed 16 months ago by abeham

r13380: updated categories, template

comment:25 Changed 16 months ago by abeham

r13382: added default ctor to SymbolicExpressionTreeEncoding (otherwise the parameter in Problem<..> cannot create it)

comment:26 Changed 16 months ago by abeham

r13385: fixed plugin dependencies and updated samples

comment:27 Changed 16 months ago by abeham

r13388:

  • Readded excluded views
  • Removed ProblemInstanceProviderView which was not referenced in the project file
  • Fixed plugin dependency

comment:28 Changed 16 months ago by abeham

r13390: fixed template and bug in programmable problem with multi encoding

comment:29 Changed 16 months ago by abeham

r13396:

  • Refactored QuadraticAssignmentProblem to use new SingleObjectiveProblem
    • Removed QAPEvaluator
    • Adapted RobustTabooSearch
  • Introduced several interfaces in PermutationEncoding necessary for wiring
  • Changed all Encodings to use IItem instead of IOperator in ConfigureOperators (name still unchanged)
  • Added a protected MaximizationParameter property in SingleObjectiveProblem (necessary for wiring)
  • Changed AlleleFrequencyAnalyzer to use ISolution interface instead of IItem
  • Added a comment to ISolutionCreator<TSolution> of some changes that would be welcomed
Last edited 16 months ago by abeham (previous) (diff)

comment:30 Changed 16 months ago by abeham

r13403:

  • Adapted single-objective test function problem to new problem infrastructure
  • Added additional interfaces to RealVectorEncoding
  • Fixed IParticleUpdater interface (must implement IStochasticOperator if it contains a Random parameter)

comment:31 Changed 16 months ago by abeham

I'd like to suggest that we swap the generic type parameters from Problem<TEncoding, TSolution> to Problem<TSolution, TEncoding>. The reason is that TSolution is limiting TEncoding and not vice versa. It feels strange to write the more limiting generic type parameter first.

comment:32 Changed 16 months ago by abeham

r13404:

  • Adapted Knapsack problem to new problem infrastructure
  • Introduced additional interfaces in binary vector encoding
  • Improved KnapsackImprovementOperator which requires less evaluated solutions in case of an infeasible start solution

Loosely related change:

  • All LookupParameters are now shown by default
  • Wiring code should make sure that wired parameters are hidden

comment:33 Changed 16 months ago by abeham

r13405: Implemented SchafferF6 test function

comment:34 Changed 16 months ago by abeham

  • Description modified (diff)

comment:35 Changed 16 months ago by abeham

  • Description modified (diff)

comment:36 Changed 16 months ago by abeham

  • Description modified (diff)

comment:37 Changed 16 months ago by mkommend

  • Description modified (diff)

comment:38 Changed 16 months ago by mkommend

r13408: Adapted unit tests in problem refactoring branch.

All compile, some fail:

  • SA Rastrigin example (missing move evaluators?)
  • LS Knapsack example
Last edited 16 months ago by mkommend (previous) (diff)

comment:39 Changed 16 months ago by mkommend

r13422: Adapted type discovery and type selector to allow the creation of generic programmable problems.

comment:40 Changed 16 months ago by mkommend

  • Description modified (diff)

comment:41 Changed 16 months ago by mkommend

r13435: Intermediate version of schedule encoding refactoring.

comment:42 Changed 16 months ago by mkommend

r13436: Minor improvements in SchedulingEncoding.

comment:43 Changed 16 months ago by mkommend

r13437: Added encodings for schedules.

Last edited 16 months ago by mkommend (previous) (diff)

comment:44 Changed 16 months ago by mkommend

r13443: Adapted decoders for SchedulingProblem.

comment:45 Changed 16 months ago by pfleck

r13449

  • Replaced JSMDecodingErrorPolicy and JSMForcingStrategy with EnumValues.
  • Removed obsolete views for the scheduling enums.

comment:46 Changed 16 months ago by mkommend

r13469: Refactored problem base classes and adapted scheduling encoding, scheduling problem and unit tests.

comment:47 Changed 13 months ago by mkommend

  • Description modified (diff)

comment:48 Changed 6 weeks ago by abeham

r14684: added clean script

Note: See TracTickets for help on using tickets.