Opened 4 years ago

Last modified 4 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)

  • HL 3.3.16 merge
    • Check all added files for StorableTypes and GUIDs
    • Check all license headers of added files
  • Introduce base problems for each encoding
  • SingleObjective- & MultiObjectiveProblem introduce virtual member calls in their ctor to get the Maximization value, which poses a problem as the value might not be known at this time
    • Changed event for maximization
    • ForceValue(value) for OptionalValueParameter that ignores ReadOnly
  • Cancellation token in Evaluate function of Problems
  • Introduce new parameter type that can look up problems and algorithms
  • Introduce SolutionParameter in ISolutionCreator<TSolution>
    • Create new interface that specifies solution parameter
    • Adapt all operators to this interface
  • Return additional data from Evaluate (see discussion in #2774)
    • Refactor Evaluate methods to return IEvaluationResult instead of void
    • Adapt ISingleObjectiveOperators (from double to IEvaluationResult)
    • Identify simple pattern for comparison of IEvaluationResult
    • Adapt unit tests and external evaluation problems
    • Provide view for evaluation result
    • Adapt all multi-objective problems and operators
  • Separate icons for single- and multi-objective problems and algorithms
  • Adapt unit tests
    • Check for commented tests (Scheduling, BinPacking)
  • Evaluate method in QAP is slow due to parameter access, check other problems too

Refactoring of Plugins

  • HL.Problems.BinPacking
  • HL.Problems.GraphColoring
  • HL.Problems.PTSP
    • Evaluate composition vs inheritance
  • HL.Problems.Scheduling
  • HL.Problems.TestFunctions.MultiObjective mkommend
    • status has to be checked
  • HL.Algorithms.MOCMAEvolutionStrategy
    • status has to be checked
  • HL.Problems.GrammaticalEvolution.DataAnalysis
  • HL.Problems.TravelingSalesman
  • HL.Problems.VehicleRouting

Compare with trunk (after mering in r17226):

  • Knapsack Problem - Hamming Similartiy Calculator
  • QAP
  • External Evaluation
  • P3 EvaluationTracker
  • PSOSwarmUpdater & Initializer Boundsparameter

To discuss:

  • Merge HeuristicOptimizationProblem with BasicProblem
    • 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.
    • Provide specialized code templates, which are compiled, for programmable problems (e.g. RealVectorProblem that configures the bounds correctly)
    • Change name of result for best scope solution analyzer due to name clashes with programmable problems' analyze method.
    • AckleyEvaluator change from evaluator to problem? stays the storable type GUID the same

Change History (153)

comment:1 Changed 4 years ago by mkommend

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

r13327: Branched whole trunk for problem refactoring.

comment:2 Changed 4 years ago by mkommend

r13330: Deleted wrongly created for problem refactoring.

comment:3 Changed 4 years ago by mkommend

r13331: Branched trunk/sources for problem refactoring.

comment:4 Changed 4 years ago by abeham

  • Description modified (diff)

comment:5 Changed 4 years ago by mkommend

r13336: Refactored encodings and problems.

comment:6 Changed 4 years ago by mkommend

r13337: Added new class for problem refactoring.

comment:7 Changed 4 years ago by mkommend

r13339: Rectored problems and encodings.

comment:8 Changed 4 years ago by mkommend

r13345: refactored programmable problem

comment:9 Changed 4 years ago by mkommend

r13348: Refactored single-objective programmable problem.

comment:10 Changed 4 years ago by abeham

r13351: Adapted multi-encoding for new infrastructure

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

comment:11 Changed 4 years ago by abeham

r13356: working on multi-encoding

comment:12 Changed 4 years ago by abeham

r13357: changed solution name of combined encoding

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

r13362: Forgot to commit IMultiObjectiveProblem.

comment:16 Changed 4 years ago by mkommend

r13364: Refactored IntegerVectorEncoding, KnapsackProblem, and P3.

comment:17 Changed 4 years ago by abeham

r13365: fixed recreation of programmable problem's encoding

comment:18 Changed 4 years ago by mkommend

r13366: Adapted PermutationEncoding and TSP.

comment:19 Changed 4 years ago by mkommend

r13372: Fixed all problems.

comment:20 Changed 4 years ago by abeham

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

comment:21 Changed 4 years ago by abeham

r13374: removed obsolete file

comment:22 Changed 4 years ago by abeham

r13376: working on refactoring

comment:23 Changed 4 years ago by mkommend

r13377: Added missing interfaces to problems.

comment:24 Changed 4 years ago by abeham

r13380: updated categories, template

comment:25 Changed 4 years ago by abeham

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

comment:26 Changed 4 years ago by abeham

r13385: fixed plugin dependencies and updated samples

comment:27 Changed 4 years ago by abeham

r13388:

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

comment:28 Changed 4 years ago by abeham

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

comment:29 Changed 4 years 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 4 years ago by abeham (previous) (diff)

comment:30 Changed 4 years 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 4 years 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 4 years 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 4 years ago by abeham

r13405: Implemented SchafferF6 test function

comment:34 Changed 4 years ago by abeham

  • Description modified (diff)

comment:35 Changed 4 years ago by abeham

  • Description modified (diff)

comment:36 Changed 4 years ago by abeham

  • Description modified (diff)

comment:37 Changed 4 years ago by mkommend

  • Description modified (diff)

comment:38 Changed 4 years 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 4 years ago by mkommend (previous) (diff)

comment:39 Changed 4 years ago by mkommend

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

comment:40 Changed 4 years ago by mkommend

  • Description modified (diff)

comment:41 Changed 4 years ago by mkommend

r13435: Intermediate version of schedule encoding refactoring.

comment:42 Changed 4 years ago by mkommend

r13436: Minor improvements in SchedulingEncoding.

comment:43 Changed 4 years ago by mkommend

r13437: Added encodings for schedules.

Last edited 4 years ago by mkommend (previous) (diff)

comment:44 Changed 4 years ago by mkommend

r13443: Adapted decoders for SchedulingProblem.

comment:45 Changed 4 years ago by pfleck

r13449

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

comment:46 Changed 4 years ago by mkommend

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

comment:47 Changed 4 years ago by mkommend

  • Description modified (diff)

comment:48 Changed 3 years ago by abeham

r14684: added clean script

comment:49 Changed 2 years ago by abeham

r15697: renamed branch according to guidelines

comment:50 Changed 12 months ago by abeham

r16532: reverted r14429

comment:51 Changed 10 months ago by abeham

r16692: merged trunk changes up to r15681 into branch (removal of trunk/sources)

comment:52 Changed 10 months ago by abeham

r16723: merged changes from r15684 to trunk HEAD (r16716) and resolved all merge conflicts

  • it doesn't build

comment:53 Changed 10 months ago by mkommend

r16724: Corrected compilation errors in some projects.

comment:54 Changed 10 months ago by abeham

r16725:

  • Adapt Encodings.ScheduleEncoding to new persistence
  • Adapt Problems.Programmable to new persistence

comment:55 Changed 10 months ago by abeham

r16726: fixed single-objective test functions

comment:56 Changed 10 months ago by mkommend

  • Description modified (diff)

comment:57 Changed 10 months ago by mkommend

  • Description modified (diff)

comment:58 Changed 10 months ago by abeham

r16749: fixed RealVectorEncoding

comment:59 Changed 10 months ago by mkommend

  • Description modified (diff)

comment:60 Changed 10 months ago by mkommend

  • Description modified (diff)

r16750: Renamed SingleObjectiveProgrammableProblemView to ProgrammableProblemView.

comment:61 Changed 10 months ago by abeham

  • Description modified (diff)

comment:62 Changed 10 months ago by mkommend

  • Description modified (diff)

r16751: Renamed Solution to EncodedSolution.

comment:63 Changed 10 months ago by abeham

r16752: added comment to P3

  • removed todos from EvaluationServiceClientView

comment:64 Changed 10 months ago by mkommend

  • Description modified (diff)

comment:65 Changed 10 months ago by mkommend

r16753: Made basic problem specific operators internal and sealed.

comment:66 Changed 10 months ago by mkommend

  • Description modified (diff)

comment:67 Changed 10 months ago by abeham

r16767: Adapted graph coloring problem

comment:68 Changed 9 months ago by mkommend

  • Description modified (diff)

comment:69 Changed 9 months ago by mkommend

r16801: Merged trunk changes and adapted programmable problem templates for combined solutions.

comment:70 Changed 9 months ago by mkommend

  • Description modified (diff)

comment:71 Changed 9 months ago by mkommend

r16806: Added StorableType attributes to interfaces and adapted basic problems.
r16807: Adapted test functions to new architecture and partly MOCMAES.

comment:72 Changed 9 months ago by mkommend

r16808: Added StorableType to FitnessFunction enum of GraphColoringProblem.

comment:73 Changed 9 months ago by abeham

  • Description modified (diff)

comment:74 Changed 9 months ago by abeham

r16811: Removed usage of default constructor

comment:75 Changed 9 months ago by mkommend

  • Description modified (diff)

comment:76 Changed 9 months ago by abeham

  • Description modified (diff)

r16812: fixed naming

comment:77 Changed 9 months ago by mkommend

  • Description modified (diff)

comment:78 Changed 9 months ago by mkommend

  • Description modified (diff)

comment:79 Changed 9 months ago by mkommend

r16813: Changed base ctor call in all GeneticProgrammingProblems.

comment:80 Changed 9 months ago by abeham

  • Description modified (diff)

comment:81 Changed 9 months ago by mkommend

r16814: Adapted binary problems and moved to abstract base class to encoding.

comment:82 Changed 9 months ago by mkommend

r16815: Made programmable problem base classes abstract.

comment:83 Changed 9 months ago by abeham

r16816: Refactored external evaluation problem

comment:84 Changed 9 months ago by abeham

r16874: separated single-objective and multi-objective categories

comment:85 Changed 9 months ago by abeham

  • Description modified (diff)

comment:86 Changed 9 months ago by abeham

r16876:

  • Added abstract multi-objective problem class for binary vector encoding
  • Added abstract problem classes for integer vector encoding

comment:87 Changed 9 months ago by abeham

  • Description modified (diff)

comment:88 Changed 8 months ago by mkommend

r16946: Merged trunk changes up to r16945 into branch.

comment:89 Changed 8 months ago by mkommend

r16947: Adapted GP basic problems to use read-only value parameters.

comment:90 Changed 8 months ago by abeham

r16948: Added and modified encoding-specific abstract base classes

comment:91 Changed 8 months ago by abeham

r16949: Adapted test function problems to new real vector problem

  • Made encoding readonly in symbolic expression tree problem

comment:92 Changed 8 months ago by abeham

r16950: Refactor Analyze method of encoding-specific problems, simplify Analyze of SO-TF

comment:93 Changed 5 months ago by mkommend

r17225: Integrated changes of #2943 into problem refactoring branch.

comment:94 Changed 5 months ago by abeham

  • Description modified (diff)

comment:95 Changed 5 months ago by abeham

  • Description modified (diff)

comment:96 Changed 5 months ago by mkommend

r17226: Merged trunk changes into problem refactoring branch.

comment:97 Changed 5 months ago by abeham

  • Description modified (diff)

comment:98 Changed 5 months ago by abeham

r17229: Refactored ParetoFrontScatterPlot (moved from TestFunctions.MultiObjective to Analysis)

  • Introduced generic type that may work with all solution encodings

comment:99 Changed 5 months ago by abeham

r17230: add multi-objective analysis to all multi-objective encoding-base problems

comment:100 Changed 5 months ago by abeham

r17232: Improve speed of Evaluate() in QuadraticAssignmentProblem

comment:101 Changed 5 months ago by abeham

  • Description modified (diff)

comment:102 Changed 5 months ago by abeham

  • Description modified (diff)

comment:103 Changed 4 months ago by abeham

r17239: working on refactoring TSP

comment:104 Changed 4 months ago by abeham

r17241: worked on refactoring TSP

comment:105 Changed 4 months ago by abeham

r17248: working on TSP refactoring

comment:106 Changed 4 months ago by abeham

r17251: finished refactoring TSP

comment:107 Changed 4 months ago by abeham

r17252: made QAP problem data readonly

  • Also refactored instance providers slightly to specify file extension for importing and exporting data and fixing dialogs

comment:108 Changed 4 months ago by abeham

r17253: worked on refactoring PTSP

comment:109 Changed 4 months ago by abeham

r17254: Added context lookup parameter

  • Refactored tests
  • Fixed duplicate GUID

comment:110 Changed 4 months ago by abeham

  • Description modified (diff)

comment:111 Changed 4 months ago by abeham

r17257: Refactored ContextLookupParameter with suggestions from mkommend

  • Add StorableType attribute to some types

comment:112 Changed 4 months ago by mkommend

r17258: Removed failing projects from solution.

comment:113 Changed 4 months ago by abeham

r17259: fixed bug in lookup paramater introduced in refactoring

comment:114 Changed 4 months ago by abeham

r17260: Worked on PTSP refactoring

Last edited 4 months ago by abeham (previous) (diff)

comment:115 Changed 4 months ago by mkommend

r17261: Refactored multi-obj test functions and CMA-ES.

comment:116 Changed 4 months ago by mkommend

r17262: Adapted unit tests for multi-objective analysis.

comment:117 Changed 4 months ago by abeham

r17264:17265:

  • Finished refactoring pTSP
  • Remove usage of solutions or best-known quality when converting TSPLIB instances to pTSP instances

comment:118 Changed 4 months ago by abeham

  • Description modified (diff)

comment:119 Changed 4 months ago by abeham

r17270: worked on removing virtual from Maximization for single-objective problems

comment:120 Changed 4 months ago by mkommend

r17279: Updated single-objective problem to include a static is better method and fixed setter of maximization property.

comment:121 Changed 4 months ago by abeham

r17309: Refactored maximization property for multi-objective problems

comment:122 Changed 4 months ago by abeham

  • Description modified (diff)

comment:123 Changed 4 months ago by abeham

r17315: : reverted r17309

comment:124 Changed 3 months ago by abeham

  • Description modified (diff)

r17317: refactored multi-objective problems' maximization

  • Add ForceValue method to IValueParameter to perform changes even when it is read-only
  • Add MaximizationChanged event handler

comment:125 Changed 3 months ago by abeham

  • Description modified (diff)

comment:126 Changed 3 months ago by abeham

  • Description modified (diff)

comment:127 Changed 3 months ago by mkommend

r17320: Added cancellation token to evaluate function of problems.

@abeham please review (especially the changes in the external evaluation problem and cache).

comment:128 Changed 3 months ago by mkommend

  • Description modified (diff)

comment:129 Changed 3 months ago by abeham

  • Description modified (diff)

Changes look good.

comment:130 Changed 3 months ago by abeham

r17321: fixed compile errors in Tests

comment:131 Changed 3 months ago by mkommend

r17333: Updated branch with most recent trunk changes.

comment:132 Changed 3 months ago by abeham

  • Description modified (diff)

comment:133 Changed 3 months ago by mkommend

r17334: Moved IStorableContent from generic problem implementation to IProblem.

comment:134 Changed 3 months ago by abeham

r17335:17336: Refactored pTSP to use compositional pattern

comment:135 Changed 3 months ago by bwerth

  • Description modified (diff)

r17338 fixed crowding unit tests, moved CrowdingTest, HyperVolumeTests and FastHyperVolumeTests to their own subfolder

comment:136 Changed 3 months ago by bwerth

  • Description modified (diff)

reversed unintentional description modification

comment:137 Changed 3 months ago by bwerth

r17340 forgot to commit changes to HeuristicLab.Optimization-3.3.csproj

comment:138 Changed 2 months ago by abeham

r17355: removed obsolete files and fixed compilation error in VnsTspSampleTest

comment:139 Changed 2 months ago by abeham

r17356: fixed some problems in Samples.Create unit tests and updated samples

comment:140 Changed 2 months ago by mkommend

r17357: Added solution context and evaluation results.

comment:141 Changed 2 months ago by mkommend

r17358: Corrected cloning method of solution contexts.

comment:142 Changed 2 months ago by abeham

r17359: fix bugs in unit tests, add vns_tsp sample

comment:143 Changed 2 months ago by abeham

r17360: fixed some unit tests

comment:144 Changed 2 months ago by abeham

r17361: fixed further unit tests (plugin dependencies)

comment:145 Changed 8 weeks ago by mkommend

r17363: First version of contexts in problem evaluation.

comment:146 Changed 8 weeks ago by mkommend

r17366: Fixed bugs in solution context and adapted programmable problem template to include a cancellation token in the evaluate function.

comment:147 Changed 6 weeks ago by abeham

  • Description modified (diff)

comment:148 Changed 6 weeks ago by abeham

  • Description modified (diff)

comment:149 Changed 6 weeks ago by abeham

r17373: changed dependency

comment:150 Changed 4 weeks ago by mkommend

r17381: Fixed single-objective evaluation results and scope contexts.

comment:151 Changed 4 weeks ago by mkommend

r17382: Refactored single-objective problems to use EvaluationResult instead of double as return type from Evaluate.

comment:152 Changed 4 weeks ago by mkommend

r17383: Adapted analyze methods of single-obj problems.

comment:153 Changed 4 weeks ago by mkommend

  • Description modified (diff)
Note: See TracTickets for help on using tickets.