Orbital library

Class Gene.Fixed

  extended by orbital.algorithm.evolutionary.Gene.BitSet
      extended by orbital.algorithm.evolutionary.Gene.Fixed
All Implemented Interfaces:
java.io.Serializable, Gene
Enclosing interface:

public static class Gene.Fixed
extends Gene.BitSet

Fixed point gene data.

This implementation uses a Gene.BitSet encoded fixed-point numbers as gene data.

Note that default uniform mutations and recombinations have a dramatic effect on bit string encoded values.

André Platzer
See Also:
Gene.Number, Serialized Form

Nested Class Summary
Nested classes/interfaces inherited from interface orbital.algorithm.evolutionary.Gene
Gene.BitSet, Gene.BoundedFloat, Gene.BoundedInteger, Gene.Fixed, Gene.Float, Gene.Integer, Gene.List, Gene.Number
Constructor Summary
Gene.Fixed(int integerGranularity, int fractionalGranularity)
Method Summary
 java.lang.Object get()
          Get the gene interpretation value.
protected  int getFractionalGranularity()
          Get the number of bits for the fractional part.
protected  int getIntegerGranularity()
          Get the number of bits for the integer part.
protected  int getSignGranularity()
          Get the number of bits for the sign part.
 void set(java.lang.Object n)
          Set the gene value.
Methods inherited from class orbital.algorithm.evolutionary.Gene.BitSet
clone, distanceMeasure, equals, get, hashCode, inverse, length, mutate, recombine, set, toString
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait

Constructor Detail


public Gene.Fixed(int integerGranularity,
                  int fractionalGranularity)
Method Detail


public java.lang.Object get()
Description copied from interface: Gene
Get the gene interpretation value.

Useful for interpreting a gene for fitness evaluation and interpretation of solutions.

Specified by:
get in interface Gene
get in class Gene.BitSet
the Object represented by this gene. Interprets gene by decoding its data.


public void set(java.lang.Object n)
Description copied from interface: Gene
Set the gene value.

Consider setting fitness to Double.NaN due to the change to remind evaluator.

Specified by:
set in interface Gene
set in class Gene.BitSet
n - the Object this gene should represent. Encodes the value such that this gene represents the given object.


protected int getIntegerGranularity()
Get the number of bits for the integer part.


protected int getFractionalGranularity()
Get the number of bits for the fractional part.


protected int getSignGranularity()
Get the number of bits for the sign part.

Orbital library
1.3.0: 11 Apr 2009

Copyright © 1996-2009 André Platzer
All Rights Reserved.