JAGA Homepage

org.jaga.individualRepresentation.greycodedNumbers
Class NNumbersGreycodedIndivudual

java.lang.Object
  extended by org.jaga.individualRepresentation.greycodedNumbers.NNumbersGreycodedIndivudual
All Implemented Interfaces:
BinaryEncodedIndividual, Individual
Direct Known Subclasses:
NDecimalsIndividual

public class NNumbersGreycodedIndivudual
extends java.lang.Object
implements BinaryEncodedIndividual

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

Version:
JAGA public release 1.0 beta
Author:
Greg Paperin (greg@jaga.org)

Field Summary
private  Fitness fitness
           
private  int precision
           
private  BitString representation
           
private  int size
           
 
Constructor Summary
private NNumbersGreycodedIndivudual()
           
  NNumbersGreycodedIndivudual(int size, int precision)
           
 
Method Summary
protected  BitString bin2grey(BitString bin)
           
 BitString getBitStringRepresentation()
           
protected  BitString getClearBitCode(int valueIndex)
           
 Fitness getFitness()
          Gets the individual's fitness.
 int getPrecision()
           
 int getSize()
           
protected  BitString grey2bin(BitString grey)
           
 void setBitStringRepresentation(BitString bits)
           
protected  void setClearBitCode(int valueIndex, BitString clear)
           
 void setFitness(Fitness fitness)
          Sets the fitness.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.jaga.definitions.Individual
toString
 

Field Detail

representation

private BitString representation

size

private int size

fitness

private Fitness fitness

precision

private int precision
Constructor Detail

NNumbersGreycodedIndivudual

private NNumbersGreycodedIndivudual()

NNumbersGreycodedIndivudual

public NNumbersGreycodedIndivudual(int size,
                                   int precision)
Method Detail

getPrecision

public int getPrecision()

getSize

public int getSize()

getBitStringRepresentation

public BitString getBitStringRepresentation()
Specified by:
getBitStringRepresentation in interface BinaryEncodedIndividual

setBitStringRepresentation

public void setBitStringRepresentation(BitString bits)
Specified by:
setBitStringRepresentation in interface BinaryEncodedIndividual

getFitness

public Fitness getFitness()
Description copied from interface: Individual
Gets the individual's fitness.

Specified by:
getFitness in interface Individual
Returns:
The fitness object assosiated with this individual or null if no fitness is associated.

setFitness

public void setFitness(Fitness fitness)
Description copied from interface: Individual
Sets the fitness.

Specified by:
setFitness in interface Individual
Parameters:
fitness - The new fitness for this individual.

getClearBitCode

protected BitString getClearBitCode(int valueIndex)

setClearBitCode

protected void setClearBitCode(int valueIndex,
                               BitString clear)

grey2bin

protected BitString grey2bin(BitString grey)

bin2grey

protected BitString bin2grey(BitString bin)

JAGA Homepage

Go to JAGA Homepage