gpsys.symreg
Class SymReg
java.lang.Object
|
+--gpsys.symreg.SymReg
- public class SymReg
- extends java.lang.Object
- implements GPObserver
The user interface for the symbolic regression problem. This class
also contains the main() function to execute the application.
- Version:
- $Revision: 1.1 $, $Date: 2000/07/05 16:25:51 $
- Author:
- Adil Qureshi
Department of Computer Science,
University College London,
Gower St,
London WC1E 6BT,
UK.
|
Field Summary |
(package private) java.lang.String |
filePrefix
The filePrefix to use when saving reports and generation states during
evolution. |
|
Constructor Summary |
SymReg(java.lang.String filePrefix)
Construct the symbolic regression user interface using the specified
file prefix. |
|
Method Summary |
void |
diagnosticUpdate(java.lang.String s)
Print the diagnostic message to the standard output. |
void |
exception(GPException e)
Print the exception and generate a stack trace on the standard output. |
void |
generationUpdate(GPParameters gpParameters,
int how)
If the filePrefix is null, just write a report of the current generation
to the standard output. |
void |
individualUpdate(GPParameters gpParameters,
Individual i,
int creationIndex)
We are not interested in this update, so we just ignore it. |
void |
individualUpdate(GPParameters gpParameters,
int individualIndex,
int creationIndex)
We are not interested in this update, so we just ignore it. |
static void |
main(java.lang.String[] argv)
The main() method of the symbolic regression application. |
| Methods inherited from class java.lang.Object |
,
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
registerNatives,
toString,
wait,
wait,
wait |
filePrefix
java.lang.String filePrefix
- The filePrefix to use when saving reports and generation states during
evolution.
SymReg
public SymReg(java.lang.String filePrefix)
- Construct the symbolic regression user interface using the specified
file prefix.
- Parameters:
filePrefix - The file prefix to bse used for saving reports and
generation states.
generationUpdate
public void generationUpdate(GPParameters gpParameters,
int how)
- If the filePrefix is null, just write a report of the current generation
to the standard output. Otherwise, also append the report to the file
"filePrefix.txt" and save the current generation to the file
"filePrefix.p1.gzip".
- Specified by:
- generationUpdate in interface GPObserver
- Parameters:
gpParameters - The GP parameters used for this run.how - How the generation was created. Can be either
CREATION, FROMSTREAM or EVOLVED.
individualUpdate
public void individualUpdate(GPParameters gpParameters,
Individual i,
int creationIndex)
- We are not interested in this update, so we just ignore it.
- Specified by:
- individualUpdate in interface GPObserver
- Parameters:
gpParameters - the GP parameters used for this run.i - the Individual that has just been created.creationIndex - the index of the Individual in the population.
individualUpdate
public void individualUpdate(GPParameters gpParameters,
int individualIndex,
int creationIndex)
- We are not interested in this update, so we just ignore it.
- Parameters:
gpParameters - the GP parameters used for this run.individualIndex - the index of the created Individual in the
population.creationMethod - how the Individual was created. Can be either
VIA_MUTATION or VIA_CROSSOVER.
diagnosticUpdate
public void diagnosticUpdate(java.lang.String s)
- Print the diagnostic message to the standard output.
- Specified by:
- diagnosticUpdate in interface GPObserver
- Parameters:
s - The diagnostic message.
exception
public void exception(GPException e)
- Print the exception and generate a stack trace on the standard output.
- Specified by:
- exception in interface GPObserver
- Parameters:
e - The exception that was genearted.
main
public static void main(java.lang.String[] argv)
- The main() method of the symbolic regression application. This
application may be invoked in any of the following ways.
java SymReg <filePrefix>
java SymReg <filePrefix> <generations>
java SymReg <filePrefix> <RNG seed> <population> <generations>
java SymReg <RNG seed> <population> <generations>
The first istructs the application to restart from the last saved
session using the files with the prefix specified. The second is the
same as the first, execept that the maximum number of geneartion is
modified as specified. The third istructs the application to start
a new run using the specifed file prefix for saves, and the
specified parameters for the run. The last is the similar to the
previous invokation except that nothing is saved to disk and is hence
very fast.