Rename init method to initialize and fix a bug for SBMLsimulator interop
This commit is contained in:
		@@ -2,6 +2,7 @@ package eva2.gui;
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
import eva2.EvAInfo;
 | 
					import eva2.EvAInfo;
 | 
				
			||||||
import eva2.optimization.modules.*;
 | 
					import eva2.optimization.modules.*;
 | 
				
			||||||
 | 
					import eva2.problems.InterfaceOptimizationProblem;
 | 
				
			||||||
import eva2.util.ClassPreloader;
 | 
					import eva2.util.ClassPreloader;
 | 
				
			||||||
import eva2.util.EvAComAdapter;
 | 
					import eva2.util.EvAComAdapter;
 | 
				
			||||||
import eva2.optimization.OptimizationStateListener;
 | 
					import eva2.optimization.OptimizationStateListener;
 | 
				
			||||||
@@ -775,7 +776,11 @@ public class Main extends JFrame implements OptimizationStateListener {
 | 
				
			|||||||
        ModuleAdapter newModuleAdapter = null;
 | 
					        ModuleAdapter newModuleAdapter = null;
 | 
				
			||||||
        //
 | 
					        //
 | 
				
			||||||
        try {
 | 
					        try {
 | 
				
			||||||
            newModuleAdapter = new GOModuleAdapter(selectedModule, OptimizationParameters.getInstance(), withGUI ? null : "EvA2");
 | 
					            InterfaceOptimizationParameters params = optimizationParameters;
 | 
				
			||||||
 | 
					            if (optimizationParameters == null) {
 | 
				
			||||||
 | 
					                params = OptimizationParameters.getInstance();
 | 
				
			||||||
 | 
					            }
 | 
				
			||||||
 | 
					            newModuleAdapter = new GOModuleAdapter(selectedModule, params, withGUI ? null : "EvA2");
 | 
				
			||||||
            //newModuleAdapter = comAdapter.getModuleAdapter(selectedModule, optimizationParameters, withGUI ? null : "EvA2");
 | 
					            //newModuleAdapter = comAdapter.getModuleAdapter(selectedModule, optimizationParameters, withGUI ? null : "EvA2");
 | 
				
			||||||
        } catch (Exception e) {
 | 
					        } catch (Exception e) {
 | 
				
			||||||
            LOGGER.log(Level.SEVERE, "Error loading module.", e);
 | 
					            LOGGER.log(Level.SEVERE, "Error loading module.", e);
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -120,7 +120,7 @@ public abstract class AbstractEAIndividual implements IndividualInterface, java.
 | 
				
			|||||||
    public void initCloneOperators(InterfaceMutation mutOp, double pMut, InterfaceCrossover coOp, double pCross, InterfaceOptimizationProblem problem) {
 | 
					    public void initCloneOperators(InterfaceMutation mutOp, double pMut, InterfaceCrossover coOp, double pCross, InterfaceOptimizationProblem problem) {
 | 
				
			||||||
        mutationProbability = pMut;
 | 
					        mutationProbability = pMut;
 | 
				
			||||||
        mutationOperator = (InterfaceMutation) mutOp.clone();
 | 
					        mutationOperator = (InterfaceMutation) mutOp.clone();
 | 
				
			||||||
        mutationOperator.init(this, problem);
 | 
					        mutationOperator.initialize(this, problem);
 | 
				
			||||||
        crossoverProbability = pCross;
 | 
					        crossoverProbability = pCross;
 | 
				
			||||||
        crossoverOperator = (InterfaceCrossover) coOp.clone();
 | 
					        crossoverOperator = (InterfaceCrossover) coOp.clone();
 | 
				
			||||||
        crossoverOperator.init(this, problem);
 | 
					        crossoverOperator.init(this, problem);
 | 
				
			||||||
@@ -277,7 +277,7 @@ public abstract class AbstractEAIndividual implements IndividualInterface, java.
 | 
				
			|||||||
     */
 | 
					     */
 | 
				
			||||||
    public void init(InterfaceOptimizationProblem opt) {
 | 
					    public void init(InterfaceOptimizationProblem opt) {
 | 
				
			||||||
        initializationOperator.initialize(this, opt);
 | 
					        initializationOperator.initialize(this, opt);
 | 
				
			||||||
        this.mutationOperator.init(this, opt);
 | 
					        this.mutationOperator.initialize(this, opt);
 | 
				
			||||||
        this.crossoverOperator.init(this, opt);
 | 
					        this.crossoverOperator.init(this, opt);
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -217,7 +217,7 @@ public class ESIndividualBinaryData extends AbstractEAIndividual implements Inte
 | 
				
			|||||||
            this.defaultInit(opt);
 | 
					            this.defaultInit(opt);
 | 
				
			||||||
            System.out.println("Initial value for ESIndividualBinaryData is no BitSet!");
 | 
					            System.out.println("Initial value for ESIndividualBinaryData is no BitSet!");
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
        this.mutationOperator.init(this, opt);
 | 
					        this.mutationOperator.initialize(this, opt);
 | 
				
			||||||
        this.crossoverOperator.init(this, opt);
 | 
					        this.crossoverOperator.init(this, opt);
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -271,7 +271,7 @@ public class ESIndividualDoubleData extends AbstractEAIndividual implements Inte
 | 
				
			|||||||
            this.defaultInit(opt);
 | 
					            this.defaultInit(opt);
 | 
				
			||||||
            System.out.println("Initial value for ESIndividualDoubleData is not double[]!");
 | 
					            System.out.println("Initial value for ESIndividualDoubleData is not double[]!");
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
        this.mutationOperator.init(this, opt);
 | 
					        this.mutationOperator.initialize(this, opt);
 | 
				
			||||||
        this.crossoverOperator.init(this, opt);
 | 
					        this.crossoverOperator.init(this, opt);
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -240,7 +240,7 @@ public class ESIndividualIntegerData extends AbstractEAIndividual implements Int
 | 
				
			|||||||
            this.defaultInit(opt);
 | 
					            this.defaultInit(opt);
 | 
				
			||||||
            System.out.println("Initial value for ESIndividualIntegerData is not int[]!");
 | 
					            System.out.println("Initial value for ESIndividualIntegerData is not int[]!");
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
        this.mutationOperator.init(this, opt);
 | 
					        this.mutationOperator.initialize(this, opt);
 | 
				
			||||||
        this.crossoverOperator.init(this, opt);
 | 
					        this.crossoverOperator.init(this, opt);
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -260,7 +260,7 @@ public class ESIndividualPermutationData extends AbstractEAIndividual implements
 | 
				
			|||||||
            this.defaultInit(opt);
 | 
					            this.defaultInit(opt);
 | 
				
			||||||
            System.out.println("Initial value for ESIndividualPermutationData is not int[]!");
 | 
					            System.out.println("Initial value for ESIndividualPermutationData is not int[]!");
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
        this.mutationOperator.init(this, opt);
 | 
					        this.mutationOperator.initialize(this, opt);
 | 
				
			||||||
        this.crossoverOperator.init(this, opt);
 | 
					        this.crossoverOperator.init(this, opt);
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -122,7 +122,7 @@ public class GAIndividualBinaryData extends AbstractEAIndividual implements Inte
 | 
				
			|||||||
            this.defaultInit(opt);
 | 
					            this.defaultInit(opt);
 | 
				
			||||||
            System.out.println("Initial value for GAIndividualBinaryData is no BitSet!");
 | 
					            System.out.println("Initial value for GAIndividualBinaryData is no BitSet!");
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
        this.mutationOperator.init(this, opt);
 | 
					        this.mutationOperator.initialize(this, opt);
 | 
				
			||||||
        this.crossoverOperator.init(this, opt);
 | 
					        this.crossoverOperator.init(this, opt);
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -252,7 +252,7 @@ public class GAIndividualDoubleData extends AbstractEAIndividual implements Inte
 | 
				
			|||||||
            this.defaultInit(opt);
 | 
					            this.defaultInit(opt);
 | 
				
			||||||
            System.out.println("Initial value for GAIndividualDoubleData is not double[]!");
 | 
					            System.out.println("Initial value for GAIndividualDoubleData is not double[]!");
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
        this.mutationOperator.init(this, opt);
 | 
					        this.mutationOperator.initialize(this, opt);
 | 
				
			||||||
        this.crossoverOperator.init(this, opt);
 | 
					        this.crossoverOperator.init(this, opt);
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -286,7 +286,7 @@ public class GAIndividualIntegerData extends AbstractEAIndividual implements Int
 | 
				
			|||||||
            this.defaultInit(opt);
 | 
					            this.defaultInit(opt);
 | 
				
			||||||
            System.out.println("Initial value for GAIndividualDoubleData is not double[]!");
 | 
					            System.out.println("Initial value for GAIndividualDoubleData is not double[]!");
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
        this.mutationOperator.init(this, opt);
 | 
					        this.mutationOperator.initialize(this, opt);
 | 
				
			||||||
        this.crossoverOperator.init(this, opt);
 | 
					        this.crossoverOperator.init(this, opt);
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -595,7 +595,7 @@ public class GEIndividualProgramData extends AbstractEAIndividual implements Int
 | 
				
			|||||||
            this.defaultInit(opt);
 | 
					            this.defaultInit(opt);
 | 
				
			||||||
            System.out.println("Initial value for GPIndividualDoubleData is no InterfaceProgram[]!");
 | 
					            System.out.println("Initial value for GPIndividualDoubleData is no InterfaceProgram[]!");
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
        this.mutationOperator.init(this, opt);
 | 
					        this.mutationOperator.initialize(this, opt);
 | 
				
			||||||
        this.crossoverOperator.init(this, opt);
 | 
					        this.crossoverOperator.init(this, opt);
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -240,7 +240,7 @@ public class GIIndividualIntegerData extends AbstractEAIndividual implements Int
 | 
				
			|||||||
            this.defaultInit(opt);
 | 
					            this.defaultInit(opt);
 | 
				
			||||||
            System.out.println("Initial value for GAIndividualDoubleData is not double[]!");
 | 
					            System.out.println("Initial value for GAIndividualDoubleData is not double[]!");
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
        this.mutationOperator.init(this, opt);
 | 
					        this.mutationOperator.initialize(this, opt);
 | 
				
			||||||
        this.crossoverOperator.init(this, opt);
 | 
					        this.crossoverOperator.init(this, opt);
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -241,7 +241,7 @@ public class GPIndividualProgramData extends AbstractEAIndividual implements Int
 | 
				
			|||||||
            this.defaultInit(opt);
 | 
					            this.defaultInit(opt);
 | 
				
			||||||
            System.out.println("Initial value for GPIndividualDoubleData is no InterfaceProgram[]!");
 | 
					            System.out.println("Initial value for GPIndividualDoubleData is no InterfaceProgram[]!");
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
        this.mutationOperator.init(this, opt);
 | 
					        this.mutationOperator.initialize(this, opt);
 | 
				
			||||||
        this.crossoverOperator.init(this, opt);
 | 
					        this.crossoverOperator.init(this, opt);
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -105,7 +105,7 @@ public class OBGAIndividualPermutationData extends AbstractEAIndividual implemen
 | 
				
			|||||||
            this.defaultInit(opt);
 | 
					            this.defaultInit(opt);
 | 
				
			||||||
            System.out.println("Initial value for OBGAIndividualBinaryData is no Permutation!");
 | 
					            System.out.println("Initial value for OBGAIndividualBinaryData is no Permutation!");
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
        this.mutationOperator.init(this, opt);
 | 
					        this.mutationOperator.initialize(this, opt);
 | 
				
			||||||
        this.crossoverOperator.init(this, opt);
 | 
					        this.crossoverOperator.init(this, opt);
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -23,7 +23,7 @@ public interface InterfaceMutation {
 | 
				
			|||||||
     * @param individual The individual that will be mutated.
 | 
					     * @param individual The individual that will be mutated.
 | 
				
			||||||
     * @param opt        The optimization problem.
 | 
					     * @param opt        The optimization problem.
 | 
				
			||||||
     */
 | 
					     */
 | 
				
			||||||
    public void init(AbstractEAIndividual individual, InterfaceOptimizationProblem opt);
 | 
					    public void initialize(AbstractEAIndividual individual, InterfaceOptimizationProblem opt);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    /**
 | 
					    /**
 | 
				
			||||||
     * This method will mutate a given AbstractEAIndividual. If the individual
 | 
					     * This method will mutate a given AbstractEAIndividual. If the individual
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -41,7 +41,7 @@ public class MutateDefault implements InterfaceMutation, java.io.Serializable {
 | 
				
			|||||||
     * @param opt        The optimization problem.
 | 
					     * @param opt        The optimization problem.
 | 
				
			||||||
     */
 | 
					     */
 | 
				
			||||||
    @Override
 | 
					    @Override
 | 
				
			||||||
    public void init(AbstractEAIndividual individual, InterfaceOptimizationProblem opt) {
 | 
					    public void initialize(AbstractEAIndividual individual, InterfaceOptimizationProblem opt) {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -108,10 +108,10 @@ public class MutateEAMixer implements InterfaceMutation, java.io.Serializable {
 | 
				
			|||||||
     * @param opt        The optimization problem.
 | 
					     * @param opt        The optimization problem.
 | 
				
			||||||
     */
 | 
					     */
 | 
				
			||||||
    @Override
 | 
					    @Override
 | 
				
			||||||
    public void init(AbstractEAIndividual individual, InterfaceOptimizationProblem opt) {
 | 
					    public void initialize(AbstractEAIndividual individual, InterfaceOptimizationProblem opt) {
 | 
				
			||||||
        InterfaceMutation[] mutators = this.mutationMixer.getSelectedMutators();
 | 
					        InterfaceMutation[] mutators = this.mutationMixer.getSelectedMutators();
 | 
				
			||||||
        for (int i = 0; i < mutators.length; i++) {
 | 
					        for (int i = 0; i < mutators.length; i++) {
 | 
				
			||||||
            mutators[i].init(individual, opt);
 | 
					            mutators[i].initialize(individual, opt);
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -96,7 +96,7 @@ public class MutateESCorrVector implements InterfaceMutation, java.io.Serializab
 | 
				
			|||||||
     * @param opt        The optimization problem.
 | 
					     * @param opt        The optimization problem.
 | 
				
			||||||
     */
 | 
					     */
 | 
				
			||||||
    @Override
 | 
					    @Override
 | 
				
			||||||
    public void init(AbstractEAIndividual individual, InterfaceOptimizationProblem opt) {
 | 
					    public void initialize(AbstractEAIndividual individual, InterfaceOptimizationProblem opt) {
 | 
				
			||||||
        double[] initVelocity = calcInitialVel(initialVelocity, ((InterfaceESIndividual) individual).getDoubleRange());
 | 
					        double[] initVelocity = calcInitialVel(initialVelocity, ((InterfaceESIndividual) individual).getDoubleRange());
 | 
				
			||||||
        individual.putData(vectorKey, initVelocity);
 | 
					        individual.putData(vectorKey, initVelocity);
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -10,7 +10,7 @@ import eva2.util.annotation.Description;
 | 
				
			|||||||
/**
 | 
					/**
 | 
				
			||||||
 */
 | 
					 */
 | 
				
			||||||
@Description("The local correlated mutation stores n sigmas for each double attribute and n(n-1) alphas.")
 | 
					@Description("The local correlated mutation stores n sigmas for each double attribute and n(n-1) alphas.")
 | 
				
			||||||
public class MutateESCorrolated implements InterfaceMutation, java.io.Serializable {
 | 
					public class MutateESCorrelated implements InterfaceMutation, java.io.Serializable {
 | 
				
			||||||
    protected double mutationStepSize = 0.2;
 | 
					    protected double mutationStepSize = 0.2;
 | 
				
			||||||
    protected double tau1 = 0.15;
 | 
					    protected double tau1 = 0.15;
 | 
				
			||||||
    protected double lowerLimitStepSize = 0.0000005;
 | 
					    protected double lowerLimitStepSize = 0.0000005;
 | 
				
			||||||
@@ -19,12 +19,12 @@ public class MutateESCorrolated implements InterfaceMutation, java.io.Serializab
 | 
				
			|||||||
    private double[] alphas = null;
 | 
					    private double[] alphas = null;
 | 
				
			||||||
    protected double tau2 = 0.15;
 | 
					    protected double tau2 = 0.15;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    public MutateESCorrolated() {
 | 
					    public MutateESCorrelated() {
 | 
				
			||||||
        this.sigmas = null;
 | 
					        this.sigmas = null;
 | 
				
			||||||
        this.alphas = null;
 | 
					        this.alphas = null;
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    public MutateESCorrolated(MutateESCorrolated mutator) {
 | 
					    public MutateESCorrelated(MutateESCorrelated mutator) {
 | 
				
			||||||
        if ((mutator.sigmas != null)) {
 | 
					        if ((mutator.sigmas != null)) {
 | 
				
			||||||
            this.sigmas = new double[mutator.sigmas.length];
 | 
					            this.sigmas = new double[mutator.sigmas.length];
 | 
				
			||||||
            System.arraycopy(mutator.sigmas, 0, this.sigmas, 0, this.sigmas.length);
 | 
					            System.arraycopy(mutator.sigmas, 0, this.sigmas, 0, this.sigmas.length);
 | 
				
			||||||
@@ -49,7 +49,7 @@ public class MutateESCorrolated implements InterfaceMutation, java.io.Serializab
 | 
				
			|||||||
     */
 | 
					     */
 | 
				
			||||||
    @Override
 | 
					    @Override
 | 
				
			||||||
    public Object clone() {
 | 
					    public Object clone() {
 | 
				
			||||||
        return new MutateESCorrolated(this);
 | 
					        return new MutateESCorrelated(this);
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    /**
 | 
					    /**
 | 
				
			||||||
@@ -63,8 +63,8 @@ public class MutateESCorrolated implements InterfaceMutation, java.io.Serializab
 | 
				
			|||||||
        if (mutator == this) {
 | 
					        if (mutator == this) {
 | 
				
			||||||
            return true;
 | 
					            return true;
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
        if (mutator instanceof MutateESCorrolated) {
 | 
					        if (mutator instanceof MutateESCorrelated) {
 | 
				
			||||||
            MutateESCorrolated mut = (MutateESCorrolated) mutator;
 | 
					            MutateESCorrelated mut = (MutateESCorrelated) mutator;
 | 
				
			||||||
            if (this.tau1 != mut.tau1) {
 | 
					            if (this.tau1 != mut.tau1) {
 | 
				
			||||||
                return false;
 | 
					                return false;
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
@@ -105,7 +105,7 @@ public class MutateESCorrolated implements InterfaceMutation, java.io.Serializab
 | 
				
			|||||||
     * @param opt        The optimization problem.
 | 
					     * @param opt        The optimization problem.
 | 
				
			||||||
     */
 | 
					     */
 | 
				
			||||||
    @Override
 | 
					    @Override
 | 
				
			||||||
    public void init(AbstractEAIndividual individual, InterfaceOptimizationProblem opt) {
 | 
					    public void initialize(AbstractEAIndividual individual, InterfaceOptimizationProblem opt) {
 | 
				
			||||||
        if (individual instanceof InterfaceESIndividual) {
 | 
					        if (individual instanceof InterfaceESIndividual) {
 | 
				
			||||||
            double[] x = ((InterfaceESIndividual) individual).getDGenotype();
 | 
					            double[] x = ((InterfaceESIndividual) individual).getDGenotype();
 | 
				
			||||||
            if (this.sigmas == null) {
 | 
					            if (this.sigmas == null) {
 | 
				
			||||||
@@ -140,7 +140,7 @@ public class MutateESCovarianceMatrixAdaption implements InterfaceMutation, java
 | 
				
			|||||||
     * @param opt        The optimization problem.
 | 
					     * @param opt        The optimization problem.
 | 
				
			||||||
     */
 | 
					     */
 | 
				
			||||||
    @Override
 | 
					    @Override
 | 
				
			||||||
    public void init(AbstractEAIndividual individual, InterfaceOptimizationProblem opt) {
 | 
					    public void initialize(AbstractEAIndividual individual, InterfaceOptimizationProblem opt) {
 | 
				
			||||||
        if (!(individual instanceof InterfaceESIndividual)) {
 | 
					        if (!(individual instanceof InterfaceESIndividual)) {
 | 
				
			||||||
            return;
 | 
					            return;
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -50,13 +50,13 @@ public class MutateESCovarianceMatrixAdaptionPlus extends
 | 
				
			|||||||
     * @param opt        The optimization problem.
 | 
					     * @param opt        The optimization problem.
 | 
				
			||||||
     */
 | 
					     */
 | 
				
			||||||
    @Override
 | 
					    @Override
 | 
				
			||||||
    public void init(AbstractEAIndividual individual,
 | 
					    public void initialize(AbstractEAIndividual individual,
 | 
				
			||||||
                           InterfaceOptimizationProblem opt) {
 | 
					                           InterfaceOptimizationProblem opt) {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        if (!(individual instanceof InterfaceESIndividual)) {
 | 
					        if (!(individual instanceof InterfaceESIndividual)) {
 | 
				
			||||||
            return;
 | 
					            return;
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
        super.init(individual, opt);
 | 
					        super.initialize(individual, opt);
 | 
				
			||||||
        psuccesstarget = 1.0 / (5 + Math.sqrt(lambda) / 2);
 | 
					        psuccesstarget = 1.0 / (5 + Math.sqrt(lambda) / 2);
 | 
				
			||||||
        psuccess = psuccesstarget;
 | 
					        psuccess = psuccesstarget;
 | 
				
			||||||
        stepd = 1.0 + D / (2.0 * lambda);
 | 
					        stepd = 1.0 + D / (2.0 * lambda);
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -57,7 +57,7 @@ public class MutateESFixedStepSize implements InterfaceMutation, java.io.Seriali
 | 
				
			|||||||
     * @param opt        The optimization problem.
 | 
					     * @param opt        The optimization problem.
 | 
				
			||||||
     */
 | 
					     */
 | 
				
			||||||
    @Override
 | 
					    @Override
 | 
				
			||||||
    public void init(AbstractEAIndividual individual, InterfaceOptimizationProblem opt) {
 | 
					    public void initialize(AbstractEAIndividual individual, InterfaceOptimizationProblem opt) {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -91,7 +91,7 @@ public class MutateESGlobal implements InterfaceMutation, java.io.Serializable,
 | 
				
			|||||||
     * @param opt        The optimization problem.
 | 
					     * @param opt        The optimization problem.
 | 
				
			||||||
     */
 | 
					     */
 | 
				
			||||||
    @Override
 | 
					    @Override
 | 
				
			||||||
    public void init(AbstractEAIndividual individual, InterfaceOptimizationProblem opt) {
 | 
					    public void initialize(AbstractEAIndividual individual, InterfaceOptimizationProblem opt) {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -102,7 +102,7 @@ public class MutateESLocal implements InterfaceMutation, InterfaceAdditionalPopu
 | 
				
			|||||||
     * @param opt        The optimization problem.
 | 
					     * @param opt        The optimization problem.
 | 
				
			||||||
     */
 | 
					     */
 | 
				
			||||||
    @Override
 | 
					    @Override
 | 
				
			||||||
    public void init(AbstractEAIndividual individual, InterfaceOptimizationProblem opt) {
 | 
					    public void initialize(AbstractEAIndividual individual, InterfaceOptimizationProblem opt) {
 | 
				
			||||||
        if (individual instanceof InterfaceESIndividual) {
 | 
					        if (individual instanceof InterfaceESIndividual) {
 | 
				
			||||||
            // initialize the Sigmas
 | 
					            // initialize the Sigmas
 | 
				
			||||||
            this.sigmas = new double[((InterfaceESIndividual) individual).getDGenotype().length];
 | 
					            this.sigmas = new double[((InterfaceESIndividual) individual).getDGenotype().length];
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -107,7 +107,7 @@ public class MutateESMainVectorAdaption implements InterfaceMutation, java.io.Se
 | 
				
			|||||||
     * @param opt        The optimization problem.
 | 
					     * @param opt        The optimization problem.
 | 
				
			||||||
     */
 | 
					     */
 | 
				
			||||||
    @Override
 | 
					    @Override
 | 
				
			||||||
    public void init(AbstractEAIndividual individual, InterfaceOptimizationProblem opt) {
 | 
					    public void initialize(AbstractEAIndividual individual, InterfaceOptimizationProblem opt) {
 | 
				
			||||||
        if (!(individual instanceof InterfaceESIndividual)) {
 | 
					        if (!(individual instanceof InterfaceESIndividual)) {
 | 
				
			||||||
            return;
 | 
					            return;
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -85,7 +85,7 @@ public class MutateESMutativeStepSizeControl implements InterfaceMutation, java.
 | 
				
			|||||||
     * @param opt        The optimization problem.
 | 
					     * @param opt        The optimization problem.
 | 
				
			||||||
     */
 | 
					     */
 | 
				
			||||||
    @Override
 | 
					    @Override
 | 
				
			||||||
    public void init(AbstractEAIndividual individual, InterfaceOptimizationProblem opt) {
 | 
					    public void initialize(AbstractEAIndividual individual, InterfaceOptimizationProblem opt) {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -104,7 +104,7 @@ public class MutateESPathLengthAdaption implements InterfaceMutation, java.io.Se
 | 
				
			|||||||
     * @param opt        The optimization problem.
 | 
					     * @param opt        The optimization problem.
 | 
				
			||||||
     */
 | 
					     */
 | 
				
			||||||
    @Override
 | 
					    @Override
 | 
				
			||||||
    public void init(AbstractEAIndividual individual, InterfaceOptimizationProblem opt) {
 | 
					    public void initialize(AbstractEAIndividual individual, InterfaceOptimizationProblem opt) {
 | 
				
			||||||
        if (!(individual instanceof InterfaceESIndividual)) {
 | 
					        if (!(individual instanceof InterfaceESIndividual)) {
 | 
				
			||||||
            return;
 | 
					            return;
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -58,7 +58,7 @@ public class MutateESPolynomial implements InterfaceMutation, java.io.Serializab
 | 
				
			|||||||
     * @param opt        The optimization problem.
 | 
					     * @param opt        The optimization problem.
 | 
				
			||||||
     */
 | 
					     */
 | 
				
			||||||
    @Override
 | 
					    @Override
 | 
				
			||||||
    public void init(AbstractEAIndividual individual, InterfaceOptimizationProblem opt) {
 | 
					    public void initialize(AbstractEAIndividual individual, InterfaceOptimizationProblem opt) {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -519,7 +519,7 @@ public class MutateESRankMuCMA implements InterfaceAdaptOperatorGenerational, In
 | 
				
			|||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    @Override
 | 
					    @Override
 | 
				
			||||||
    public void init(AbstractEAIndividual individual,
 | 
					    public void initialize(AbstractEAIndividual individual,
 | 
				
			||||||
                           InterfaceOptimizationProblem opt) {
 | 
					                           InterfaceOptimizationProblem opt) {
 | 
				
			||||||
        double[][] range = ((InterfaceDataTypeDouble) individual).getDoubleRange();
 | 
					        double[][] range = ((InterfaceDataTypeDouble) individual).getDoubleRange();
 | 
				
			||||||
        int dim = range.length;
 | 
					        int dim = range.length;
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -70,7 +70,7 @@ public class MutateGAAdaptive implements InterfaceMutation, java.io.Serializable
 | 
				
			|||||||
     * @param opt        The optimization problem.
 | 
					     * @param opt        The optimization problem.
 | 
				
			||||||
     */
 | 
					     */
 | 
				
			||||||
    @Override
 | 
					    @Override
 | 
				
			||||||
    public void init(AbstractEAIndividual individual, InterfaceOptimizationProblem opt) {
 | 
					    public void initialize(AbstractEAIndividual individual, InterfaceOptimizationProblem opt) {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -75,7 +75,7 @@ public class MutateGAGISwapBits implements InterfaceMutation, java.io.Serializab
 | 
				
			|||||||
     * @param opt        The optimization problem.
 | 
					     * @param opt        The optimization problem.
 | 
				
			||||||
     */
 | 
					     */
 | 
				
			||||||
    @Override
 | 
					    @Override
 | 
				
			||||||
    public void init(AbstractEAIndividual individual, InterfaceOptimizationProblem opt) {
 | 
					    public void initialize(AbstractEAIndividual individual, InterfaceOptimizationProblem opt) {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -62,7 +62,7 @@ public class MutateGAInvertBits implements InterfaceMutation, java.io.Serializab
 | 
				
			|||||||
     * @param opt        The optimization problem.
 | 
					     * @param opt        The optimization problem.
 | 
				
			||||||
     */
 | 
					     */
 | 
				
			||||||
    @Override
 | 
					    @Override
 | 
				
			||||||
    public void init(AbstractEAIndividual individual, InterfaceOptimizationProblem opt) {
 | 
					    public void initialize(AbstractEAIndividual individual, InterfaceOptimizationProblem opt) {
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    /**
 | 
					    /**
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -57,7 +57,7 @@ public class MutateGANBit implements InterfaceMutation, java.io.Serializable {
 | 
				
			|||||||
     * @param opt        The optimization problem.
 | 
					     * @param opt        The optimization problem.
 | 
				
			||||||
     */
 | 
					     */
 | 
				
			||||||
    @Override
 | 
					    @Override
 | 
				
			||||||
    public void init(AbstractEAIndividual individual, InterfaceOptimizationProblem opt) {
 | 
					    public void initialize(AbstractEAIndividual individual, InterfaceOptimizationProblem opt) {
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    /**
 | 
					    /**
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -65,7 +65,7 @@ public class MutateGAShiftSubstring implements InterfaceMutation, java.io.Serial
 | 
				
			|||||||
     * @param opt        The optimization problem.
 | 
					     * @param opt        The optimization problem.
 | 
				
			||||||
     */
 | 
					     */
 | 
				
			||||||
    @Override
 | 
					    @Override
 | 
				
			||||||
    public void init(AbstractEAIndividual individual, InterfaceOptimizationProblem opt) {
 | 
					    public void initialize(AbstractEAIndividual individual, InterfaceOptimizationProblem opt) {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -97,7 +97,7 @@ public class MutateGASwapBitsSegmentwise implements InterfaceMutation, java.io.S
 | 
				
			|||||||
     * @param opt        The optimization problem.
 | 
					     * @param opt        The optimization problem.
 | 
				
			||||||
     */
 | 
					     */
 | 
				
			||||||
    @Override
 | 
					    @Override
 | 
				
			||||||
    public void init(AbstractEAIndividual individual, InterfaceOptimizationProblem opt) {
 | 
					    public void initialize(AbstractEAIndividual individual, InterfaceOptimizationProblem opt) {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -53,7 +53,7 @@ public class MutateGAUniform implements InterfaceMutation, Serializable {
 | 
				
			|||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    @Override
 | 
					    @Override
 | 
				
			||||||
    public void init(AbstractEAIndividual individual,
 | 
					    public void initialize(AbstractEAIndividual individual,
 | 
				
			||||||
                           InterfaceOptimizationProblem opt) {
 | 
					                           InterfaceOptimizationProblem opt) {
 | 
				
			||||||
        if (useInvertedLength && (individual instanceof InterfaceGAIndividual)) {
 | 
					        if (useInvertedLength && (individual instanceof InterfaceGAIndividual)) {
 | 
				
			||||||
            setBitwiseProb(1. / ((double) ((InterfaceGAIndividual) individual).getGenotypeLength()));
 | 
					            setBitwiseProb(1. / ((double) ((InterfaceGAIndividual) individual).getGenotypeLength()));
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -55,7 +55,7 @@ public class MutateGIInsertDelete implements InterfaceMutation, java.io.Serializ
 | 
				
			|||||||
     * @param opt        The optimization problem.
 | 
					     * @param opt        The optimization problem.
 | 
				
			||||||
     */
 | 
					     */
 | 
				
			||||||
    @Override
 | 
					    @Override
 | 
				
			||||||
    public void init(AbstractEAIndividual individual, InterfaceOptimizationProblem opt) {
 | 
					    public void initialize(AbstractEAIndividual individual, InterfaceOptimizationProblem opt) {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -55,7 +55,7 @@ public class MutateGIInvert implements InterfaceMutation, java.io.Serializable {
 | 
				
			|||||||
     * @param opt        The optimization problem.
 | 
					     * @param opt        The optimization problem.
 | 
				
			||||||
     */
 | 
					     */
 | 
				
			||||||
    @Override
 | 
					    @Override
 | 
				
			||||||
    public void init(AbstractEAIndividual individual, InterfaceOptimizationProblem opt) {
 | 
					    public void initialize(AbstractEAIndividual individual, InterfaceOptimizationProblem opt) {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -55,7 +55,7 @@ public class MutateGINominal implements InterfaceMutation, java.io.Serializable
 | 
				
			|||||||
     * @param opt        The optimization problem.
 | 
					     * @param opt        The optimization problem.
 | 
				
			||||||
     */
 | 
					     */
 | 
				
			||||||
    @Override
 | 
					    @Override
 | 
				
			||||||
    public void init(AbstractEAIndividual individual, InterfaceOptimizationProblem opt) {
 | 
					    public void initialize(AbstractEAIndividual individual, InterfaceOptimizationProblem opt) {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -60,7 +60,7 @@ public class MutateGIOrdinal implements InterfaceMutation, java.io.Serializable
 | 
				
			|||||||
     * @param opt        The optimization problem.
 | 
					     * @param opt        The optimization problem.
 | 
				
			||||||
     */
 | 
					     */
 | 
				
			||||||
    @Override
 | 
					    @Override
 | 
				
			||||||
    public void init(AbstractEAIndividual individual, InterfaceOptimizationProblem opt) {
 | 
					    public void initialize(AbstractEAIndividual individual, InterfaceOptimizationProblem opt) {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -61,7 +61,7 @@ public class MutateGISubset implements InterfaceMutation, Serializable {
 | 
				
			|||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    @Override
 | 
					    @Override
 | 
				
			||||||
    public void init(AbstractEAIndividual individual,
 | 
					    public void initialize(AbstractEAIndividual individual,
 | 
				
			||||||
                           InterfaceOptimizationProblem opt) {
 | 
					                           InterfaceOptimizationProblem opt) {
 | 
				
			||||||
        // nothing to do
 | 
					        // nothing to do
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -70,7 +70,7 @@ public class MutateGITranslocate implements InterfaceMutation, java.io.Serializa
 | 
				
			|||||||
     * @param opt        The optimization problem.
 | 
					     * @param opt        The optimization problem.
 | 
				
			||||||
     */
 | 
					     */
 | 
				
			||||||
    @Override
 | 
					    @Override
 | 
				
			||||||
    public void init(AbstractEAIndividual individual, InterfaceOptimizationProblem opt) {
 | 
					    public void initialize(AbstractEAIndividual individual, InterfaceOptimizationProblem opt) {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -70,7 +70,7 @@ public class MutateGPAdaptive implements InterfaceMutation, java.io.Serializable
 | 
				
			|||||||
     * @param opt        The optimization problem.
 | 
					     * @param opt        The optimization problem.
 | 
				
			||||||
     */
 | 
					     */
 | 
				
			||||||
    @Override
 | 
					    @Override
 | 
				
			||||||
    public void init(AbstractEAIndividual individual, InterfaceOptimizationProblem opt) {
 | 
					    public void initialize(AbstractEAIndividual individual, InterfaceOptimizationProblem opt) {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -45,7 +45,7 @@ public class MutateGPSingleNode implements InterfaceMutation, java.io.Serializab
 | 
				
			|||||||
     * @param opt        The optimization problem.
 | 
					     * @param opt        The optimization problem.
 | 
				
			||||||
     */
 | 
					     */
 | 
				
			||||||
    @Override
 | 
					    @Override
 | 
				
			||||||
    public void init(AbstractEAIndividual individual, InterfaceOptimizationProblem opt) {
 | 
					    public void initialize(AbstractEAIndividual individual, InterfaceOptimizationProblem opt) {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -38,7 +38,7 @@ public class MutateOBGAFlip implements InterfaceMutation, java.io.Serializable {
 | 
				
			|||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    @Override
 | 
					    @Override
 | 
				
			||||||
    public void init(AbstractEAIndividual individual, InterfaceOptimizationProblem opt) {
 | 
					    public void initialize(AbstractEAIndividual individual, InterfaceOptimizationProblem opt) {
 | 
				
			||||||
        //nothing to initialize
 | 
					        //nothing to initialize
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -40,7 +40,7 @@ public class MutateOBGAInversion implements java.io.Serializable, InterfaceMutat
 | 
				
			|||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    @Override
 | 
					    @Override
 | 
				
			||||||
    public void init(AbstractEAIndividual individual, InterfaceOptimizationProblem opt) {
 | 
					    public void initialize(AbstractEAIndividual individual, InterfaceOptimizationProblem opt) {
 | 
				
			||||||
        //nothing to initialize
 | 
					        //nothing to initialize
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -39,7 +39,7 @@ public class NoMutation implements InterfaceMutation, java.io.Serializable {
 | 
				
			|||||||
     * @param opt        The optimization problem.
 | 
					     * @param opt        The optimization problem.
 | 
				
			||||||
     */
 | 
					     */
 | 
				
			||||||
    @Override
 | 
					    @Override
 | 
				
			||||||
    public void init(AbstractEAIndividual individual, InterfaceOptimizationProblem opt) {
 | 
					    public void initialize(AbstractEAIndividual individual, InterfaceOptimizationProblem opt) {
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    /**
 | 
					    /**
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -395,7 +395,7 @@ public class PostProcess {
 | 
				
			|||||||
        HillClimbing hc = new HillClimbing();
 | 
					        HillClimbing hc = new HillClimbing();
 | 
				
			||||||
        // HC depends heavily on the selected mutation operator!
 | 
					        // HC depends heavily on the selected mutation operator!
 | 
				
			||||||
        hc.setProblem(problem);
 | 
					        hc.setProblem(problem);
 | 
				
			||||||
        mute.init(problem.getIndividualTemplate(), problem);
 | 
					        mute.initialize(problem.getIndividualTemplate(), problem);
 | 
				
			||||||
        hc.setMutationOperator(mute);
 | 
					        hc.setMutationOperator(mute);
 | 
				
			||||||
        if (pop.size() != pop.getTargetSize()) {
 | 
					        if (pop.size() != pop.getTargetSize()) {
 | 
				
			||||||
            System.err.println(pop.size() + " vs. " + pop.getTargetSize());
 | 
					            System.err.println(pop.size() + " vs. " + pop.getTargetSize());
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user