Class gpjpp.GPAdfNodeSet
All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class gpjpp.GPAdfNodeSet

java.lang.Object
   |
   +----gpjpp.GPObject
           |
           +----gpjpp.GPContainer
                   |
                   +----gpjpp.GPAdfNodeSet

public class GPAdfNodeSet
extends GPContainer
Stores information about the functions and terminals used in all branches of a particular genetic programming problem.

GPAdfNodeSet holds a GPNodeSet for the result-producing branch of the tree and also one for each ADF.

Because this class has no data fields of its own, its load and save methods are inherited unchanged from GPContainer.

Version:
1.0

Constructor Index

 o GPAdfNodeSet()
Public null constructor used during stream loading only.
 o GPAdfNodeSet(GPAdfNodeSet)
A constructor that can be called to clone a GPAdfNodeSet.
 o GPAdfNodeSet(int)
The constructor called by user code to reserve space for the branches in each GP.

Method Index

 o clone()
Implements the Cloneable interface.
 o equals(Object)
Determines whether this GPAdfNodeSet equals another object.
 o isA()
Returns a code identifying the class in a stream file.
 o printOn(PrintStream, GPVariables)
Writes a GPAdfNodeSet in text format to a PrintStream.

Constructors

 o GPAdfNodeSet
  public GPAdfNodeSet()
Public null constructor used during stream loading only.
 o GPAdfNodeSet
  public GPAdfNodeSet(int numOfTrees)
The constructor called by user code to reserve space for the branches in each GP. The zeroth branch is always the result-producing branch. The other branches, if any, are ADFs that can be called from the zeroth branch.

The supplied example programs show how to create GPAdfNodeSets with and without ADFs.

Parameters:
numOfTrees - the number of branches in each individual.
 o GPAdfNodeSet
  public GPAdfNodeSet(GPAdfNodeSet gpo)
A constructor that can be called to clone a GPAdfNodeSet. Normally not used.

Methods

 o clone
  protected synchronized Object clone()
Implements the Cloneable interface. This clones a GPAdfNodeSet but is normally not used.
Returns:
the cloned object.
Overrides:
clone in class GPContainer
 o isA
  public byte isA()
Returns a code identifying the class in a stream file.
Returns:
the ID code ADFNODESETID.
Overrides:
isA in class GPContainer
 o equals
  public boolean equals(Object obj)
Determines whether this GPAdfNodeSet equals another object. It returns true if obj is not null, is an instance of a GPAdfNodeSet (or a descendant), and contains the same GPNodeSet values. This function is called when a checkpoint is loaded by GPRun, to determine whether the program and the checkpoint are consistent.
Parameters:
obj - any Java object reference, including null.
Returns:
true if this and obj are equivalent.
Overrides:
equals in class Object
 o printOn
  public void printOn(PrintStream os,
                      GPVariables cfg)
Writes a GPAdfNodeSet in text format to a PrintStream. Each node set is labeled as "RPB" or "ADFn" depending on its position within the GPAdfNodeSet.
Overrides:
printOn in class GPContainer

All Packages  Class Hierarchy  This Package  Previous  Next  Index