gpsys
Interface GPObserver

All Known Implementing Classes:
LawnMower, SymReg

public abstract interface GPObserver

Classes that implement this interface can become observers of the GP system. By defining the functions of this interface they can monitor important events such as the creation of new Individuals and the completion of a generation.

Version:
$Revision: 1.1 $, $Date: 2000/07/05 16:21:25 $
Author:
Adil Qureshi
Department of Computer Science,
University College London,
Gower St,
London WC1E 6BT,
UK.

Field Summary
static int CREATION
          Used to indicate that the generation update is for the 0th generation.
static int EVOLVED
          Used to indicate that the generation update represents a generation that has been evolved.
static int FROMSTREAM
          Used to indicate that the generation update represents a generation loaded from a stream.
static int VIA_CREATION
          Used to indicate that an Individual was created via creation.
static int VIA_CROSSOVER
          Used to indicate that an Individual was created via crossover.
static int VIA_MUTATION
          Used to indicate that an Individual was created via mutation.
static int VIA_REPRODUCTION
          Used to indicate that an Individual was created via reproduction.
 
Method Summary
 void diagnosticUpdate(java.lang.String s)
          Invoked by the GP system whenever something interesting occurs, the supplied String indictates what happened.
 void exception(GPException e)
          Invoked by the GP system whenever an exception occurs, override this to do something useful such as print a stack trace.
 void generationUpdate(GPParameters gpParameters, int how)
          Invoked by the GP system whenever a new generation has been created.
 void individualUpdate(GPParameters gpParameters, Individual i, int creationMethod)
          Invoked by the GP system whenever a new Individual has been created.
 

Field Detail

VIA_MUTATION

public static final int VIA_MUTATION
Used to indicate that an Individual was created via mutation.

VIA_CROSSOVER

public static final int VIA_CROSSOVER
Used to indicate that an Individual was created via crossover.

VIA_REPRODUCTION

public static final int VIA_REPRODUCTION
Used to indicate that an Individual was created via reproduction.

VIA_CREATION

public static final int VIA_CREATION
Used to indicate that an Individual was created via creation.

CREATION

public static final int CREATION
Used to indicate that the generation update is for the 0th generation.

FROMSTREAM

public static final int FROMSTREAM
Used to indicate that the generation update represents a generation loaded from a stream.

EVOLVED

public static final int EVOLVED
Used to indicate that the generation update represents a generation that has been evolved.
Method Detail

generationUpdate

public void generationUpdate(GPParameters gpParameters,
                             int how)
Invoked by the GP system whenever a new generation has been created.
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 creationMethod)
Invoked by the GP system whenever a new Individual has been created.
Parameters:
gpParameters - the GP parameters used for this run.
i - the Individual that has just been created.
creationMethod - how the Individual was created. Can be either VIA_CREATION, VIA_REPRODUCTION, VIA_MUTATION or VIA_CROSSOVER.

diagnosticUpdate

public void diagnosticUpdate(java.lang.String s)
Invoked by the GP system whenever something interesting occurs, the supplied String indictates what happened.
Parameters:
s - a String describing the event.

exception

public void exception(GPException e)
Invoked by the GP system whenever an exception occurs, override this to do something useful such as print a stack trace.
Parameters:
e - The Exception that was raised.