|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectart.ga.GaConfiguration
This class manage all the parameters of the GA reading them from an XML file. Basically all the parameters are read from an XML file and stored in memory. All the other classes know which is their Configuration instance and ask to their instance for the required information via get methods. In this way is possible to create instance of other classes (like for example create two different Populations) that use two different Configuration, and than different parameters. This can be very useful in AB model
| Constructor Summary | |
GaConfiguration()
The constructor of the class. |
|
| Method Summary | |
int |
getChromosomeLength()
Get the number of genomes contained in each chromosome. |
int |
getChromosomeToReturn()
If the most diffused or the fittest chromosome must be returned to the user. |
int |
getCrossOverPointNumber(int family)
Get the number of crossover point of each genome of a given genome's family. |
double |
getCrossOverRate(int family)
Get the probability of cross over of each genome. |
int |
getDomain(int family)
Get the domain or the alphabet of a given genome. |
java.lang.String |
getGenomeLabel(int i)
Return the genome label deined in the configuration file. |
int |
getGenomeLength(int family)
Get the number of genes for this genome. |
int |
getGenomeType(int family)
Get if the genome must be random (each gene can have any value) or univocal (each gene must be unique within the genome). |
int |
getLogStatistics()
This option enable or disable logging of some statistics on the evolution process. |
double |
getMutationRate(int family)
Get the mutation rate. |
int |
getPopulationSize()
Get the size of population, that means the number of chromosomes managed by the ga. |
java.lang.String |
getProjectDesc()
Desription of the project defined in the configuration file. |
java.lang.String |
getProjectName()
Name of the project in the configuration file. |
java.lang.String |
getProjectType()
Type of the project ("ga" or "cs"). |
MyRandomMaker |
getRandomMaker()
Get a random number generator. |
int |
getStoppingMethod()
Stopping method (at convergence, at generation or never). |
double |
getStoppingValue()
Value to stop at, depend on stopping method. |
double |
getTurnoverRate()
Get the part of the population that is going to become parents in order to produce the next generation. |
int |
getVerboseness()
Get the desired level of verbosity during the run. |
void |
initGenomeArrays(int i)
Initialize the array of genomes after the genomes length are defined. |
boolean |
isFittestNeverDie()
Option to let the fittest Chromosome never die during evolutions. |
boolean |
isMutateAdults()
If also the adults or only the baby (age==0) are subject to mutation. |
boolean |
isNormalizeFitness()
Get if the fitness rescaled and normalized has been computed. |
boolean |
isPlotGraph()
If graph must be plotted. |
void |
readParametersFromFile(java.lang.String fileName,
java.lang.String projectName,
java.lang.String projectType)
Read the values from the given XML file and set the referring parameters in the configuration. |
void |
setChromosomeLength(double length)
Set the number of genomes contained in each chromosome. |
void |
setChromosomeToReturn(double chromosomeToReturn)
If must be returned to the user the most diffused or the fittest chromosome. |
void |
setCrossOverPointNumber(int family,
double val)
Set the number of crossover point of each genome of a given genome's family. |
void |
setCrossOverRate(int family,
double val)
Set the probability of cross over of each genome. |
void |
setDomain(int family,
double val)
Set the domain or the alphabet of a given genome. |
void |
setFittestNeverDie(double i)
Option to let the fittest Chromosome never die during evolutions. |
void |
setGenomeLabel(int family,
java.lang.String label)
Label of each genome defined in the configuration file. |
void |
setGenomeLength(int family,
double val)
Get the number of genes for this genome. |
void |
setGenomeType(int family,
double val)
Set if the genome must be random (each gene can have any value) or univocal (each gene must be unique within the genome). |
void |
setLogStatistics(double i)
This option enable or disable logging of some statistics on the evolution process. |
void |
setMutateAdults(double i)
If also the adults or only the baby (age==0) are subject to mutation. |
void |
setMutationRate(int family,
double val)
Set the mutation rate. |
void |
setNormalizeFitness(double i)
Set the fitness rescaled and normalized in order to manage negative fitness value and improve performance. |
void |
setPlotGraph(double i)
If plot the graphs. |
void |
setPopulationSize(double i)
Set the size of population, that means the number of chromosomes managed by the ga. |
void |
setProjectDesc(java.lang.String projectDesc)
Set project description. |
void |
setProjectName(java.lang.String projectName)
Set project name. |
void |
setProjectType(java.lang.String pt)
Set project type. |
void |
setRandomSeed(double rs)
Set a random number generator for this configuration. |
void |
setStoppingMethod(double stoppingMethod)
Set the stopping method. |
void |
setStoppingValue(double stoppingValue)
Set the stopping value. |
void |
setTurnoverRate(double l)
Set the part of the population that is going to become parents in order to produce the next generation. |
void |
setVerboseness(double logType)
Set the desired level of verbosity during the run. |
| Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public GaConfiguration()
| Method Detail |
public int getChromosomeLength()
public int getChromosomeToReturn()
public int getCrossOverPointNumber(int family)
family - The genome on which consider the parameters.
Events.crossover(Population)public double getCrossOverRate(int family)
family - The genome on which consider the parameters.
public int getDomain(int family)
family - The genome on which consider the parameters.
public java.lang.String getGenomeLabel(int i)
public int getGenomeLength(int family)
family - The genome on which consider the parameters.
Genomepublic int getGenomeType(int family)
family - The genome on which consider the parameters.
Genomepublic int getLogStatistics()
Log.logStats(Population)public double getMutationRate(int family)
family - The genome on which consider the parameters.
public int getPopulationSize()
Populationpublic java.lang.String getProjectDesc()
public java.lang.String getProjectName()
public java.lang.String getProjectType()
public MyRandomMaker getRandomMaker()
MyRandomMakerpublic int getStoppingMethod()
public double getStoppingValue()
public double getTurnoverRate()
public int getVerboseness()
public boolean isFittestNeverDie()
public boolean isMutateAdults()
public boolean isNormalizeFitness()
public boolean isPlotGraph()
public void readParametersFromFile(java.lang.String fileName,
java.lang.String projectName,
java.lang.String projectType)
fileName - XML file name with extension as relative path
(for istance "./config/jGolem.xml")projectName - Project of the XML file fileName from wich read parameters.projectType - Type of project ("ga" for genetic algoritm and "cs" for classifier system)public void setChromosomeLength(double length)
length - Number of genomes contained in each chromosomepublic void setChromosomeToReturn(double chromosomeToReturn)
chromosomeToReturn - The chromosomeToReturn to set.
public void setCrossOverPointNumber(int family,
double val)
family - The genome on which consider the parameters.
public void setCrossOverRate(int family,
double val)
family - The genome on which consider the parameters.val - The cross over rate to set for this genome.
This rate identify the probability of cross over of each
chromosome of the population.
public void setDomain(int family,
double val)
family - The genome on which consider the parameters.val - The domain or alphabet to set for this genome.public void setFittestNeverDie(double i)
i - The fittestNeverDie to set.
public void setGenomeLabel(int family,
java.lang.String label)
label - The genomeLabel to set.
public void setGenomeLength(int family,
double val)
family - The genome on which consider the parameters.val - Number of gene to set for this genome.Genome
public void setGenomeType(int family,
double val)
family - The genome on which consider the parameters.val - Random (0) or univocal (1)Genomepublic void setLogStatistics(double i)
i - Statistics logging optionLog.logStats(Population)public void setMutateAdults(double i)
i - The adultMutation to set.
public void setMutationRate(int family,
double val)
family - The genome on which consider the parameters.val - Mutattion rate to set for the genome.public void setNormalizeFitness(double i)
i - Normalized fitness.public void setPlotGraph(double i)
i - The plotGraph to set.public void setPopulationSize(double i)
i - Population size.Populationpublic void setProjectDesc(java.lang.String projectDesc)
projectDesc - The projectDesc to set.public void setProjectName(java.lang.String projectName)
projectName - The projectName to set.public void setProjectType(java.lang.String pt)
pt - The projectType to set.public void setRandomSeed(double rs)
rs - Random seedMyRandomMakerpublic void setStoppingMethod(double stoppingMethod)
stoppingMethod - The stoppingMethod to set.public void setStoppingValue(double stoppingValue)
stoppingValue - The stoppingValue to set.public void setTurnoverRate(double l)
l - Turn over ratepublic void setVerboseness(double logType)
logType - Verbosenesspublic void initGenomeArrays(int i)
i -
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||