|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object | +--gpsys.GPParameters
This class is used to parameterise the GP system. Use this class as is or extend it for your problem, but in either case fill in the instance variables to specify your problem.
The class supports methods enabling loading and saving of a GPParameters object. The object may be written/read to/from either a file or a stream. These methods use Java Serialisable Objects and hence if you extend the class to include new instance variables, ensure that they are Serializable so that they can be saved. If any instance variables you introduce are temporary variables, declare them transient to ensure they are not saved.
There are also methods enabling a generation report to be sent to a file or an OutputStream.
| Field Summary | |
ChromosomeParameters[] |
adf
Parameters for each ADF to be evolved. |
protected int |
creationIndex
Used during the generation of the initial popupation. |
int |
engine
The engine to be used for evolution. |
static int |
ENGINE_GENERATIONAL
Used for selecting the generational engine type. |
static int |
ENGINE_STEADYSTATE
Used for selecting the steady state engine type. |
Fitness |
fitness
The Fitness definition for the problem. |
int |
generations
The number of generations to evolve. |
GPObserver |
observer
The object monitoring the GP system. |
double |
pMutation
The probability of mutation. |
Population |
population
The population. |
int |
populationSize
How many Individuals there are in the population. |
double |
pReproduction
The probability of Reproduction. |
java.util.Random |
rng
The random number generator. |
long |
rngSeed
The random number generator seed. |
int |
tournamentSize
The tournament size to be used for tournament selection during crossover and mutation. |
| Constructor Summary | |
GPParameters()
|
|
| Method Summary | |
static GPParameters |
load(java.io.InputStream is)
Load a GPParameters object from the InputStream. |
static GPParameters |
load(java.lang.String filePrefix)
Loads a previously saved GPParameters object from the file specified. |
void |
save(java.io.OutputStream os)
Write this object to an OutputStream compressing it using gzip as it is written. |
void |
save(java.lang.String filePrefix)
Save this object to a file compressing it using gzip during the save. |
void |
writeReport(java.io.PrintWriter pw,
boolean firstReport)
Write a report of the current generation to the PrintWriter. |
void |
writeReport(java.lang.String filePrefix,
boolean firstReport)
Write a report of the current generation to a file. |
| Methods inherited from class java.lang.Object |
|
| Field Detail |
public transient GPObserver observer
public int engine
public static final int ENGINE_STEADYSTATE
public static final int ENGINE_GENERATIONAL
public long rngSeed
public java.util.Random rng
public double pMutation
public double pReproduction
public int tournamentSize
public int populationSize
public int generations
public ChromosomeParameters[] adf
public Fitness fitness
public Population population
protected int creationIndex
| Constructor Detail |
public GPParameters()
| Method Detail |
public void save(java.lang.String filePrefix)
throws java.io.IOException
filePrefix - the file prefix to be used for save files. Two
files may be created :-
filePrefix.p1.gzip and
filePrefix.p2.gzip
public void save(java.io.OutputStream os)
throws java.io.IOException
os - the output stream to be written to.
public static GPParameters load(java.lang.String filePrefix)
throws java.io.IOException,
java.lang.ClassNotFoundException
filePrefix - the file prefix used by the save files.
public static GPParameters load(java.io.InputStream is)
throws java.io.IOException,
java.lang.ClassNotFoundException
is - the input stream to read from.
public void writeReport(java.io.PrintWriter pw,
boolean firstReport)
pw - the PrintWriter to use to print the report.firstReport - specifies whether this the first report.
public void writeReport(java.lang.String filePrefix,
boolean firstReport)
throws java.io.IOException
filePrefix - the filename prefix to use for the file to which
the report is written. The file created is named :
filePrefix.txtfirstReport - specifies whether this the first report.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||