Free cookie consent management tool by TermsFeed Policy Generator

Changes between Version 10 and Version 11 of Documentation/Howto/OptimizeExternalApplications


Ignore:
Timestamp:
06/07/10 18:16:54 (14 years ago)
Author:
abeham
Comment:

update

Legend:

Unmodified
Added
Removed
Modified
  • Documentation/Howto/OptimizeExternalApplications

    v10 v11  
    124124=== Preparing an `ExternalEvaluationProblem` ===
    125125
    126 In the HeuristicLab Optimizer a number of algorithms and problems are available which can be created, viewed and parameterized. Among them is a special problem designed for the purpose of calling an external evaluation function called `ExternalEvaluationProblem`. The problem allows the user to define a customized solution representation, as well as customizing the operators that are available to solve the problem. The following screenshot shows the default parameters of this problem.
     126In the HeuristicLab Optimizer a number of algorithms and problems are available which can be created, viewed and parameterized. A problem in HeuristicLab consists of several parameters whose values describe the problem instance, but also consists of several operators. The two most important operators are the //Evaluator// which is used to evaluate a solution and the //SolutionCreator// which is used to create new solution configurations from scratch. Although solutions are usually created randomly, for some problem one might use certain heuristics and start with partly optimal solutions. Finally every problem also contains an //operator list// of operators that are known to work with the problem's solution representations. This list is usually hidden in many problems as the list is populated all by itself by discovering all operators that implement a certain interface for example.
     127
     128Among these problems, there is a special problem designed for the purpose of calling an external evaluation function called `ExternalEvaluationProblem`. The problem allows the user to define a customized solution representation, as well as configure the operator list with operators that are available to solve the problem. The following screenshot shows the default parameters of this problem.
    127129
    128130[[Image(ExternalEvaluationProblemParameters.png)]]
     
    158160 3. Follow the instructions in the excellent manual that you just downloaded to learn more about the problem situation and how to perform the setup
    159161
    160 Once you're done, you should get a latest copy of HeuristicLab 3.3 or build it from source using Visual Studio.
     162Once you're done, you should get a latest copy of HeuristicLab 3.3 and unzip it into a folder or [DevelopersManual#BuildSources build it from source] using Visual Studio.  We're now going to configure the problem in HeuristicLab and then take a look at the client and finally let it run.
     163
     164=== Configuring the Race Car Configuration Problem in HeuristicLab ===
     165
     166In the Optimizer we select New from the File menu and choose the '''External Evaluation Problem''' from the list of //Creatables// among which we find the section //Problems//. You may have to scroll down a little until you reach the Problems.
     167
     168[[Image(Tutorial_CreateNewExternalEvaluationProblem.png)]]
     169
     170Now we are presented with a new External Evaluation Problem such as we have seen in the architecture description above. It shall be shown here again.
     171
     172[[Image(ExternalEvaluationProblemParameters.png)]]
     173
     174So, first let's give the problem a proper name and a proper description so that when we load the problem later we know what this is all about.
     175 * In the title type "Race Car Configuration Problem (EvoStar 2010)"
     176 * In the description type "Problem that represents race car configuration challenge of EvoStar 2010"
     177
     178Now we want to configure the solution representation and for this purpose we click the operator called '''SolutionCreator''' and get following screen.
     179
     180[[Image(Tutorial_ConfigureSolutionCreator.png)]]
     181
     182We can examine the operators parameters by selecting the "Parameters" tab, and we will see that there is only a "Successor" parameter defined which is null. This parameter defines the next operator that would be executed after the !SolutionCreator, but we don't need to bother with this parameter in this case and switch back to the "Operators" tab. There is a button with a yellow plus icon that we're going to press.
     183
     184[[Image(Tutorial_TypeSelector.png)]]
     185
     186The type selector appears that has the ability to show every HeuristicLab object, but in this case, because the SolutionCreator exposes a list of only `IOperator`s we see a dialog with only operators to choose from. We're interested in creating our solution representation and given that our simulation model expects a vector of real values that describe the car's configuration, we will look into the '''HeuristicLab.Encodings.RealVectorEncoding''' namespace. Click on the "+" infront of that namespace to list all the available operators there.
     187
     188[[Image(Tutorial_TypeSelector_RealVectorEncoding.png)]]
     189
     190That is quite a list of operators, but don't get confused. From the names we can see what they are doing, there are several crossovers, manipulators, and a few other operators. Each of these operators has a description that you can see when you click onto it. The description is very helpful in describing what the operator does and there are even references to publications for operators that are taken from the literature. The one operator we are looking for to create a vector of real values is the '''UniformRandomRealVectorCreator'''. Look for it in the list down the bottom and click OK.
     191
     192[[Image(Tutorial_UniformRandomRealVectorCreator.png)]]
     193
     194Views are usually nested in each other and when you click on the operator you should see its view opening to the right. If you can't see the operator's details due to low screen resolution you can double click the operator and it will open in a completely new view and in a new tab next to the tab of the problem.
     195
     196What we have to do next is configure this operator. We see in the operators details that it has five parameters: Bounds, Length, Random, RealVector, and Successor. Like before we can ignore the Successor parameter, but the other 4 are interesting to us. You can click on any of these parameters to get a helpful description in the parameter's own view (which is nested again), you can also double click a parameter to open a view in a new tab. The Bounds parameter tells us that it represents "A 2 column matrix specifying the lower and upper bound for each dimension. If there are less rows than dimension the bounds vector is cycled." This is very helpful information indeed! We know, from reading the challenge's manual that the solution vector is bound in every dimension by 0 and 1 and now we have two choices. We could now click on the button with the pencil icon and create a new Bounds matrix directly in the parameter of this operator or we can set the //Actual Name// of this parameter to the name of the parameter that we create in a higher level. If we'd create the parameter directly in the parameter, other operators do not have access to it and because the Bounds are also needed in other operators like Crossover and Mutation it is a better idea to create the bounds matrix at the problem level.
     197
     198So we click the yellow plus icon in the parameters list of our problem (marked in the following screenshot).
     199
     200[[Image(Tutorial_CreateBounds.png)]]
     201
     202Again we see a dialog similar to the type selector.
     203
     204[[Image(Tutorial_TypeSelector_NewParameter.png)]]
     205
     206This time it is restricted to all kinds of `IParameter`s of which there are some in the !HeuristicLab.Parameters namespace. There are several kinds of parameters of which there are two important types:
     207 1. Lookup parameters
     208 2. Value parameters
     209
     210Lookup parameters do not have a value of their own, but rather search for this value in a higher scope. Value parameters on the other hand contain a value of their own and do not look for the value in a higher scope. The combination of the two is a !ValueLookupParameter that either has a value in which case it will not look in a higher scope or it does not have a value in which case it will look in a higher scope. So it's the best of the two worlds. Usually when a parameter can be either set directly or looked up a !ValueLookupParameter is well suited. The Bounds parameter for example of the solution creator is such a parameter. In this case however, we're at the problem scope and there's no higher scope so what we need is a new '''ValueParameter<T>'''. The <T> basically states that we have to define the type of the parameter and that we could make a parameter of IOperator for example or in our case, we need a '''ValueParameter<DoubleMatrix>'''. So we select the !ValueParameter, after which a new field becomes visible.
     211
     212
     213[[Image(Tutorial_TypeSelector_NewParameter2.png)]]