All Packages  Class Hierarchy  This Package  Previous  Next  Index

Interface gpsys.GPObserver

public 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:
1.1, 30th June '97
Author:
Adil Qureshi
Department of Computer Science,
University College London,
Gower St,
London WC1E 6BT,
UK.

Variable Index

 o CREATION
Used to indicate that the generation update is for the 0th generation.
 o EVOLVED
Used to indicate that the generation update represents a generation that has been evolved.
 o FROMSTREAM
Used to indicate that the generation update represents a generation loaded from a stream.
 o VIA_CROSSOVER
Used to indicate that an Individual was created via crossover.
 o VIA_MUTATION
Used to indicate that an Individual was created via mutation.

Method Index

 o diagnosticUpdate(String)
Invoked by the GP system whenever something interesting occurs, the supplied String indictates what happened.
 o exception(GPException)
Invoked by the GP system whenever an exception occurs, override this to do something useful such as print a stack trace.
 o generationUpdate(GPParameters, int)
Invoked by the GP system whenever a new generation has been created.
 o individualUpdate(GPParameters, Individual, int)
Invoked by the GP system whenever a new Individual has been created during the generation of the initial population.
 o individualUpdate(GPParameters, int, int)
Invoked by the GP system whenever a new Individual has been created during evolution.

Variables

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

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

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

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

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

Methods

 o generationUpdate
 public abstract 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.
 o individualUpdate
 public abstract void individualUpdate(GPParameters gpParameters,
                                       Individual i,
                                       int creationIndex)
Invoked by the GP system whenever a new Individual has been created during the generation of the initial population.

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 abstract void individualUpdate(GPParameters gpParameters,
                                       int individualIndex,
                                       int creationMethod)
Invoked by the GP system whenever a new Individual has been created during evolution.

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 abstract void diagnosticUpdate(String s)
Invoked by the GP system whenever something interesting occurs, the supplied String indictates what happened.

Parameters:
s - a String describing the event.
 o exception
 public abstract 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.

All Packages  Class Hierarchy  This Package  Previous  Next  Index