Minor crossover updates

This commit is contained in:
Marcel Kronfeld 2011-05-04 12:15:52 +00:00
parent 9e05736bd3
commit c79eb33bca
2 changed files with 13 additions and 4 deletions

View File

@ -7,6 +7,11 @@ import eva2.server.go.problems.InterfaceOptimizationProblem;
import eva2.tools.math.RNG; import eva2.tools.math.RNG;
/** /**
* The children are randomized intermediate combinations of the parents,
* namely c[i]=Sum_j (r_i * p_ji)
* where r_i are uniform random numbers normed to the sum of one and
* p_ji is the i-th component of parent j.
*
* Created by IntelliJ IDEA. * Created by IntelliJ IDEA.
* User: streiche * User: streiche
* Date: 25.07.2003 * Date: 25.07.2003
@ -75,7 +80,7 @@ public class CrossoverESArithmetical implements InterfaceCrossover, java.io.Seri
// write the result back // write the result back
for (int i = 0; i < result.length; i++) ((InterfaceESIndividual)result[i]).SetDGenotype(children[i]); for (int i = 0; i < result.length; i++) ((InterfaceESIndividual)result[i]).SetDGenotype(children[i]);
} }
//in case the crossover was successfull lets give the mutation operators a chance to mate the strategy parameters //in case the crossover was successful lets give the mutation operators a chance to mate the strategy parameters
for (int i = 0; i < result.length; i++) result[i].getMutationOperator().crossoverOnStrategyParameters(indy1, partners); for (int i = 0; i < result.length; i++) result[i].getMutationOperator().crossoverOnStrategyParameters(indy1, partners);
//for (int i = 0; i < result.length; i++) System.out.println("After Crossover: " +result[i].getSolutionRepresentationFor()); //for (int i = 0; i < result.length; i++) System.out.println("After Crossover: " +result[i].getSolutionRepresentationFor());
return result; return result;

View File

@ -1,9 +1,6 @@
package eva2.server.go.operators.crossover; package eva2.server.go.operators.crossover;
import javax.swing.*;
import eva2.gui.Plot;
import eva2.server.go.individuals.AbstractEAIndividual; import eva2.server.go.individuals.AbstractEAIndividual;
import eva2.server.go.individuals.InterfaceESIndividual; import eva2.server.go.individuals.InterfaceESIndividual;
import eva2.server.go.populations.Population; import eva2.server.go.populations.Population;
@ -11,6 +8,13 @@ import eva2.server.go.problems.InterfaceOptimizationProblem;
import eva2.tools.math.RNG; import eva2.tools.math.RNG;
/** /**
* The flat crossover inits values randomly within the extreme values of
* all parents, namely
* c[i]=rand(min_j(p_ij), max_j(p_ij)).
*
* where c[i] is the i-th child component and p_ij is the i-th component
* of parent j.
*
* Created by IntelliJ IDEA. * Created by IntelliJ IDEA.
* User: streiche * User: streiche
* Date: 02.12.2003 * Date: 02.12.2003