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,

Variable Index

 o filePrefix
The file prefix to use for saving generations and writing reports.
 o panel1
 o panel2
 o panel3
 o terrain

Constructor Index

 o CosSim(Terrain, String)
Construct a terrain robot user interface.

Method Index

 o diagnosticUpdate(String)
Print the diagnostic message to the standard output.
 o exception(GPException)
Print the exception and generate a stack trace on the standard output.
 o generationUpdate(GPParameters, int)
If the filePrefix is null, just write a report of the current generation to the standard output.
 o individualUpdate(GPParameters, Individual, int)
We are not interested in this update, so we just ignore it.
 o individualUpdate(GPParameters, int, int)
We are not interested in this update, so we just ignore it.
 o main(String[])
The main() method of the terrain robot application.

Variables

 o terrain
 Terrain terrain
 o filePrefix
 String filePrefix
The file prefix to use for saving generations and writing reports.

 o panel1
 Panel panel1
 o panel2
 Panel panel2
 o panel3
 Panel panel3

Constructors

 o 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.

Methods

 o 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.
 o 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.
 o 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.
 o diagnosticUpdate
 public void diagnosticUpdate(String s)
Print the diagnostic message to the standard output.

Parameters:
s - The diagnostic message.
 o 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.
 o 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