GAs using real encoding: Optimization of real functions

From JCLEC wiki
Jump to: navigation, search

The problem proposed here is to find the global optimum of 3 functions. Each function will be minimized in two different domains for variable <math>x</math>. Their description and representation; first represents the Sphere function, then the Rastrigin function, and finally the Ackley function) are shown below:

Name Definition Domain
Spehere <math>f_{1}(x)=\Sigma_{i=1}^{p}x_{i}^{2}</math> [0,5.12]
Rastrigin <math>f_{2}(x)=\Sigma_{i=1}^{p}(x_{i}^{2}-10\cos(2\pi x_{i})+10)</math> [0,5.12]
Ackley <math>f_{3}(x)=e-20exp(-0.2\sqrt{\frac{1}{p}\Sigma_{i=1}^{p}x_{i}^{2}})-exp(\frac{1}{p}\Sigma_{t=1}^{p}\cos(2\pi x_{t}))</math> [0,5.12]

Example

Download and run the optimization of real functions problem

java -jar jclec4-tutorial.jar Spehere.cfg
java -jar jclec4-tutorial.jar Rastrigin.cfg
java -jar jclec4-tutorial.jar Ackley.cfg

Output

Sphere

Generation 500 Report

Best individual: net.sf.jclec.realarray.RealArrayIndividual[genotype={2.3737E-24,3.8939E-22,0.0,1.5033E-23,1.7181E-23},fitness=net.sf.jclec.fitness.SimpleValueFitness[value=1.52157E-43]]
Worst individual: net.sf.jclec.realarray.RealArrayIndividual[genotype={5.12,5.12,7.7897E-22,1.6406E-23,2.2283E-23},fitness=net.sf.jclec.fitness.SimpleValueFitness[value=52.4288]]
Median individual: net.sf.jclec.realarray.RealArrayIndividual[genotype={2.7875E-24,3.8987E-22,7.3608E-22,1.6565E-23,2.0726E-23},fitness=net.sf.jclec.fitness.SimpleValueFitness[value=6.9452E-43]]

Average fitness = 2.0971
Fitness variance = 64.3214

Rastrigin

Generation 500 Report

Best individual: net.sf.jclec.realarray.RealArrayIndividual[genotype={2.9614E-10,2.8308E-10,0.0,3.1017E-10,0.0},fitness=net.sf.jclec.fitness.SimpleValueFitness[value=0.0]]
Worst individual: net.sf.jclec.realarray.RealArrayIndividual[genotype={5.12,5.12,0.0,3.0395E-10,0.0},fitness=net.sf.jclec.fitness.SimpleValueFitness[value=57.8494]]
Median individual: net.sf.jclec.realarray.RealArrayIndividual[genotype={2.9618E-10,2.9041E-10,0.0,3.0382E-10,0.0},fitness=net.sf.jclec.fitness.SimpleValueFitness[value=0.0]]

Average fitness = 2.0247
Fitness variance = 71.1979

Ackley

Generation 500 Report

Best individual: net.sf.jclec.realarray.RealArrayIndividual[genotype={1.5216E-17,5.5467E-17,0.0,0.0,1.3730E-16},fitness=net.sf.jclec.fitness.SimpleValueFitness[value=-4.4408E-15]]
Worst individual: net.sf.jclec.realarray.RealArrayIndividual[genotype={5.12,5.12,0.0,0.0,1.3722E-16},fitness=net.sf.jclec.fitness.SimpleValueFitness[value=49.0682]]
Median individual: net.sf.jclec.realarray.RealArrayIndividual[genotype={1.5248E-17,5.7171E-17,0.0,0.0,1.3733E-16},fitness=net.sf.jclec.fitness.SimpleValueFitness[value=-4.4408E-15]]

Average fitness = 1.9890
Fitness variance = 76.2476

For further information see the Optimization of real functions Wiki