USE(2)
USE(2)
AbEC - Configuration Files
<< >>
< [ Home ] < 1. [ Use ] > 2. [ Configuration files ] >> 2.1 [ Algorithm File ] >> 2.2 [ Experiment File ] >> 2.3 [ Problem File ] > 3. [ Fitness function ] > 4. [ Running ] > 5. [ Results ] > 6. [ Example ] > 7. [ Adding new components ]
[~]$ Configuration files
As a default configuration, the parametrization of the expConfig.ini and problemConfig.ini files showed in the below explanation is used. This means that if any these configuration files is not found, the default configuration of their will be used.

In that way, the only mandatory file is the algoConfig.ini.

When editing the configurations file, you just need to include the parameters that you want to set, the others are set by default. For the boolean configurations (bool), unless the opposite is said, 1 means enabled and 0 means disabled.

> algoConfig.ini

This is the main configuration file, where we are going to set which optimizers, components and hyper-parameters, that it will compose our algorithm. Below it is the entire file and a description of each line and how to set it (in this file, for example, it is configured the algorithm Particle Swarm Optimization, known as PSO). > [ file ]


{
"__COMMENT__": "BASIC CONFIGURATION",
"ALGORITHM": "PSO", -> Name you want to give the algorithm. (char)
"POPSIZE": 50, -> Number of individuals in the population. If there are more than one population, this number applies for each subpopulation. (int)
"MIN_POS": -10, -> Min value of the search space. (int)
"MAX_POS": 10, -> Max value of the search space. (int)
"__COMMENT__": "OPTIMIZER CONFIGURATION",
"GA_POP_PERC": 0, -> Percentage of the individuals in the population that it will perform the Genetic Algorithm (GA). (float) in [0, 1]
"GA_ELI_PERC": 0.2, -> Hyper-parameter percentage of the elit in the GA population. (float) in [0, 1]
"GA_CROSS_PERC": 1, -> Hyper-parameter percentage of the population to consider in GA population when applies the crossover. (float) in [0, 1]
"GA_MUT_PERC": 0.1, -> Hyper-parameter probability of the mutation in the GA population. (float) in [0, 1]
"GA_MUT_STD": 1, -> Hyper-parameter standard deviation of the normal distribution used in the mutation. (float) in ]0, MAX_POS-MIN_POS]
"GA_ENCODER": 0, -> Use encoder in the GA individuals. If used, the values of the individuals will be converted into binary and the operators will apply in the bit level. (bool)
"GA_INDSIZE": 16, -> If using encoder, the size of the individuals, number of bits to represent each dimension. (int) in [1, 64]
"PSO_POP_PERC": 1, -> Percentage of the individuals in the population that it will perform the Particle Swarm Optimization (PSO). (float) in [0, 1]
"PSO_PHI1": 2.05, -> Hyper-parameter σ1 of the PSO. (float) in [0, 10]
"PSO_PHI2": 2.05, -> Hyper-parameter σ2 of the PSO. (float) in [0, 10]
"PSO_W": 0.729, -> Hyper-parameter ω of the PSO. (float) in [0, 10]
"PSO_MIN_VEL": -10, -> Min value of the speed of the PSO individuals. (float) in [-(MAX_POS-MIN_POS), MAX_POS-MIN_POS]
"PSO_MAX_VEL": 10, -> Max value of the speed of the PSO individuals. (float) in [-(MAX_POS-MIN_POS), MAX_POS-MIN_POS]
"DE_POP_PERC": 0, -> Percentage of the individuals in the population that it will perform the Differential Evolution (DE). (float) in [0, 1]
"DE_F": 0.5, -> Hyper-parameter F of the DE. (float) in [0, 10]
"DE_CR": 0.7, -> Hyper-parameter CR of the DE. (float) in [0, 10]
"ES_POP_PERC": 0, -> Percentage of the individuals in the population that it will perform Evolutionary Strategy (ES). (float) in [0, 1]
"ES_RCLOUD": 0.2, -> Hyper-parameter rcloud of the ES. (float) in ]0, MAX_POS-MIN_POS]
"__COMMENT__": "COMPONENTS CONFIGURATION",
"COMP_CHANGE_DETECT": 0, -> Change detection component. (bool)
"COMP_CHANGE_DETECT_MODE": 0, -> Change detection mode: 0 - External trigger; 1 - Reevaluation. (int) in [0, 1]
"COMP_MULTIPOP": 0, -> Multipopulation component. (bool)
"COMP_MULTIPOP_N": 10, -> Hyper-parameter number of subpopulations of the Multipopulation component. (int) > 1
"COMP_MUT": 0, -> Mutation component. (bool)
"COMP_MUT_PERC": 0.05, -> Hyper-parameter probability of the mutation in the population. (float) in [0, 1]
"COMP_MUT_ELI": 0.5, -> Hyper-parameter percentage of elit individuals to consider in the mutation component. (float) in [0, 1[
"COMP_MUT_STD": 0.1, -> Hyper-parameter standard deviation of the normal distribution used in the mutation component. (float) in ]0, MAX_POS-MIN_POS]
"COMP_EXCLUSION": 0, -> Exclusion component. (bool)
"COMP_EXCLUSION_REXCL": 22.9, -> Hyper-parameter exclusion radio (rexcl) of the Exclusion component. (float) in ]0, MAX_POS-MIN_POS]
"COMP_ANTI_CONVERGENCE": 0, -> Anti-convergence component. (bool)
"COMP_ANTI_CONVERGENCE_RCONV": 39.7, -> Hyper-parameter anti-convergence radius (rconv) of the Anti-convergece component. (float) in ]0, MAX_POS-MIN_POS]
"COMP_LOCAL_SEARCH": 0, -> Local-search component. (bool)
"COMP_LOCAL_SEARCH_ETRY": 20, -> Hyper-parameter number of tries (Etry) of the Local-search component. (int) > 0
"COMP_LOCAL_SEARCH_RLS": 1 -> Hyper-parameter local search radius (rls) of the Local-search component. (float) in ]0, MAX_POS-MIN_POS]
}

> expConfig.ini

This file is used to setup the framework configuration, like, the metrics to be calculated, number of runs and etc. Below it is the entire file and a description of each line and how to set it. > [ file ]


{
"__COMMENT__": "FRAMEWORK CONFIGURATION",
"RUNS": 5, -> Number of runs. (int) > 0
"FINISH_RUN_MODE": 0, -> Mode to finish the run. 0 - Fixed-budget, finish when achieve a fixed number of evaluations (int) in [0, 1]; 1 - Fixed-target, run until achieve a error less than a fixed target. (float) > 0
"FINISH_RUN_MODE_VALUE": 1000, -> Number of evaluation if FINISH_RUN_MODE = 1 (int) > 1; Target error if FINISH_RUN_MODE = 1 (float) > 0.
"SEED": 42, -> The seed for the runs. (float)
"PARALLELIZATION": 1, -> Enable/disable the parallelization of the runs (bool)
"NPROCESS": "AUTO", -> Number of process when parallelization is enabled. AUTO - 2/3 of the cores, "MAX" - all the cores, N (int) in [1, NCORES]
"LOG_ALL": 0, -> Put all individuals data of a run in a file. (bool)
"TERMINAL_OUTPUT": 1, -> Print the output in the terminal. (bool)
"DEBUG_RUN": 1, -> Debug in run level. (bool)
"DEBUG_RUN2": 0, -> Debug in run level 2. (bool)
"DEBUG_GEN": 0, -> Debug in generation level. (bool)
"DEBUG_POP": 0, -> Debug in population level. (bool)
"DEBUG_IND": 0 -> Debug in individual level. (bool)
}

> problemConfig.ini

This file is used to setup the problem configuration, like the number of dimensions, if it is a dynamic problem and etc.
The framework provide some benchmarks problems for testing, using for this, the DEAP library. They are:

  • CIGAR
  • PLANE
  • SPHERE
  • ACKLEY
  • BOHACHEVSKY
  • GRIEWANK
  • H1
  • HIMMELBLAU
  • RASTRIGIN
  • ROSENBROCK
  • SCHAFFER
  • SCHEFEL
  • MPB
Below it is the entire file and a description of each line and how to set it. > [ file ]

{
"__COMMENT__": "PROBLEM CONFIGURATION",
"BENCHMARK": "CUSTOM", -> Name of the benchmark as it is in the list above. If you are going to use your own fitness function (see the next chapter), must put "NONE" here. (char)
"FUNCTION": "function.py", -> Name of the file containing the fitness function in the directory fitnessFunction. (char)
"NDIM": 2, -> Number of dimensions of the problem. (int) > 0
"CHANGES": 0, -> Changes in the environment, for dynamic problems. (bool)
"CHANGES_NEVALS": [5000, 10000, 15000], -> A list containing the number of the evaluations in which the environment should change. (list)
"SCENARIO_MPB": 2, -> Scenario to use in the MPB. (ind) in [1, 3]
"UNIFORM_HEIGHT_MPB": 0, -> Initial height of the peaks in the MPB. if 0 the height will be randomly choosed in the MPB. (int) in [0, 100]
"MOVE_SEVERITY_MPB": 1.5, -> The distance a single peak moves when peaks change in the MPB. (float) in ]0, 100]
"MIN_HEIGHT_MPB": 30, -> Minimum height of the peaks in the MPB. (float) in [0, 100]
"MAX_HEIGHT_MPB": 70, -> Maximum height of the peaks in the MPB. (float) in ]0, 100]
"MIN_WIDTH_MPB": 1, -> Minimum width of the peaks in the MPB. (float) in [0, 100]
"MAX_WIDTH_MPB": 12, -> Maximum width of the peaks in the MPB. (float) in ]0, 100]
"MIN_COORD_MPB": 0, -> Minimum coordinate for the centre of the peaks in the MPB. (float) in [0, 100]
"MAX_COORD_MPB": 100, -> Maximum coordinate for the centre of the peaks in the MPB. (float) in [0, 100]
"LAMBDA_MPB": 0.5 -> Correlation between changes in the MPB. (float) in [0, 100]
}

Be free to use this framework.
AbEC © 2023.