All Packages Class Hierarchy This Package Previous Next Index
Class gpsys.cos.CosSim
java.lang.Object
|
+----java.awt.Component
|
+----java.awt.Container
|
+----java.awt.Window
|
+----java.awt.Frame
|
+----gpsys.cos.CosSim
- public class CosSim
- extends Frame
- implements GPObserver
The user interface for the terrain robot problem. This class
also contains the main() function to execute the application.
- Author:
- Emmanuel PIERRE
DEA IARFA,
-
filePrefix
- The file prefix to use for saving generations and writing reports.
-
panel1
-
-
panel2
-
-
panel3
-
-
terrain
-
-
CosSim(Terrain, String)
- Construct a terrain robot user interface.
-
diagnosticUpdate(String)
- Print the diagnostic message to the standard output.
-
exception(GPException)
- Print the exception and generate a stack trace on the standard output.
-
generationUpdate(GPParameters, int)
- If the filePrefix is null, just write a report of the current generation
to the standard output.
-
individualUpdate(GPParameters, Individual, int)
- We are not interested in this update, so we just ignore it.
-
individualUpdate(GPParameters, int, int)
- We are not interested in this update, so we just ignore it.
-
main(String[])
- The main() method of the terrain robot application.
terrain
Terrain terrain
filePrefix
String filePrefix
- The file prefix to use for saving generations and writing reports.
panel1
Panel panel1
panel2
Panel panel2
panel3
Panel panel3
CosSim
public CosSim(Terrain terrain,
String filePrefix)
- Construct a terrain robot user interface.
- Parameters:
- terrain - The terrain being mowed.
- terrain - The file prefix to use for saving generations and writing
reports.
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". If the termination criteria has been met, or the
maximum number of generations have been reached, visualise the
best terrain robot in action!!!
- 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.
- 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 creationMethod)
- 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(String s)
- Print the diagnostic message to the standard output.
- Parameters:
- s - The diagnostic message.
exception
public void exception(GPException e)
- Print the exception and generate a stack trace on the standard output.
- Parameters:
- e - The exception that was genearted.
main
public static void main(String argv[])
- The main() method of the terrain robot application. This
application may be invoked in any of the following ways.
java CosSim <filePrefix>
java CosSim <filePrefix> <generations>
java CosSim <filePrefix> <RNG seed> <population> <generations>
java CosSim <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.
All Packages Class Hierarchy This Package Previous Next Index