gpsys
Class ParentInfo

java.lang.Object
  |
  +--gpsys.ParentInfo

public class ParentInfo
extends java.lang.Object

This class is used to hold information about the genetic operations involving a a particular parent. The class is used in the implementation of memory efficient crossover as described in Genetic Programming III.

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
(package private) static int BUSY
          A parent is busy if it has one or more outstanding genetic operations to be performed.
(package private)  java.util.LinkedList crossoverParents
          A list containing information about parents involved in crossover operations with this parent.
(package private) static int DEAD
          A parent has this state if it has expired and been replaced a new Individual.
(package private) static int FREE
          A parent is deemed free if it has no outstanding genetic operations and it has not already been replaced in the population.
(package private)  int id
          The index of this parent in the population.
(package private)  int mutationCount
          A count of how many mutation operations involving this parent.
(package private)  ParentInfo next
          Points to the next parent information block in the list that this parent is contained within.
(package private)  ParentInfo prev
          Points to the previous parent information block in the list that this parent is contained within.
(package private)  int reproductionCount
          A count of how many reproduction operations involving this parent.
(package private)  int state
          The state of this parent.
(package private)  int totalOperationsCount
          A count of the total number of genetic operations involving this parent.
 
Constructor Summary
ParentInfo(int id)
          Constructs a ParentInfo data object for the specified parent.
 
Method Summary
 int addCrossover(ParentInfo parent2)
          Adds a crossover operation to this parent.
 int addMutation()
          Adds a mutation operation to this parent.
 int addReproduction()
          Adds a reproduction operation to this parent.
 int getId()
          Get the index of this individual in the population.
 int getOperations()
          Get a count of the total number of genetic operations involving this parent.
 void kill()
          Kill this individual, which just sets the state to DEAD.
 void removeCrossover(ParentInfo parent2)
          Remove the crossover operation involving the specified second parent.
 GeneticOperation removeOperation()
          Remove an operation from this parent.
 void reset()
          Reset this instance.
 java.lang.String toString()
          Creates a string representing the state of this object.
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, wait, wait, wait
 

Field Detail

mutationCount

int mutationCount
A count of how many mutation operations involving this parent.

reproductionCount

int reproductionCount
A count of how many reproduction operations involving this parent.

crossoverParents

java.util.LinkedList crossoverParents
A list containing information about parents involved in crossover operations with this parent.

totalOperationsCount

int totalOperationsCount
A count of the total number of genetic operations involving this parent.

id

int id
The index of this parent in the population.

state

int state
The state of this parent. The state can be any one of the three predefined states, which are DEAD, FREE and BUSY.

DEAD

static final int DEAD
A parent has this state if it has expired and been replaced a new Individual.

FREE

static final int FREE
A parent is deemed free if it has no outstanding genetic operations and it has not already been replaced in the population.

BUSY

static final int BUSY
A parent is busy if it has one or more outstanding genetic operations to be performed.

prev

ParentInfo prev
Points to the previous parent information block in the list that this parent is contained within.

next

ParentInfo next
Points to the next parent information block in the list that this parent is contained within.
Constructor Detail

ParentInfo

public ParentInfo(int id)
Constructs a ParentInfo data object for the specified parent.
Parameters:
id - The index of the individual for which parenting information is maintained.
Method Detail

addCrossover

public int addCrossover(ParentInfo parent2)
Adds a crossover operation to this parent.
Parameters:
parent2 - The second parent involved in the crossover.
Returns:
A count of the total operations remaining for this parent.

addMutation

public int addMutation()
Adds a mutation operation to this parent.
Returns:
A count of the total operations remaining for this parent.

addReproduction

public int addReproduction()
Adds a reproduction operation to this parent.
Returns:
A count of the total operations remaining for this parent.

removeOperation

public GeneticOperation removeOperation()
Remove an operation from this parent. Operations involving just one parent are always removed first.
Returns:
A genetic operation, which is currently either a mutation, reproduction or crossover operation.

removeCrossover

public void removeCrossover(ParentInfo parent2)
Remove the crossover operation involving the specified second parent.
Parameters:
parent2 - The second parent involved in the crossover operation.

getOperations

public int getOperations()
Get a count of the total number of genetic operations involving this parent.

getId

public int getId()
Get the index of this individual in the population.
Returns:
The indentifier for this parent which equals it's index in the population.

kill

public void kill()
Kill this individual, which just sets the state to DEAD.

reset

public void reset()
Reset this instance. This involves disassociating from it from any of the four lists and clearing genetic operation information.

toString

public java.lang.String toString()
Creates a string representing the state of this object.
Returns:
A String representing the state of this object.
Overrides:
toString in class java.lang.Object