Changes between Version 14 and Version 15 of Documentation/Howto/OptimizeExternalApplications
- Timestamp:
- 06/08/10 09:58:50 (14 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Documentation/Howto/OptimizeExternalApplications
v14 v15 244 244 [[Image(Tutorial_MessageBuilder.png)]] 245 245 246 As you can see there are a number of different converters. These are used to transform the value found in the scope to a variable of a !SolutionMessage. This message is in turn sent to the external process, so here we can influence how our solution objects are represented in the solution message. When you define a new !ExternalEvaluationValuesCollector these are the default converters that are preselected. They will transform any type that is available in !HeuristicLab.Data and also derived types. Our representation is a !RealVector object which lives in the !HeuristicLab.Encodings. RealVectorEncoding namespace. Let's take a look at the class definition ofRealVector:246 As you can see there are a number of different converters. These are used to transform the value found in the scope to a variable of a !SolutionMessage. This message is in turn sent to the external process, so here we can influence how our solution objects are represented in the solution message. When you define a new !ExternalEvaluationValuesCollector these are the default converters that are preselected. They will transform any type that is available in !HeuristicLab.Data and also derived types. Our representation is a !RealVector object which lives in the !HeuristicLab.Encodings.!RealVectorEncoding namespace. Let's take a look at the class definition of !RealVector: 247 247 {{{#!C 248 248 public class RealVector : DoubleArray … … 262 262 [[Image(Tutorial_ConfigureExternalEvaluator2.png)]] 263 263 264 If we now switch back to the Parameters tab, we can also see that there is a RealVector parameter there. All parameters that we add to the "Collected Values" appear also under Parameters.264 If we now switch back to the Parameters tab, we can also see that there is a !RealVector parameter there. All parameters that we add to the "Collected Values" appear also under Parameters. 265 265 266 266 Next in the configuration of the problem and right below the Evaluator we can see another parameter called '''Maximization'''. This tells the algorithm wether it should attempt to increase the quality value (if Maximization = true) or decrease it otherwise. From the possible fitness values we obtain from the simulator there's top speed and distance which we likely want to increase and damage which we want to decrease. Overall, because the !ExternalEvaluationProblem is a single objective problem we have to calculate a single fitness value and it's likely that we want to maximize distance, so we set this to true here. 267 267 268 268 [[Image(Tutorial_Maximization.png)]] 269 270 We can change this parameter also at any later time. 271 272 ==== Configuring the operators ==== 273 274 So let's add some Operators that we can get a !GeneticAlgorithm going. Click the Operators parameter right below the Maximization parameter and again we see a list with one operator already present. 275 276 [[Image(Tutorial_OperatorsList.png)]] 277 278 The !BestScopeSolutionAnalyzer is a generic analyzer operator that will output the best found solution so far as a result of the algorithm. You can examine its parameters, but there should be no reason to change. Note however, that it expects a variable "Quality" so if you renamed that parameter in the Evaluator you also have to set the corresponding //Actual Name// here. 279 280 What we want to do is add some operators for crossover and mutation of our real vector. So we click the yellow plus icon and open the !HeuristicLab.Encodings.!RealVectorEncoding namespace. We can select from the many crossover and manipulation (mutation) operators. For example add a !DiscreteCrossover, a !BlendAlphaBetaCrossover, and a !SimulatedBinaryCrossover. Click all of them to examine their parameters. Some operators have parameters that can configure their behavior. Make sure that each of their Child and Parents parameters has its Actual Name set to !RealVector. The parents are !RealVectors and the children are also again called !RealVector. If you look at the !BlendAlphaBetaCrossover you can see that you can also set the values for Alpha and Beta which determines to which extent the offspring should be closer to the better parent. If you double click the description of this crossover you can also see that in a new window and you see the publication that describes this crossover. 281 282 Let's also add a manipulator and let's take a !UniformOnePositionManipulator, also examine its paremeters. 283 284 [[Image(Tutorial_ConfigureOperators.png)]]