-
Notifications
You must be signed in to change notification settings - Fork 6
Configuration
In this section we will explain how to create a configuration file to be used in the JEAF framework. Here you can download a basic template of this configuration file, which should be filled out as we explain in the following sections.
### Evolutionary Algorithm tagThis is the root tag of the file, which contains all the sub-tags that configure the whole Evolutionary algorithm. All these subtags, except the LogTool subtag, are mandatory.
<EvolutionaryAlgorithm>
<Class></Class>
<UseRandomInitPopulation></UseRandomInitPopulation>
<FitnessHistoryCapacity></FitnessHistoryCapacity>
<Comparator></Comparator>
<EvaluationStrategy>
<!-- ... -->
</EvaluationStrategy>
<Population>
<!-- ... -->
</Population>
<OperatorChains>
<!-- ... -->
</OperatorChains>
<Objective>
<!-- ... -->
</Objective>
<StopTests>
<!-- ... -->
</StopTests>
<LogTool>
<!-- ... -->
</LogTool>
</EvolutionaryAlgorithm>
The tag Class indicates the specific Evolutionary Algorithm class used and the tag Comparator indicates the comparator which will be used to compare the individuals of the population. For instance, if we are solving a maximization problem, the comparator will be the MaximizingFitnessComparator class. These two tags should be indicated by using the fully qualified name of the class (for instance, es.udc.gii.common.eaf.algorithm.fitness.comparator.MaximizingFitnessComparator).
The tags UseRandomInitPopulation and FitnessHistoryCapacity are not mandatory. The first one takes a boolean value to indicate if the initial population is set by the user (false value) or if it will be randomly generated (true value). By default, it take true value. The second one takes an integer value that indicates the size of the fitness history archive, the default value is -1 which indicates that not fitness history will be stored.
If the Evoluationary Algorithm class has specific configuration parameters, they should be indicated after the Comparator tag.
### Evaluation Strategy tagThis tag is used to configure the evaluation strategy. Currently, there are two evaluation strategies implemented in the framework: a serial evaluation strategy and a distributed evaluation strategy. The evaluation strategy also includes the support for handling constrained problems, so if it is necessary to use a constraint handling method, it should be configured in this tag.
<EvaluationStrategy>
<Class></Class>
<!-- ... -->
<ConstraintMethod>
<Class></Class>
<!-- ... -->
</ConstraintMethod>
</EvaluationStrategy>
The only mandatory tag is the Class tag of the evaluation strategy, which indicates the specific evaluation strategy class used. If the evaluation strategy class has specific configuration parameters, they should be indicated after the Class tag.
If the user is solving a constrained problem, the evaluation strategy is the responsible of managing the constraints. To do that, the evaluation strategy uses a constraint handling method that is configured with the ConstraintMethod tag.
### Population tagThis tag configures the population of the algorithm. In this tag the user should indicate the size of the population (Size tag) and the configuration of each individual of the population. There are several classes of an individual in this framework, so the user should indicate the specific class in the tag Class of the Individual tag. As the individual can be made up by several chromosomes, each chromosome is configured by a Chromosome tag where the user indicates the size with the attribute size.
Again, if the individual has specific parameters, they should be indicated after the Chromosome tag.
<Population>
<Size></Size>
<Individual>
<Class></Class>
<Chromosome size=""></Chromosome>
<!-- ... -->
</Individual>
</Population>
The user should configure the operator chains used by the algorithm (i.e., selection chain, reproduction chain, evaluation chain and replace chain), although none of them are mandatory.
<OperatorChains>
<SelectionChain>
<Operator>
<Class></Class>
<!-- ... -->
</Operator>
<!-- ... -->
</SelectionChain>
<ReproductionChain>
<!-- ... -->
</ReproductionChain>
<EvaluationChain>
<!-- ... -->
</EvaluationChain>
<ReplaceChain>
<!-- ... -->
</ReplaceChain>
</OperatorChains>
The configuration of each chain is carried out always in the same way. Each chain is made up by one or more operators that are configured in this tag. The Operator tag should indicate the class of the operator and the specific configuration operator of this operator, if they exist. If some of the chains do not have operators, the tag of the chain does not appear in the configuration file.
### Objective tagThis tag is the responsible for configuring the problem to be solved. This problem is made up by one or more objective functions (single or multiobjective problem) and zero or more constraint functions (unconstrained or constrained problem).
<Objective>
<CheckBounds>
<ObjectiveFunction>
<Class></Class>
<!-- ... -->
</ObjectiveFunction>
<Constraint>
<Class></Class>
<!-- ... -->
</Constraint>
</Objective>
The first tag ( CheckBounds ) is used to indicate if there exist bound constraints or not (i.e., if the genes are bounded or not). If this tag does not exist, then the value is set to false. After this tag, the user indicates the list of objective functions that the algorithm has to solve. Each objective function has a mandatory tag, the Class tag. After this tag, if the objective function needs specific parameters, they should be indicated after the Class tag.
If the user is solving a constrained problem, the constraints are configured here after the list of objective functions. The constraint functions are configured in the same way as the objective functions. First of all, the Class tag indicates the class of the constraint, and after this tag the specific parameters are specified, if they exist.
### Stop Tests tagThe stopping criterion of the algorithm is configured in the StopTest tag. Here the user could configure one or more stopping criteria. Each of them is configured indicating its class in the Class tag and, after this tag, the specific parameters of each test if it is necessary.
<StopTests>
<StopTest>
<Class></Class>
<!-- ... -->
</StopTest>
<!-- ... -->
</StopTests>
This tag is the only one that is not mandatory: if the user does not need any log tool, this tag does not appear. This tag is used to configure the log tools used to record the data generated by the algorithm while is running. Currently, there are several log tools implemented in the framework. A list and an explanation of each of them could be found here. Each log tool is configured as follows:
<LogTool>
<Log>
<Class></Class>
<Folder></Folder>
<Name></Name>
<!-- ... -->
</Log>
<!-- ... -->
</LogTool>
The Class tag indicates the class of the log tool, the Folder tag is the folder where the user wants to save the output of this log and Name is the name of the log tool. Some patterns can be used to generate the folder and the log file name and they are explained in the log tool section ([here](Log Tool Configuration)). If the log tool needs configuration parameters, each of them should be indicated after the Name tag