heal-research / HeuristicLab

HeuristicLab - An environment for heuristic and evolutionary optimization
https://dev.heuristiclab.com
GNU General Public License v3.0
38 stars 16 forks source link

Refactor Problem/Encoding #2521

Open HeuristicLab-Trac-Bot opened 9 years ago

HeuristicLab-Trac-Bot commented 9 years ago

Issue migrated from trac ticket # 2521

milestone: HeuristicLab 4.0 | component: General | priority: medium

2015-11-23 09:47:12: @abeham created the issue


  • 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

    • 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 & solution context
    • Adapt all multi-objective problems and operators
  • ~~ Use ResultsParamater for storing results from the problem (evaluate, analyze) so that a defined output behavior is established (requirement for JSON converter)

    • ~~ New results have been implemented that define the output behavior.
    • ~~ Implement results for basic problems.
    • implement results for operators.
    • ~~ Combined results of algorithms, problems, operators (analyzers) in result collection.
    • Adapt parameters view to separate results parameter from all other parameters to define an input / output behavior.
  • Make encoding parameters readonly per default to avoid manipulation

    • When using a combined encoding all parameters of nested encodings have to be set to readonly = false.
  • 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

  • ~~ Memory leak when replacing parameters in the encoding instance with those of the problem instance -> the encoding might not live as long as the problem, but the parameter in the problem has a reference to the Encoding's parameter collection. ~~ This has been fixed with the usage of reference parameters.

  • Change Gaussian Processes from engine algorithm to basic algorithm

  • Add special parameters for algorithm and problem discovery

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

  • HL.Problems.DataAnalysis.* mkommend

  • Change NCA, GPR & GPC, and BFGS to basic algorithms.

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
HeuristicLab-Trac-Bot commented 9 years ago

2015-11-23 09:49:20: @mkommend changed status from new to accepted

HeuristicLab-Trac-Bot commented 9 years ago

2015-11-23 09:49:20: @mkommend removed owner

HeuristicLab-Trac-Bot commented 9 years ago

2015-11-23 09:49:20: @mkommend commented


r13327: Branched whole trunk for problem refactoring.

HeuristicLab-Trac-Bot commented 9 years ago

2015-11-23 10:00:28: @mkommend commented


r13330 (not migrated): Deleted wrongly created for problem refactoring.

HeuristicLab-Trac-Bot commented 9 years ago

2015-11-23 10:02:27: @mkommend commented


r13331: Branched trunk/sources for problem refactoring.

HeuristicLab-Trac-Bot commented 9 years ago

2015-11-23 14:40:46: @abeham edited the issue description

HeuristicLab-Trac-Bot commented 9 years ago

2015-11-23 15:15:55: @mkommend commented


r13336: Refactored encodings and problems.

HeuristicLab-Trac-Bot commented 9 years ago

2015-11-23 15:17:25: @mkommend commented


r13337: Added new class for problem refactoring.

HeuristicLab-Trac-Bot commented 9 years ago

2015-11-23 16:15:24: @mkommend commented


r13339: Rectored problems and encodings.

HeuristicLab-Trac-Bot commented 9 years ago

2015-11-23 18:38:56: @mkommend commented


r13345: refactored programmable problem

HeuristicLab-Trac-Bot commented 9 years ago

2015-11-23 21:07:40: @mkommend commented


r13348: Refactored single-objective programmable problem.

HeuristicLab-Trac-Bot commented 9 years ago

2015-11-23 22:19:00: @abeham commented


r13351: Adapted multi-encoding for new infrastructure

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

HeuristicLab-Trac-Bot commented 9 years ago

2015-11-24 12:56:24: @abeham commented


r13356: working on multi-encoding

HeuristicLab-Trac-Bot commented 9 years ago

2015-11-24 14:30:03: @abeham commented


r13357: changed solution name of combined encoding

HeuristicLab-Trac-Bot commented 9 years ago

2015-11-24 15:24:30: @abeham commented


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
HeuristicLab-Trac-Bot commented 9 years ago

2015-11-24 16:02:07: @mkommend commented


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

HeuristicLab-Trac-Bot commented 9 years ago

2015-11-24 16:20:14: @mkommend commented


r13362: Forgot to commit IMultiObjectiveProblem.

HeuristicLab-Trac-Bot commented 9 years ago

2015-11-24 16:42:39: @mkommend commented


r13364: Refactored IntegerVectorEncoding, KnapsackProblem, and P3.

HeuristicLab-Trac-Bot commented 9 years ago

2015-11-24 16:43:47: @abeham commented


r13365: fixed recreation of programmable problem's encoding

HeuristicLab-Trac-Bot commented 9 years ago

2015-11-24 16:48:29: @mkommend commented


r13366: Adapted PermutationEncoding and TSP.

HeuristicLab-Trac-Bot commented 9 years ago

2015-11-24 17:22:55: @mkommend commented


r13372: Fixed all problems.

HeuristicLab-Trac-Bot commented 9 years ago

2015-11-24 17:27:53: @abeham commented


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

HeuristicLab-Trac-Bot commented 9 years ago

2015-11-24 17:28:47: @abeham commented


r13374: removed obsolete file

HeuristicLab-Trac-Bot commented 9 years ago

2015-11-24 17:44:42: @abeham commented


r13376: working on refactoring

HeuristicLab-Trac-Bot commented 9 years ago

2015-11-24 17:44:55: @mkommend commented


r13377: Added missing interfaces to problems.

HeuristicLab-Trac-Bot commented 9 years ago

2015-11-24 17:51:08: @abeham commented


r13380: updated categories, template

HeuristicLab-Trac-Bot commented 9 years ago

2015-11-24 17:58:46: @abeham commented


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

HeuristicLab-Trac-Bot commented 9 years ago

2015-11-24 18:22:46: @abeham commented


r13385: fixed plugin dependencies and updated samples

HeuristicLab-Trac-Bot commented 9 years ago

2015-11-24 18:43:24: @abeham commented


r13388:

  • Readded excluded views
  • Removed ProblemInstanceProviderView which was not referenced in the project file
  • Fixed plugin dependency
HeuristicLab-Trac-Bot commented 9 years ago

2015-11-24 19:15:33: @abeham commented


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

HeuristicLab-Trac-Bot commented 9 years ago

2015-11-25 16:23:05: @abeham commented


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 of some changes that would be welcomed
HeuristicLab-Trac-Bot commented 9 years ago

2015-11-25 16:23:05: @abeham

HeuristicLab-Trac-Bot commented 9 years ago

2015-11-25 23:25:11: @abeham commented


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)
HeuristicLab-Trac-Bot commented 9 years ago

2015-11-26 08:16:54: @abeham commented


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.

HeuristicLab-Trac-Bot commented 9 years ago

2015-11-26 09:31:03: @abeham commented


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
HeuristicLab-Trac-Bot commented 9 years ago

2015-11-26 09:56:41: @abeham commented


r13405: Implemented SchafferF6 test function

HeuristicLab-Trac-Bot commented 9 years ago

2015-11-26 15:54:42: @abeham edited the issue description

HeuristicLab-Trac-Bot commented 9 years ago

2015-11-26 15:55:32: @abeham edited the issue description

HeuristicLab-Trac-Bot commented 9 years ago

2015-11-26 15:56:13: @abeham edited the issue description

HeuristicLab-Trac-Bot commented 9 years ago

2015-11-26 16:50:47: @mkommend edited the issue description

HeuristicLab-Trac-Bot commented 9 years ago

2015-11-26 17:38:30: @mkommend commented


r13408: Adapted unit tests in problem refactoring branch.

All compile, some fail:

  • SA Rastrigin example (missing move evaluators?)
  • LS Knapsack example
HeuristicLab-Trac-Bot commented 9 years ago

2015-11-26 17:38:30: @mkommend

HeuristicLab-Trac-Bot commented 9 years ago

2015-11-26 17:38:30: @mkommend

HeuristicLab-Trac-Bot commented 9 years ago

2015-11-26 17:38:30: @mkommend

HeuristicLab-Trac-Bot commented 9 years ago

2015-11-30 15:13:14: @mkommend commented


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

HeuristicLab-Trac-Bot commented 9 years ago

2015-11-30 15:20:11: @mkommend edited the issue description

HeuristicLab-Trac-Bot commented 8 years ago

2015-12-04 10:35:28: @mkommend commented


r13435: Intermediate version of schedule encoding refactoring.

HeuristicLab-Trac-Bot commented 8 years ago

2015-12-04 11:58:08: @mkommend commented


r13436: Minor improvements in SchedulingEncoding.

HeuristicLab-Trac-Bot commented 8 years ago

2015-12-06 15:34:45: @mkommend commented


r13437: Added encodings for schedules.

HeuristicLab-Trac-Bot commented 8 years ago

2015-12-06 15:34:45: @mkommend