parent
27f94e088e
commit
d3ea94fe5c
@ -36,13 +36,16 @@ public class PBILPopulation extends Population implements Cloneable, java.io.Ser
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public Object clone() {
|
public Object clone() {
|
||||||
return (Object) new PBILPopulation(this);
|
return (Object) new PBILPopulation(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** This method inits the state of the population AFTER the individuals
|
/**
|
||||||
* have been inited by a problem
|
* This method inits the state of the population AFTER the individuals
|
||||||
|
* have been inited by a problem.
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public void init() {
|
public void init() {
|
||||||
this.generationCount = 0;
|
this.generationCount = 0;
|
||||||
this.functionCallCount = 0;
|
this.functionCallCount = 0;
|
||||||
@ -56,7 +59,8 @@ public class PBILPopulation extends Population implements Cloneable, java.io.Ser
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/** This method allows you to learn from several examples
|
/**
|
||||||
|
* This method allows you to learn from several examples
|
||||||
* @param examples A population of examples.
|
* @param examples A population of examples.
|
||||||
* @param learnRate The learning rate.
|
* @param learnRate The learning rate.
|
||||||
*/
|
*/
|
||||||
@ -74,7 +78,8 @@ public class PBILPopulation extends Population implements Cloneable, java.io.Ser
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/** This method creates a new population based on the bit probability vector
|
/**
|
||||||
|
* This method creates a new population based on the bit probability vector.
|
||||||
*/
|
*/
|
||||||
public void initPBIL() {
|
public void initPBIL() {
|
||||||
InterfaceGAIndividual tmpIndy, template = (InterfaceGAIndividual)((AbstractEAIndividual)this.get(0)).clone();
|
InterfaceGAIndividual tmpIndy, template = (InterfaceGAIndividual)((AbstractEAIndividual)this.get(0)).clone();
|
||||||
@ -93,7 +98,8 @@ public class PBILPopulation extends Population implements Cloneable, java.io.Ser
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/** This method allows you to mutate the bit probability vector
|
/**
|
||||||
|
* This method allows you to mutate the bit probability vector
|
||||||
* @param mutationRate The mutation rate.
|
* @param mutationRate The mutation rate.
|
||||||
*/
|
*/
|
||||||
public void mutateProbabilityVector(double mutationRate, double sigma) {
|
public void mutateProbabilityVector(double mutationRate, double sigma) {
|
||||||
@ -104,7 +110,8 @@ public class PBILPopulation extends Population implements Cloneable, java.io.Ser
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/** This method will build a probability vector from the current population
|
/**
|
||||||
|
* This method will build a probability vector from the current population.
|
||||||
*/
|
*/
|
||||||
public void buildProbabilityVector() {
|
public void buildProbabilityVector() {
|
||||||
int dim = ((InterfaceGAIndividual)this.get(0)).getGenotypeLength();
|
int dim = ((InterfaceGAIndividual)this.get(0)).getGenotypeLength();
|
||||||
@ -125,20 +132,24 @@ public class PBILPopulation extends Population implements Cloneable, java.io.Ser
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/** This method allows you to set the current probability vector.
|
/**
|
||||||
|
* This method allows you to set the current probability vector.
|
||||||
* @param pv The new probability vector.
|
* @param pv The new probability vector.
|
||||||
*/
|
*/
|
||||||
public void SetProbabilityVector(double[] pv) {
|
public void setProbabilityVector(double[] pv) {
|
||||||
this.m_ProbabilityVector = pv;
|
this.m_ProbabilityVector = pv;
|
||||||
}
|
}
|
||||||
|
|
||||||
public double[] getProbabilityVector() {
|
public double[] getProbabilityVector() {
|
||||||
return this.m_ProbabilityVector;
|
return this.m_ProbabilityVector;
|
||||||
}
|
}
|
||||||
|
|
||||||
/** This method will return a string description of the GAIndividal
|
/**
|
||||||
* noteably the Genotype.
|
* This method will return a string description of the GAIndividal
|
||||||
|
* notably the Genotype.
|
||||||
* @return A descriptive string
|
* @return A descriptive string
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public String getStringRepresentation() {
|
public String getStringRepresentation() {
|
||||||
String result = "";
|
String result = "";
|
||||||
result += "PBIL-Population:\n";
|
result += "PBIL-Population:\n";
|
||||||
|
@ -41,29 +41,66 @@ import java.util.logging.Logger;
|
|||||||
public class Population extends ArrayList implements PopulationInterface, Cloneable, java.io.Serializable {
|
public class Population extends ArrayList implements PopulationInterface, Cloneable, java.io.Serializable {
|
||||||
|
|
||||||
private static final Logger LOGGER = Logger.getLogger(Population.class.getName());
|
private static final Logger LOGGER = Logger.getLogger(Population.class.getName());
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Number of generations.
|
||||||
|
*/
|
||||||
protected int generationCount = 0;
|
protected int generationCount = 0;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Number of function calls.
|
||||||
|
*/
|
||||||
protected int functionCallCount = 0;
|
protected int functionCallCount = 0;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Size of the target population.
|
||||||
|
*/
|
||||||
protected int targetPopSize = 50;
|
protected int targetPopSize = 50;
|
||||||
protected Population populationArchive = null;
|
protected Population populationArchive = null;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Method by which the Population gets initialized.
|
||||||
|
*/
|
||||||
PopulationInitMethod initMethod = PopulationInitMethod.individualDefault;
|
PopulationInitMethod initMethod = PopulationInitMethod.individualDefault;
|
||||||
private double[] seedPos = new double[10];
|
private double[] seedPos = new double[10];
|
||||||
private Pair<Integer, Integer> seedCardinality = new Pair<Integer, Integer>(5, 1);
|
private Pair<Integer, Integer> seedCardinality = new Pair<Integer, Integer>(5, 1);
|
||||||
private double aroundDist = 0.1;
|
private double aroundDist = 0.1;
|
||||||
|
|
||||||
transient private ArrayList<InterfacePopulationChangedEventListener> listeners = null;
|
transient private ArrayList<InterfacePopulationChangedEventListener> listeners = null;
|
||||||
// the evaluation interval at which listeners are notified
|
|
||||||
|
/**
|
||||||
|
* The evaluation interval at which listeners are notified.
|
||||||
|
*/
|
||||||
protected int notifyEvalInterval = 0;
|
protected int notifyEvalInterval = 0;
|
||||||
// additional data connected to the population
|
|
||||||
|
/**
|
||||||
|
* Additional data connected to the population.
|
||||||
|
*/
|
||||||
protected HashMap<String, Object> additionalPopData = null;
|
protected HashMap<String, Object> additionalPopData = null;
|
||||||
// historical best indidivuals may be traced for a given number of generations. Set to -1 to trace all, set to 0 to not trace at all
|
|
||||||
|
/**
|
||||||
|
* historical best individuals may be traced for a given number of generations.
|
||||||
|
* Set to -1 to trace all, set to 0 to not trace at all
|
||||||
|
*/
|
||||||
int historyMaxLen = 0;
|
int historyMaxLen = 0;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Best n Individuals in the history.
|
||||||
|
*/
|
||||||
private transient LinkedList<AbstractEAIndividual> m_History = new LinkedList<AbstractEAIndividual>();
|
private transient LinkedList<AbstractEAIndividual> m_History = new LinkedList<AbstractEAIndividual>();
|
||||||
// remember when the last sorted queue was prepared
|
|
||||||
|
/**
|
||||||
|
* Remember when the last sorted queue was prepared.
|
||||||
|
*/
|
||||||
private int lastQModCount = -1;
|
private int lastQModCount = -1;
|
||||||
// a sorted queue (for efficiency)
|
|
||||||
|
/**
|
||||||
|
* A sorted queue (for efficiency).
|
||||||
|
*/
|
||||||
transient private ArrayList<AbstractEAIndividual> sortedArr = null;
|
transient private ArrayList<AbstractEAIndividual> sortedArr = null;
|
||||||
|
|
||||||
private Comparator<Object> lastSortingComparator = null;
|
private Comparator<Object> lastSortingComparator = null;
|
||||||
private InterfaceDistanceMetric popDistMetric = null; // an associated metric
|
private InterfaceDistanceMetric popDistMetric = null; // an associated metric
|
||||||
// private AbstractEAIndividualComparator historyComparator = null;
|
|
||||||
public static final String funCallIntervalReached = "FunCallIntervalReached";
|
public static final String funCallIntervalReached = "FunCallIntervalReached";
|
||||||
public static final String populationInitialized = "PopulationReinitOccured";
|
public static final String populationInitialized = "PopulationReinitOccured";
|
||||||
public static final String nextGenerationPerformed = "NextGenerationPerformed";
|
public static final String nextGenerationPerformed = "NextGenerationPerformed";
|
||||||
@ -195,7 +232,6 @@ public class Population extends ArrayList implements PopulationInterface, Clonea
|
|||||||
if (population.seedPos != null) {
|
if (population.seedPos != null) {
|
||||||
this.seedPos = population.seedPos.clone();
|
this.seedPos = population.seedPos.clone();
|
||||||
}
|
}
|
||||||
// this.m_Listener = population.m_Listener;
|
|
||||||
if (population.listeners != null) {
|
if (population.listeners != null) {
|
||||||
this.listeners = (ArrayList<InterfacePopulationChangedEventListener>) population.listeners.clone();
|
this.listeners = (ArrayList<InterfacePopulationChangedEventListener>) population.listeners.clone();
|
||||||
} else {
|
} else {
|
||||||
@ -1654,7 +1690,7 @@ public class Population extends ArrayList implements PopulationInterface, Clonea
|
|||||||
*
|
*
|
||||||
* @param size
|
* @param size
|
||||||
*/
|
*/
|
||||||
public void setTargetSize(int size) {
|
public final void setTargetSize(int size) {
|
||||||
this.targetPopSize = size;
|
this.targetPopSize = size;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1665,7 +1701,7 @@ public class Population extends ArrayList implements PopulationInterface, Clonea
|
|||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public Population setTargetPopSize(int size) {
|
public Population setTargetPopSize(int size) {
|
||||||
setTargetSize(size);
|
this.setTargetSize(size);
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2328,7 +2364,7 @@ public class Population extends ArrayList implements PopulationInterface, Clonea
|
|||||||
* Calculate the fitness sum over all individuals for one criterion.
|
* Calculate the fitness sum over all individuals for one criterion.
|
||||||
*
|
*
|
||||||
* @param criterion
|
* @param criterion
|
||||||
* @return the fitness sum over all individuals for one criterio
|
* @return the fitness sum over all individuals for one criteria
|
||||||
*/
|
*/
|
||||||
public double getFitSum(int criterion) {
|
public double getFitSum(int criterion) {
|
||||||
double fSum = 0.;
|
double fSum = 0.;
|
||||||
|
@ -12,328 +12,359 @@ import eva2.server.go.populations.SolutionSet;
|
|||||||
import eva2.server.go.problems.F1Problem;
|
import eva2.server.go.problems.F1Problem;
|
||||||
import eva2.server.go.problems.InterfaceOptimizationProblem;
|
import eva2.server.go.problems.InterfaceOptimizationProblem;
|
||||||
|
|
||||||
/** The traditional genetic algorithms as devised by Holland. To only special here
|
/**
|
||||||
* it the plague factor which reduces the population size to tune from a global to
|
* The traditional genetic algorithms as devised by Holland. To only special
|
||||||
* a more local search. But you have to be careful with that else the GA might not
|
* here it the plague factor which reduces the population size to tune from a
|
||||||
* converge.
|
* global to a more local search. But you have to be careful with that else the
|
||||||
* This is a implementation of Genetic Algorithms.
|
* GA might not converge. This is a implementation of Genetic Algorithms.
|
||||||
* Copyright: Copyright (c) 2003
|
* Copyright: Copyright (c) 2003 Company: University of Tuebingen, Computer
|
||||||
* Company: University of Tuebingen, Computer Architecture
|
* Architecture
|
||||||
|
*
|
||||||
* @author Felix Streichert
|
* @author Felix Streichert
|
||||||
* @version: $Revision: 307 $
|
* @version: $Revision: 307 $ $Date: 2007-12-04 14:31:47 +0100 (Tue, 04 Dec
|
||||||
* $Date: 2007-12-04 14:31:47 +0100 (Tue, 04 Dec 2007) $
|
* 2007) $ $Author: mkron $
|
||||||
* $Author: mkron $
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
public class GeneticAlgorithm implements InterfaceOptimizer, java.io.Serializable {
|
public class GeneticAlgorithm implements InterfaceOptimizer, java.io.Serializable {
|
||||||
|
|
||||||
private Population m_Population = new Population();
|
private Population population = new Population();
|
||||||
private InterfaceOptimizationProblem m_Problem = new F1Problem();
|
private InterfaceOptimizationProblem optimizationProblem = new F1Problem();
|
||||||
private InterfaceSelection m_ParentSelection = new SelectXProbRouletteWheel();
|
private InterfaceSelection parentSelection = new SelectXProbRouletteWheel();
|
||||||
private InterfaceSelection m_PartnerSelection = new SelectRandom();
|
private InterfaceSelection partnerSelection = new SelectRandom();
|
||||||
private boolean m_UseElitism = true;
|
private boolean useElitism = true;
|
||||||
private int m_Plague = 0;
|
private int plague = 0;
|
||||||
private int m_NumberOfPartners = 1;
|
private int numberOfPartners = 1;
|
||||||
|
private String identifier = "";
|
||||||
private String m_Identifier = "";
|
transient private InterfacePopulationChangedEventListener popChangedListener;
|
||||||
transient private InterfacePopulationChangedEventListener m_Listener;
|
|
||||||
|
|
||||||
public GeneticAlgorithm() {
|
public GeneticAlgorithm() {
|
||||||
}
|
}
|
||||||
|
|
||||||
public GeneticAlgorithm(GeneticAlgorithm a) {
|
public GeneticAlgorithm(GeneticAlgorithm ga) {
|
||||||
this.m_Population = (Population)a.m_Population.clone();
|
this.population = (Population) ga.population.clone();
|
||||||
this.m_Problem = (InterfaceOptimizationProblem)a.m_Problem.clone();
|
this.optimizationProblem = (InterfaceOptimizationProblem) ga.optimizationProblem.clone();
|
||||||
this.m_Identifier = a.m_Identifier;
|
this.identifier = ga.identifier;
|
||||||
this.m_Plague = a.m_Plague;
|
this.plague = ga.plague;
|
||||||
this.m_NumberOfPartners = a.m_NumberOfPartners;
|
this.numberOfPartners = ga.numberOfPartners;
|
||||||
this.m_UseElitism = a.m_UseElitism;
|
this.useElitism = ga.useElitism;
|
||||||
this.m_ParentSelection = (InterfaceSelection)a.m_ParentSelection.clone();
|
this.parentSelection = (InterfaceSelection) ga.parentSelection.clone();
|
||||||
this.m_PartnerSelection = (InterfaceSelection)a.m_PartnerSelection.clone();
|
this.partnerSelection = (InterfaceSelection) ga.partnerSelection.clone();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public Object clone() {
|
public Object clone() {
|
||||||
return (Object) new GeneticAlgorithm(this);
|
return (Object) new GeneticAlgorithm(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void init() {
|
public void init() {
|
||||||
this.m_Problem.initPopulation(this.m_Population);
|
this.optimizationProblem.initPopulation(this.population);
|
||||||
this.evaluatePopulation(this.m_Population);
|
this.evaluatePopulation(this.population);
|
||||||
this.firePropertyChangedEvent(Population.nextGenerationPerformed);
|
this.firePropertyChangedEvent(Population.nextGenerationPerformed);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** This method will init the optimizer with a given population
|
/**
|
||||||
|
* This method will init the optimizer with a given population
|
||||||
|
*
|
||||||
* @param reset If true the population is reset.
|
* @param reset If true the population is reset.
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public void initByPopulation(Population pop, boolean reset) {
|
public void initByPopulation(Population pop, boolean reset) {
|
||||||
this.m_Population = (Population)pop.clone();
|
this.population = (Population) pop.clone();
|
||||||
if (reset) {
|
if (reset) {
|
||||||
this.m_Problem.initPopulation(m_Population);
|
this.optimizationProblem.initPopulation(population);
|
||||||
this.m_Population.init();
|
this.population.init();
|
||||||
this.evaluatePopulation(this.m_Population);
|
this.evaluatePopulation(this.population);
|
||||||
this.firePropertyChangedEvent(Population.nextGenerationPerformed);
|
this.firePropertyChangedEvent(Population.nextGenerationPerformed);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/** This method will evaluate the current population using the
|
/**
|
||||||
* given problem.
|
* This method will evaluate the current population using the given problem.
|
||||||
|
*
|
||||||
* @param population The population that is to be evaluated
|
* @param population The population that is to be evaluated
|
||||||
*/
|
*/
|
||||||
private void evaluatePopulation(Population population) {
|
private void evaluatePopulation(Population population) {
|
||||||
this.m_Problem.evaluate(population);
|
this.optimizationProblem.evaluate(population);
|
||||||
population.incrGeneration();
|
population.incrGeneration();
|
||||||
}
|
}
|
||||||
|
|
||||||
// /** This method will assign fitness values to all individual in the
|
/**
|
||||||
// * current population.
|
* This method will generate the offspring population from the given
|
||||||
// * @param population The population that is to be evaluated
|
* population of evaluated individuals.
|
||||||
// */
|
|
||||||
// private void defaultEvaluatePopulation(Population population) {
|
|
||||||
// GAIndividualBinaryData tmpIndy;
|
|
||||||
// for (int i = 0; i < population.size(); i++) {
|
|
||||||
// tmpIndy = (GAIndividualBinaryData) population.get(i);
|
|
||||||
// tmpIndy.SetFitness(0, tmpIndy.defaultEvaulateAsMiniBits());
|
|
||||||
// population.incrFunctionCalls();
|
|
||||||
// }
|
|
||||||
// population.incrGeneration();
|
|
||||||
// }
|
|
||||||
|
|
||||||
/** This method will generate the offspring population from the
|
|
||||||
* given population of evaluated individuals.
|
|
||||||
*/
|
*/
|
||||||
private Population generateChildren() {
|
private Population generateChildren() {
|
||||||
Population result = m_Population.cloneWithoutInds();
|
Population result = population.cloneWithoutInds();
|
||||||
Population parents;
|
Population parents;
|
||||||
AbstractEAIndividual[] offSprings;
|
AbstractEAIndividual[] offSprings;
|
||||||
AbstractEAIndividual tmpIndy;
|
AbstractEAIndividual tmpIndy;
|
||||||
|
|
||||||
//this.m_NormationOperator.computeSelectionProbability(this.m_Population, "Fitness");
|
this.parentSelection.prepareSelection(this.population);
|
||||||
//System.out.println("Population:"+this.m_Population.getSolutionRepresentationFor());
|
this.partnerSelection.prepareSelection(this.population);
|
||||||
this.m_ParentSelection.prepareSelection(this.m_Population);
|
parents = this.parentSelection.selectFrom(this.population, this.population.getTargetSize());
|
||||||
this.m_PartnerSelection.prepareSelection(this.m_Population);
|
|
||||||
parents = this.m_ParentSelection.selectFrom(this.m_Population, this.m_Population.getTargetSize());
|
|
||||||
// System.out.println("Parents:"+parents.getStringRepresentation());
|
|
||||||
// double[] meas = parents.getPopulationMeasures();
|
|
||||||
|
|
||||||
if (parents.getEAIndividual(0).getMutationOperator() instanceof InterfaceAdaptOperatorGenerational) {
|
if (parents.getEAIndividual(0).getMutationOperator() instanceof InterfaceAdaptOperatorGenerational) {
|
||||||
((InterfaceAdaptOperatorGenerational)parents.getEAIndividual(0).getMutationOperator()).adaptAfterSelection(m_Population, parents);
|
((InterfaceAdaptOperatorGenerational) parents.getEAIndividual(0).getMutationOperator()).adaptAfterSelection(population, parents);
|
||||||
}
|
}
|
||||||
if (parents.getEAIndividual(0).getCrossoverOperator() instanceof InterfaceAdaptOperatorGenerational) {
|
if (parents.getEAIndividual(0).getCrossoverOperator() instanceof InterfaceAdaptOperatorGenerational) {
|
||||||
((InterfaceAdaptOperatorGenerational)parents.getEAIndividual(0).getCrossoverOperator()).adaptAfterSelection(m_Population, parents);
|
((InterfaceAdaptOperatorGenerational) parents.getEAIndividual(0).getCrossoverOperator()).adaptAfterSelection(population, parents);
|
||||||
}
|
}
|
||||||
|
|
||||||
for (int i = 0; i < parents.size(); i++) {
|
for (int i = 0; i < parents.size(); i++) {
|
||||||
tmpIndy = ((AbstractEAIndividual)parents.get(i));
|
tmpIndy = ((AbstractEAIndividual) parents.get(i));
|
||||||
if (tmpIndy == null) System.out.println("Individual null " + i + " Population size: "+ parents.size());
|
if (tmpIndy == null) {
|
||||||
if (this.m_Population == null) System.out.println("population null "+i);
|
System.out.println("Individual null " + i + " Population size: " + parents.size());
|
||||||
|
}
|
||||||
|
if (this.population == null) {
|
||||||
|
System.out.println("population null " + i);
|
||||||
|
}
|
||||||
|
|
||||||
offSprings = tmpIndy.mateWith(this.m_PartnerSelection.findPartnerFor(tmpIndy, this.m_Population, this.m_NumberOfPartners));
|
// ToDo: tmpIndy can be null. We shouldn't call a method on null..
|
||||||
// for (int j = 0; j < offSprings.length; j++) {
|
offSprings = tmpIndy.mateWith(this.partnerSelection.findPartnerFor(tmpIndy, this.population, this.numberOfPartners));
|
||||||
// offSprings[j].mutate(); // quite useless if n-1 are thrown away...
|
|
||||||
// }
|
|
||||||
offSprings[0].mutate();
|
offSprings[0].mutate();
|
||||||
result.add(i, offSprings[0]);
|
result.add(i, offSprings[0]);
|
||||||
}
|
}
|
||||||
this.evaluatePopulation(result);
|
this.evaluatePopulation(result);
|
||||||
|
|
||||||
if (parents.getEAIndividual(0).getMutationOperator() instanceof InterfaceAdaptOperatorGenerational) {
|
if (parents.getEAIndividual(0).getMutationOperator() instanceof InterfaceAdaptOperatorGenerational) {
|
||||||
((InterfaceAdaptOperatorGenerational)parents.getEAIndividual(0).getMutationOperator()).adaptGenerational(m_Population, parents, result, true);
|
((InterfaceAdaptOperatorGenerational) parents.getEAIndividual(0).getMutationOperator()).adaptGenerational(population, parents, result, true);
|
||||||
}
|
}
|
||||||
if (parents.getEAIndividual(0).getCrossoverOperator() instanceof InterfaceAdaptOperatorGenerational) {
|
if (parents.getEAIndividual(0).getCrossoverOperator() instanceof InterfaceAdaptOperatorGenerational) {
|
||||||
((InterfaceAdaptOperatorGenerational)parents.getEAIndividual(0).getCrossoverOperator()).adaptGenerational(m_Population, parents, result, true);
|
((InterfaceAdaptOperatorGenerational) parents.getEAIndividual(0).getCrossoverOperator()).adaptGenerational(population, parents, result, true);
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public void optimize() {
|
public void optimize() {
|
||||||
Population nextGeneration;
|
Population nextGeneration;
|
||||||
nextGeneration = this.generateChildren();
|
nextGeneration = this.generateChildren();
|
||||||
|
|
||||||
if (this.m_UseElitism) {
|
if (this.useElitism) {
|
||||||
AbstractEAIndividual elite = this.m_Population.getBestEAIndividual();
|
AbstractEAIndividual elite = this.population.getBestEAIndividual();
|
||||||
if (elite != null) {
|
if (elite != null) {
|
||||||
this.m_Population = nextGeneration;
|
this.population = nextGeneration;
|
||||||
this.m_Population.remove(0);// This implements a random replacement strategy for the elite
|
this.population.remove(0);// This implements a random replacement strategy for the elite
|
||||||
this.m_Population.add(elite);
|
this.population.add(elite);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
this.m_Population = nextGeneration;
|
this.population = nextGeneration;
|
||||||
}
|
}
|
||||||
if (this.m_Plague > 0) {
|
if (this.plague > 0) {
|
||||||
for (int i = 0; i < this.m_Plague; i++) if (this.m_Population.size() > 2) this.m_Population.remove(this.m_Population.getWorstEAIndividual());
|
for (int i = 0; i < this.plague; i++) {
|
||||||
this.m_Population.setTargetSize(this.m_Population.size());
|
if (this.population.size() > 2) {
|
||||||
|
this.population.remove(this.population.getWorstEAIndividual());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
this.population.setTargetSize(this.population.size());
|
||||||
}
|
}
|
||||||
// System.out.println("Population size: " + this.m_Population.size());
|
|
||||||
// System.out.println("Population: " + m_Population.getStringRepresentation());
|
|
||||||
// if (this.m_Population.getArchive() != null) {
|
|
||||||
// if (this.m_Population.getArchive().getArchive() != null) {
|
|
||||||
// System.out.println("Zwei Archive!");
|
|
||||||
// this.m_Population.getArchive().SetArchive(null);
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// this.m_Population.incrGeneration();
|
|
||||||
this.firePropertyChangedEvent(Population.nextGenerationPerformed);
|
this.firePropertyChangedEvent(Population.nextGenerationPerformed);
|
||||||
}
|
}
|
||||||
|
|
||||||
/** This method allows you to add the LectureGUI as listener to the Optimizer
|
/**
|
||||||
|
* This method allows you to add the LectureGUI as listener to the Optimizer
|
||||||
|
*
|
||||||
* @param ea
|
* @param ea
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public void addPopulationChangedEventListener(InterfacePopulationChangedEventListener ea) {
|
public void addPopulationChangedEventListener(InterfacePopulationChangedEventListener ea) {
|
||||||
this.m_Listener = ea;
|
this.popChangedListener = ea;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public boolean removePopulationChangedEventListener(
|
public boolean removePopulationChangedEventListener(
|
||||||
InterfacePopulationChangedEventListener ea) {
|
InterfacePopulationChangedEventListener ea) {
|
||||||
if (m_Listener==ea) {
|
if (popChangedListener == ea) {
|
||||||
m_Listener=null;
|
popChangedListener = null;
|
||||||
return true;
|
return true;
|
||||||
} else return false;
|
} else {
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
/** Something has changed
|
|
||||||
*/
|
|
||||||
protected void firePropertyChangedEvent (String name) {
|
|
||||||
if (this.m_Listener != null) this.m_Listener.registerPopulationStateChanged(this, name);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/** This method will set the problem that is to be optimized
|
/**
|
||||||
|
* Something has changed.
|
||||||
|
*/
|
||||||
|
protected void firePropertyChangedEvent(String name) {
|
||||||
|
if (this.popChangedListener != null) {
|
||||||
|
this.popChangedListener.registerPopulationStateChanged(this, name);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This method will set the problem that is to be optimized
|
||||||
|
*
|
||||||
* @param problem
|
* @param problem
|
||||||
*/
|
*/
|
||||||
public void setProblem (InterfaceOptimizationProblem problem) {
|
@Override
|
||||||
this.m_Problem = problem;
|
public void setProblem(InterfaceOptimizationProblem problem) {
|
||||||
}
|
this.optimizationProblem = problem;
|
||||||
public InterfaceOptimizationProblem getProblem () {
|
|
||||||
return this.m_Problem;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/** This method will return a string describing all properties of the optimizer
|
@Override
|
||||||
* and the applied methods.
|
public InterfaceOptimizationProblem getProblem() {
|
||||||
|
return this.optimizationProblem;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This method will return a string describing all properties of the
|
||||||
|
* optimizer and the applied methods.
|
||||||
|
*
|
||||||
* @return A descriptive string
|
* @return A descriptive string
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public String getStringRepresentation() {
|
public String getStringRepresentation() {
|
||||||
String result = "";
|
String result = "";
|
||||||
result += "Genetic Algorithm:\n";
|
result += "Genetic Algorithm:\n";
|
||||||
result += "Using:\n";
|
result += "Using:\n";
|
||||||
result += " Population Size = " + this.m_Population.getTargetSize() + "/" + this.m_Population.size() + "\n";
|
result += " Population Size = " + this.population.getTargetSize() + "/" + this.population.size() + "\n";
|
||||||
result += " Parent Selection = " + this.m_ParentSelection.getClass().toString() + "\n";
|
result += " Parent Selection = " + this.parentSelection.getClass().toString() + "\n";
|
||||||
result += " Partner Selection = " + this.m_PartnerSelection.getClass().toString() + "\n";
|
result += " Partner Selection = " + this.partnerSelection.getClass().toString() + "\n";
|
||||||
result += " Number of Partners = " + this.m_NumberOfPartners + "\n";
|
result += " Number of Partners = " + this.numberOfPartners + "\n";
|
||||||
result += " Elitism = " + this.m_UseElitism + "\n";
|
result += " Elitism = " + this.useElitism + "\n";
|
||||||
result += "=> The Optimization Problem: ";
|
result += "=> The Optimization Problem: ";
|
||||||
result += this.m_Problem.getStringRepresentationForProblem(this) +"\n";
|
result += this.optimizationProblem.getStringRepresentationForProblem(this) + "\n";
|
||||||
//result += this.m_Population.getStringRepresentation();
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
/** This method allows you to set an identifier for the algorithm
|
|
||||||
* @param name The indenifier
|
/**
|
||||||
|
* This method allows you to set an identifier for the algorithm.
|
||||||
|
*
|
||||||
|
* @param name The identifier
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public void setIdentifier(String name) {
|
public void setIdentifier(String name) {
|
||||||
this.m_Identifier = name;
|
this.identifier = name;
|
||||||
}
|
|
||||||
public String getIdentifier() {
|
|
||||||
return this.m_Identifier;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/** This method is required to free the memory on a RMIServer,
|
@Override
|
||||||
* but there is nothing to implement.
|
public String getIdentifier() {
|
||||||
|
return this.identifier;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* This method is required to free the memory on a RMIServer, but there is
|
||||||
|
* nothing to implement.
|
||||||
*/
|
*/
|
||||||
public void freeWilly() {
|
public void freeWilly() {
|
||||||
|
|
||||||
}
|
}
|
||||||
/**********************************************************************************************************************
|
|
||||||
|
/**
|
||||||
|
* ********************************************************************************************************************
|
||||||
* These are for GUI
|
* These are for GUI
|
||||||
*/
|
*/
|
||||||
/** This method returns a global info string
|
/**
|
||||||
|
* This method returns a global info string
|
||||||
|
*
|
||||||
* @return description
|
* @return description
|
||||||
*/
|
*/
|
||||||
public static String globalInfo() {
|
public static String globalInfo() {
|
||||||
return "This is a basic generational Genetic Algorithm.";
|
return "This is a basic generational Genetic Algorithm.";
|
||||||
}
|
}
|
||||||
/** This method will return a naming String
|
|
||||||
|
/**
|
||||||
|
* This method will return a naming String
|
||||||
|
*
|
||||||
* @return The name of the algorithm
|
* @return The name of the algorithm
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public String getName() {
|
public String getName() {
|
||||||
return "GA";
|
return "GA";
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Assuming that all optimizer will store thier data in a population
|
/**
|
||||||
* we will allow acess to this population to query to current state
|
* Assuming that all optimizer will store thier data in a population we will
|
||||||
* of the optimizer.
|
* allow acess to this population to query to current state of the
|
||||||
|
* optimizer.
|
||||||
|
*
|
||||||
* @return The population of current solutions to a given problem.
|
* @return The population of current solutions to a given problem.
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public Population getPopulation() {
|
public Population getPopulation() {
|
||||||
return this.m_Population;
|
return this.population;
|
||||||
}
|
}
|
||||||
public void setPopulation(Population pop){
|
|
||||||
this.m_Population = pop;
|
@Override
|
||||||
|
public void setPopulation(Population pop) {
|
||||||
|
this.population = pop;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String populationTipText() {
|
public String populationTipText() {
|
||||||
return "Edit the properties of the population used.";
|
return "Edit the properties of the population used.";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public InterfaceSolutionSet getAllSolutions() {
|
public InterfaceSolutionSet getAllSolutions() {
|
||||||
return new SolutionSet(getPopulation());
|
return new SolutionSet(getPopulation());
|
||||||
}
|
}
|
||||||
// /** This method will set the normation method that is to be used.
|
|
||||||
// * @param normation
|
|
||||||
// */
|
|
||||||
// public void setNormationMethod (InterfaceNormation normation) {
|
|
||||||
// this.m_NormationOperator = normation;
|
|
||||||
// }
|
|
||||||
// public InterfaceNormation getNormationMethod () {
|
|
||||||
// return this.m_NormationOperator;
|
|
||||||
// }
|
|
||||||
// public String normationMethodTipText() {
|
|
||||||
// return "Select the normation method.";
|
|
||||||
// }
|
|
||||||
|
|
||||||
/** Choose a parent selection method.
|
/**
|
||||||
|
* Choose a parent selection method.
|
||||||
|
*
|
||||||
* @param selection
|
* @param selection
|
||||||
*/
|
*/
|
||||||
public void setParentSelection(InterfaceSelection selection) {
|
public void setParentSelection(InterfaceSelection selection) {
|
||||||
this.m_ParentSelection = selection;
|
this.parentSelection = selection;
|
||||||
}
|
}
|
||||||
|
|
||||||
public InterfaceSelection getParentSelection() {
|
public InterfaceSelection getParentSelection() {
|
||||||
return this.m_ParentSelection;
|
return this.parentSelection;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String parentSelectionTipText() {
|
public String parentSelectionTipText() {
|
||||||
return "Choose a parent selection method.";
|
return "Choose a parent selection method.";
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Enable/disable elitism.
|
/**
|
||||||
|
* Enable/disable elitism.
|
||||||
|
*
|
||||||
* @param elitism
|
* @param elitism
|
||||||
*/
|
*/
|
||||||
public void setElitism (boolean elitism) {
|
public void setElitism(boolean elitism) {
|
||||||
this.m_UseElitism = elitism;
|
this.useElitism = elitism;
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean getElitism() {
|
public boolean getElitism() {
|
||||||
return this.m_UseElitism;
|
return this.useElitism;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String elitismTipText() {
|
public String elitismTipText() {
|
||||||
return "Enable/disable elitism.";
|
return "Enable/disable elitism.";
|
||||||
}
|
}
|
||||||
|
|
||||||
/** The number of mating partners needed to create offsprings.
|
/**
|
||||||
|
* The number of mating partners needed to create offsprings.
|
||||||
|
*
|
||||||
* @param partners
|
* @param partners
|
||||||
*/
|
*/
|
||||||
public void setNumberOfPartners(int partners) {
|
public void setNumberOfPartners(int partners) {
|
||||||
if (partners < 0) partners = 0;
|
if (partners < 0) {
|
||||||
this.m_NumberOfPartners = partners;
|
partners = 0;
|
||||||
}
|
}
|
||||||
|
this.numberOfPartners = partners;
|
||||||
|
}
|
||||||
|
|
||||||
public int getNumberOfPartners() {
|
public int getNumberOfPartners() {
|
||||||
return this.m_NumberOfPartners;
|
return this.numberOfPartners;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String numberOfPartnersTipText() {
|
public String numberOfPartnersTipText() {
|
||||||
return "The number of mating partners needed to create offsprings.";
|
return "The number of mating partners needed to create offsprings.";
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Choose a selection method for selecting recombination partners for given parents.
|
/**
|
||||||
|
* Choose a selection method for selecting recombination partners for given
|
||||||
|
* parents.
|
||||||
|
*
|
||||||
* @param selection
|
* @param selection
|
||||||
*/
|
*/
|
||||||
public void setPartnerSelection(InterfaceSelection selection) {
|
public void setPartnerSelection(InterfaceSelection selection) {
|
||||||
this.m_PartnerSelection = selection;
|
this.partnerSelection = selection;
|
||||||
}
|
}
|
||||||
|
|
||||||
public InterfaceSelection getPartnerSelection() {
|
public InterfaceSelection getPartnerSelection() {
|
||||||
return this.m_PartnerSelection;
|
return this.partnerSelection;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String partnerSelectionTipText() {
|
public String partnerSelectionTipText() {
|
||||||
return "Choose a selection method for selecting recombination partners for given parents.";
|
return "Choose a selection method for selecting recombination partners for given parents.";
|
||||||
}
|
}
|
||||||
|
@ -66,7 +66,7 @@ public class PopulationBasedIncrementalLearning implements InterfaceOptimizer, j
|
|||||||
public void init() {
|
public void init() {
|
||||||
this.m_Problem.initPopulation(this.m_Population);
|
this.m_Problem.initPopulation(this.m_Population);
|
||||||
if ((m_initialProbabilities!=null) && (m_initialProbabilities.length==((PBILPopulation)m_Population).getProbabilityVector().length)) {
|
if ((m_initialProbabilities!=null) && (m_initialProbabilities.length==((PBILPopulation)m_Population).getProbabilityVector().length)) {
|
||||||
((PBILPopulation)m_Population).SetProbabilityVector(m_initialProbabilities);
|
((PBILPopulation)m_Population).setProbabilityVector(m_initialProbabilities);
|
||||||
} else {
|
} else {
|
||||||
if (m_initialProbabilities!=null) System.err.println("Warning: initial probability vector doesnt match in length!");
|
if (m_initialProbabilities!=null) System.err.println("Warning: initial probability vector doesnt match in length!");
|
||||||
}
|
}
|
||||||
|
@ -44,24 +44,25 @@ import javax.swing.JOptionPane;
|
|||||||
public class Processor extends Thread implements InterfaceProcessor, InterfacePopulationChangedEventListener {
|
public class Processor extends Thread implements InterfaceProcessor, InterfacePopulationChangedEventListener {
|
||||||
|
|
||||||
private static final Logger LOGGER = Logger.getLogger(Processor.class.getName());
|
private static final Logger LOGGER = Logger.getLogger(Processor.class.getName());
|
||||||
private volatile boolean m_optRunning;
|
private volatile boolean isOptimizationRunning;
|
||||||
private InterfaceStatistics m_Statistics;
|
private InterfaceStatistics m_Statistics;
|
||||||
private InterfaceGOParameters goParams;
|
private InterfaceGOParameters goParams;
|
||||||
private boolean m_createInitialPopulations = true;
|
private boolean m_createInitialPopulations = true;
|
||||||
private boolean saveParams = true;
|
private boolean saveParams = true;
|
||||||
private RemoteStateListener m_ListenerModule;
|
private RemoteStateListener remoteStateListener;
|
||||||
private boolean wasRestarted = false;
|
private boolean wasRestarted = false;
|
||||||
private int runCounter = 0;
|
private int runCounter = 0;
|
||||||
private Population resPop = null;
|
private Population resPop = null;
|
||||||
private boolean userAborted = false;
|
private boolean userAborted = false;
|
||||||
|
|
||||||
|
@Override
|
||||||
public void addListener(RemoteStateListener module) {
|
public void addListener(RemoteStateListener module) {
|
||||||
LOGGER.log(
|
LOGGER.log(
|
||||||
Level.FINEST,
|
Level.FINEST,
|
||||||
"Processor: setting module as listener: " + ((module == null)
|
"Processor: setting module as listener: " + ((module == null)
|
||||||
? "null" : module.toString()));
|
? "null" : module.toString()));
|
||||||
|
|
||||||
m_ListenerModule = module;
|
remoteStateListener = module;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -70,10 +71,10 @@ public class Processor extends Thread implements InterfaceProcessor, InterfacePo
|
|||||||
*
|
*
|
||||||
* @see InterfaceNotifyOnInformers
|
* @see InterfaceNotifyOnInformers
|
||||||
*/
|
*/
|
||||||
public Processor(InterfaceStatistics Stat, ModuleAdapter Adapter, InterfaceGOParameters params) {
|
public Processor(InterfaceStatistics Stat, ModuleAdapter moduleAdapter, InterfaceGOParameters params) {
|
||||||
goParams = params;
|
goParams = params;
|
||||||
m_Statistics = Stat;
|
m_Statistics = Stat;
|
||||||
m_ListenerModule = Adapter;
|
remoteStateListener = moduleAdapter;
|
||||||
|
|
||||||
// the statistics want to be informed if the strategy or the optimizer (which provide statistical data as InterfaceAdditionalInformer) change.
|
// the statistics want to be informed if the strategy or the optimizer (which provide statistical data as InterfaceAdditionalInformer) change.
|
||||||
if (Stat != null && (params != null)) {
|
if (Stat != null && (params != null)) {
|
||||||
@ -85,11 +86,11 @@ public class Processor extends Thread implements InterfaceProcessor, InterfacePo
|
|||||||
}
|
}
|
||||||
|
|
||||||
public boolean isOptRunning() {
|
public boolean isOptRunning() {
|
||||||
return m_optRunning;
|
return isOptimizationRunning;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void setOptRunning(boolean bRun) {
|
protected void setOptRunning(boolean bRun) {
|
||||||
m_optRunning = bRun;
|
isOptimizationRunning = bRun;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -129,6 +130,7 @@ public class Processor extends Thread implements InterfaceProcessor, InterfacePo
|
|||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public void restartOpt() {
|
public void restartOpt() {
|
||||||
m_createInitialPopulations = false;
|
m_createInitialPopulations = false;
|
||||||
if (isOptRunning()) {
|
if (isOptRunning()) {
|
||||||
@ -143,6 +145,7 @@ public class Processor extends Thread implements InterfaceProcessor, InterfacePo
|
|||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public void stopOpt() { // this means user break
|
public void stopOpt() { // this means user break
|
||||||
setOptRunning(false);
|
setOptRunning(false);
|
||||||
}
|
}
|
||||||
@ -150,8 +153,9 @@ public class Processor extends Thread implements InterfaceProcessor, InterfacePo
|
|||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public void run() {
|
public void run() {
|
||||||
setPriority(1);
|
this.setPriority(1);
|
||||||
while (true) {
|
while (true) {
|
||||||
try {
|
try {
|
||||||
Thread.sleep(200);
|
Thread.sleep(200);
|
||||||
@ -191,9 +195,9 @@ public class Processor extends Thread implements InterfaceProcessor, InterfacePo
|
|||||||
}
|
}
|
||||||
//m_Statistics.stopOptPerformed(false);
|
//m_Statistics.stopOptPerformed(false);
|
||||||
setOptRunning(false); // normal finish
|
setOptRunning(false); // normal finish
|
||||||
if (m_ListenerModule != null) {
|
if (remoteStateListener != null) {
|
||||||
m_ListenerModule.performedStop(); // is only needed in client server mode
|
remoteStateListener.performedStop(); // is only needed in client server mode
|
||||||
m_ListenerModule.updateProgress(0, errMsg);
|
remoteStateListener.updateProgress(0, errMsg);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return resPop;
|
return resPop;
|
||||||
@ -213,11 +217,11 @@ public class Processor extends Thread implements InterfaceProcessor, InterfacePo
|
|||||||
|
|
||||||
RNG.setRandomSeed(goParams.getSeed());
|
RNG.setRandomSeed(goParams.getSeed());
|
||||||
|
|
||||||
if (m_ListenerModule != null) {
|
if (remoteStateListener != null) {
|
||||||
if (wasRestarted) {
|
if (wasRestarted) {
|
||||||
m_ListenerModule.performedRestart(getInfoString());
|
remoteStateListener.performedRestart(getInfoString());
|
||||||
} else {
|
} else {
|
||||||
m_ListenerModule.performedStart(getInfoString());
|
remoteStateListener.performedStart(getInfoString());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -238,8 +242,8 @@ public class Processor extends Thread implements InterfaceProcessor, InterfacePo
|
|||||||
}
|
}
|
||||||
|
|
||||||
//m_Statistics.createNextGenerationPerformed((PopulationInterface)this.m_ModulParameter.getOptimizer().getPopulation());
|
//m_Statistics.createNextGenerationPerformed((PopulationInterface)this.m_ModulParameter.getOptimizer().getPopulation());
|
||||||
if (m_ListenerModule != null) {
|
if (remoteStateListener != null) {
|
||||||
m_ListenerModule.updateProgress(getStatusPercent(goParams.getOptimizer().getPopulation(), runCounter, m_Statistics.getStatisticsParameter().getMultiRuns()), null);
|
remoteStateListener.updateProgress(getStatusPercent(goParams.getOptimizer().getPopulation(), runCounter, m_Statistics.getStatisticsParameter().getMultiRuns()), null);
|
||||||
}
|
}
|
||||||
if (popLog != null) {
|
if (popLog != null) {
|
||||||
EVAHELP.clearLog(popLog);
|
EVAHELP.clearLog(popLog);
|
||||||
@ -274,11 +278,11 @@ public class Processor extends Thread implements InterfaceProcessor, InterfacePo
|
|||||||
|
|
||||||
}
|
}
|
||||||
setOptRunning(false); // normal finish
|
setOptRunning(false); // normal finish
|
||||||
if (m_ListenerModule != null) {
|
if (remoteStateListener != null) {
|
||||||
m_ListenerModule.performedStop(); // is only needed in client server mode
|
remoteStateListener.performedStop(); // is only needed in client server mode
|
||||||
}
|
}
|
||||||
if (m_ListenerModule != null) {
|
if (remoteStateListener != null) {
|
||||||
m_ListenerModule.updateProgress(0, null);
|
remoteStateListener.updateProgress(0, null);
|
||||||
}
|
}
|
||||||
goParams.getOptimizer().removePopulationChangedEventListener(this);
|
goParams.getOptimizer().removePopulationChangedEventListener(this);
|
||||||
return resultPop;
|
return resultPop;
|
||||||
@ -380,8 +384,8 @@ public class Processor extends Thread implements InterfaceProcessor, InterfacePo
|
|||||||
(PopulationInterface) this.goParams.getOptimizer().getPopulation(),
|
(PopulationInterface) this.goParams.getOptimizer().getPopulation(),
|
||||||
this.goParams.getOptimizer(),
|
this.goParams.getOptimizer(),
|
||||||
getInformerList());
|
getInformerList());
|
||||||
if (m_ListenerModule != null) {
|
if (remoteStateListener != null) {
|
||||||
m_ListenerModule.updateProgress(
|
remoteStateListener.updateProgress(
|
||||||
getStatusPercent(
|
getStatusPercent(
|
||||||
goParams.getOptimizer().getPopulation(),
|
goParams.getOptimizer().getPopulation(),
|
||||||
runCounter,
|
runCounter,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user