|
JAGA Homepage | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.jaga.individualRepresentation.booleanFormulas.BooleanFormulaTree
TODO: Complete these comments.
Project: JAGA - Java API for Genetic Algorithms.
Company: University College London and JAGA.Org (http://www.jaga.org).
Copyright: (c) 2004 by G. Paperin.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, ONLY if you include a note of the original
author(s) in any redistributed/modified copy.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
or see http://www.gnu.org/licenses/gpl.html
| Field Summary | |
|---|---|
private Fitness |
fitness
|
private long |
nextHandleToGenerate
|
private java.util.HashMap |
nodes
|
private int |
numberOfParameters
|
private BooleanFormulaTreeNode |
root
|
| Constructor Summary | |
|---|---|
private |
BooleanFormulaTree()
|
|
BooleanFormulaTree(int numberOfParameters)
|
| Method Summary | |
|---|---|
private void |
addToNodeList(BooleanFormulaTreeNode node,
int depth)
|
boolean |
evaluate(boolean[] parameters)
|
BooleanFormulaTreeNode |
exportNode(java.lang.Long handle)
|
private java.lang.Long |
generateNewHandle()
|
Fitness |
getFitness()
Gets the individual's fitness. |
java.util.Iterator |
getHandlersIterator()
|
private BooleanFormulaTreeNode |
getNode(java.lang.Long handle)
|
int |
getNodeCount()
|
int |
getNodeDepth(java.lang.Long handle)
|
int |
getNodeHeight(java.lang.Long handle)
|
int |
getNumberOfParameters()
|
private void |
removeFromNodeList(BooleanFormulaTreeNode node)
|
void |
replaceNode(java.lang.Long oldNodeHandle,
BooleanFormulaTreeNode newNode)
|
java.lang.Long |
selectRandomNode(GAParameterSet params)
|
java.lang.Long |
selectRootNode()
|
void |
setFitness(Fitness fitness)
Sets the fitness. |
java.lang.String |
toString()
Produces a string representation of this individuial. |
java.lang.String |
toString(boolean infix)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
private int numberOfParameters
private Fitness fitness
private java.util.HashMap nodes
private BooleanFormulaTreeNode root
private long nextHandleToGenerate
| Constructor Detail |
|---|
private BooleanFormulaTree()
public BooleanFormulaTree(int numberOfParameters)
| Method Detail |
|---|
private java.lang.Long generateNewHandle()
public Fitness getFitness()
Individual
getFitness in interface Individualnull
if no fitness is associated.public void setFitness(Fitness fitness)
Individual
setFitness in interface Individualfitness - The new fitness for this individual.public int getNumberOfParameters()
public java.lang.Long selectRootNode()
public int getNodeCount()
public java.lang.Long selectRandomNode(GAParameterSet params)
public java.util.Iterator getHandlersIterator()
public BooleanFormulaTreeNode exportNode(java.lang.Long handle)
public int getNodeDepth(java.lang.Long handle)
public int getNodeHeight(java.lang.Long handle)
private BooleanFormulaTreeNode getNode(java.lang.Long handle)
public void replaceNode(java.lang.Long oldNodeHandle,
BooleanFormulaTreeNode newNode)
public boolean evaluate(boolean[] parameters)
public java.lang.String toString()
Individual
toString in interface IndividualtoString in class java.lang.Objectpublic java.lang.String toString(boolean infix)
private void removeFromNodeList(BooleanFormulaTreeNode node)
private void addToNodeList(BooleanFormulaTreeNode node,
int depth)
|
JAGA Homepage | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||