|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectgpalta.core.Evolution
public class Evolution
This is the highest level class of GPalta and stores the whole state of the system. Users should create an instance of Evolution and use it to perform all aspects of a GP run.
Field Summary | |
---|---|
Config |
config
|
EvolutionStats |
evoStats
|
Fitness |
fitness
|
int |
generation
|
Population |
population
|
Constructor Summary | |
---|---|
Evolution(Config config,
boolean initPop)
Creates a new Evolution, loading data from file |
|
Evolution(Config config,
double[][] data,
double[] desiredOutputs,
double[] weights,
boolean initPop)
Creates a new instance of Evolution, using the given data, desiredOutputs and weights |
Method Summary | |
---|---|
void |
eval()
Evaluate the current population. |
void |
evolve()
Evolve one generation. |
protected void |
finalize()
|
Output |
getProcessedOutput(Individual ind)
Evaluate a single Individual and get its output after being further processed by the Fitness |
Output |
getProcessedOutput(Individual ind,
double[][] data)
Evaluate a single Individual and get its "raw" output for every sample, using the supplied data matrix, instead of the one used in evolution. |
Output |
getRawOutput(Individual ind)
Evaluate a single Individual and get its "raw" output for every sample. |
Output |
getRawOutput(Individual ind,
double[][] data)
Evaluate a single Individual and get its "raw" output for every sample, using the supplied data matrix, instead of the one used in evolution. |
void |
read(java.lang.String fileName)
Read Evolution from file. |
void |
save(java.lang.String fileName)
Save Evolution to file. |
Methods inherited from class java.lang.Object |
---|
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public Population population
public Fitness fitness
public int generation
public Config config
public EvolutionStats evoStats
Constructor Detail |
---|
public Evolution(Config config, boolean initPop)
config
- The evolution configurationinitPop
- If true, the population is randomly initialized. Else, nothing is done
(population will be later read from a file)public Evolution(Config config, double[][] data, double[] desiredOutputs, double[] weights, boolean initPop)
config
- The evolution configurationdata
- The current problem's data, where every row correponds to all the
samples for a variable.desiredOutputs
- The desired outputsweights
- The weight (importance) of each sampleinitPop
- If true, the population is randomly initialized. Else, nothing is done
(population will be later read from a file)Method Detail |
---|
public void eval()
public Output getRawOutput(Individual ind)
public Output getRawOutput(Individual ind, double[][] data)
ind
- The individual to evaluatedata
- A matrix with all the samples in which to evaluate the individual
public Output getProcessedOutput(Individual ind)
public Output getProcessedOutput(Individual ind, double[][] data)
ind
- The individual to evaluatedata
- A matrix with all the samples in which to evaluate the individual
public void evolve()
public void save(java.lang.String fileName) throws java.io.IOException
fileName
- The file to write to
java.io.IOException
- if a problem is encountered while writing (controlling classes should do
something about it)public void read(java.lang.String fileName) throws java.io.IOException, java.lang.ClassNotFoundException
fileName
- The file to be read
java.io.IOException
- if a problem is encountered while reading (controlling classes
should do something about it)
java.lang.ClassNotFoundException
- if class read doesn't match existing classes (probably old
data in file)protected void finalize()
finalize
in class java.lang.Object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |