Free cookie consent management tool by TermsFeed Policy Generator

Changes between Version 2 and Version 3 of Documentation/DevelopmentCenter/ImplementAnEvaluator


Ignore:
Timestamp:
07/17/14 16:10:16 (10 years ago)
Author:
ascheibe
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • Documentation/DevelopmentCenter/ImplementAnEvaluator

    v2 v3  
    4949
    5050
    51 An evaluator is just a normal HL operator that implements at least either ISingleObjectiveEvaluator or IMultiObjectiveEvaluator.
    52 This is important as an evaluator should at least have a QualityParameter that is used for returning the result.
    53 Normally, as evaluators are problem-specific, there are problem specific interfaces and may also base-classes.
    54 So in this example, we therefore have the IOneMaxEvaluator. But if you have e.g. a look at the test-functions problem, you can see that there is a base-class (SingleObjectiveTestFunctionProblemEvaluator) that you should use.
     51An evaluator is just a normal HL operator that implements at least either `ISingleObjectiveEvaluator` or `IMultiObjectiveEvaluator`.
     52This is important as an evaluator must have a `QualityParameter` that is used for returning the result.
     53Normally, as evaluators are problem-specific, there are problem-specific interfaces and may also base-classes.
     54So in this example, we have the `IOneMaxEvaluator`. But if you have e.g. a look at the test-functions problem, you can see that there is a base-class (`SingleObjectiveTestFunctionProblemEvaluator`) that you should use.
    5555To find out which interface/base-class to use you have to look at the source of the problem you want to work with.
    5656
    57 Operators in HL normally inherit from InstrumentedOperator to give users the ability to add other operators to an operator for pre- and post processing tasks.
     57Operators in HL normally inherit from `InstrumentedOperator` to give users the ability to add other operators to an operator for pre- and post processing tasks.
    5858
    59 The evaluator has two parameters: The before-mentioned Quality parameter and the BinaryVector parameter.
    60 The second one is again problem specific. If you think again of test functions, this would not be of type BinaryVector but RealVector.
    61 The name of this parameter, now in this case the same as the type name.
    62 Now how the solutions are then really called in the scopes is set by the problem and may be different for every problem.
    63 Normally the problem looks up all operators and tells them this name. This may not work for operators that you add after you created a new problem in HL, so always check if the parameters of your evaluator are correctly named an set it otherwise yourself.
     59The evaluator has two parameters: The before-mentioned `Quality` parameter and the `BinaryVector` parameter.
     60The second one is again problem specific. If you think again of test functions, this would not be of type `BinaryVector` but `RealVector`.
     61So these are the names how the parameters are called. Now how the solutions are really called in the scopes is set by the problem and may be different for every problem.
     62Normally, the problem looks up all operators and tells them the real (actual) name.
     63You have to be cautions here as this may not work for operators that you add after you created a new problem in HL, so always check if the parameters of your evaluator are correctly named an set and otherwise set them yourself.
    6464If you want to find out for a problem how it calls solutions, you can just select the solution creator and click the "Show hidden parameters" button.
    6565So e.g. in the test-function problem the solution is called "Point", in the TSP it's called "TSPTour" and in OneMax the solution is called "OneMaxSolution" and the Quality value "NumberOfOnes".
     
    6767Evaluators get applied to scopes by the algorithm. All HL operators work on scopes. Scopes are just containers for data (e.g. the quality value and solution vector) and are organized in an hierarchical manner.
    6868And parameters are used to access the values in these scopes.
    69 You can use for example the Debug Engine and check a "Breakpoint" on the evaluator parameter to get a visualization how this looks like:
     69You can use e.g. the Debug Engine and check "Breakpoint" on the evaluator parameter to get a visualization of how this looks like:
    7070
    7171[[Image(scopes.jpg)]]
    7272
    7373
    74 Here you can see all the scopes, each containing the solution and, if they were already evaluated, the quality value named as discussed before.
    75 So if the evaluator was configured with the correct names, it can look up the solution (first line in InstrumentedApply()), compute it's quality value and return it by setting the quality parameter.
     74Here you can see all the scopes, each containing the solution and, if they were already evaluated, the quality value named as discussed before.  
     75So if the evaluator was configured with the correct names, it can look up the solution (first line in InstrumentedApply()) through the `BinaryVector` parameter, compute the quality value and return it by setting the quality parameter.
    7676
    7777