public abstract class AbstractGeneticAlgorithm extends java.lang.Object implements IGeneticAlgorithm
Modifier and Type | Class and Description |
---|---|
(package private) class |
AbstractGeneticAlgorithm.Updater
Inner class responsible to update the interface.
|
Constructor and Description |
---|
AbstractGeneticAlgorithm(Parser parser,
ISelection selection,
IMutation mutation,
IRecombination recombination,
IReinsertion reinsertion) |
Modifier and Type | Method and Description |
---|---|
private java.util.List<IEvaluation> |
addNoMoreEvaluators() |
protected void |
addToGraphics() |
protected void |
clearGraphics() |
private void |
configureSiKmc() |
private AbstractPsdEvaluator |
createMainEvaluator()
Evaluator evaluation
|
boolean |
exitCondition()
Break if fitness is good enough or condition exceeds 1e14.
|
Individual |
getBestIndividual() |
int |
getCurrentIteration() |
Individual |
getIndividual(int pos) |
IKmc |
getKmc() |
AbstractPsdEvaluator |
getMainEvaluator() |
float[] |
getProgressPercent() |
protected double |
getStopError() |
int |
getTotalIterations() |
IGeneticAlgorithm |
initialise() |
protected boolean |
isDtooLarge() |
void |
iterate() |
void |
iterateOneStep() |
protected void |
scaleIndividualRates(Population population)
Deprecated.
|
void |
setExpectedSimulationTime(double expectedSimulationTime) |
AbstractGeneticAlgorithm |
setExperimentalPsd(float[][] experimentalPsd) |
void |
setGraphics(IgaProgressFrame graphics) |
void |
setHierarchy(double[] rates) |
void |
setMainInterface(MainInterface mainInterface)
Sets the main interface, starts a thread which will be responsible to update it and
assigns the main interface to the evaluator (to be able to also update it with
the current surface and PSD).
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
reevaluate
private Parser parser
private Population population
private BasicEvaluator evaluator
private AbstractPsdEvaluator mainEvaluator
private java.util.List<IEvaluation> otherEvaluators
private IInitialisator initialisation
private ISelection selection
private IMutation mutation
private IRecombination recombination
private IReinsertion reinsertion
private RestrictionOperator restriction
private final int populationSize
private final int offspringSize
private final int populationReplacements
private double expectedSimulationTime
private final int dimensions
private final double minValueGene
private final double maxValueGene
private final boolean expDistribution
private int currentIteration
private int totalIterations
private MainInterface mainInterface
private AbstractSimulation simulation
private double depositionRatePerSite
private double islandDensity
private AbstractGeneticAlgorithm.Updater updater
private final double stopError
private IgaProgressFrame graphics
public AbstractGeneticAlgorithm(Parser parser, ISelection selection, IMutation mutation, IRecombination recombination, IReinsertion reinsertion)
public IGeneticAlgorithm initialise()
initialise
in interface IGeneticAlgorithm
public void iterateOneStep()
iterateOneStep
in interface IGeneticAlgorithm
private AbstractPsdEvaluator createMainEvaluator()
private void configureSiKmc()
public void iterate()
iterate
in interface IGeneticAlgorithm
protected boolean isDtooLarge()
public boolean exitCondition()
exitCondition
in interface IGeneticAlgorithm
public void setExpectedSimulationTime(double expectedSimulationTime)
public AbstractPsdEvaluator getMainEvaluator()
public AbstractGeneticAlgorithm setExperimentalPsd(float[][] experimentalPsd)
public IKmc getKmc()
public int getCurrentIteration()
getCurrentIteration
in interface IGeneticAlgorithm
public int getTotalIterations()
getTotalIterations
in interface IGeneticAlgorithm
public Individual getIndividual(int pos)
getIndividual
in interface IGeneticAlgorithm
public Individual getBestIndividual()
getBestIndividual
in interface IGeneticAlgorithm
public float[] getProgressPercent()
getProgressPercent
in interface IProgressable
private java.util.List<IEvaluation> addNoMoreEvaluators()
public void setMainInterface(MainInterface mainInterface)
mainInterface
- public void setGraphics(IgaProgressFrame graphics)
setGraphics
in interface IGeneticAlgorithm
protected void addToGraphics()
protected void clearGraphics()
public void setHierarchy(double[] rates)
protected double getStopError()
@Deprecated protected void scaleIndividualRates(Population population)
population
- The population to be scaled.