Orbital library

orbital.algorithm.evolutionary
Class Gene.BoundedFloat

java.lang.Object
  extended by java.lang.Number
      extended by orbital.algorithm.evolutionary.Gene.Number
          extended by orbital.algorithm.evolutionary.Gene.Float
              extended by orbital.algorithm.evolutionary.Gene.BoundedFloat
All Implemented Interfaces:
java.io.Serializable, Gene
Enclosing interface:
Gene

public static class Gene.BoundedFloat
extends Gene.Float

Bounded floating point gene data.

This implementation uses a floating-point Double bounded to a specified range as Gene data.

Author:
André Platzer
See Also:
Serialized Form
Invariants:
data ∈ [min, max]

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.BoundedFloat(double min, double max)
          Construct a non-initialized BoundedFloat.
Gene.BoundedFloat(double data, double min, double max)
           
 
Method Summary
 java.lang.Object clone()
          Returns a clone of this gene.
 boolean equals(java.lang.Object o)
          Checks for equality.
 double getMax()
          Get the upper bound for value.
 double getMin()
          Get the lower bound for value.
 int hashCode()
          Calculates a hash code according to the doubleValue.
 void set(double n)
           
 
Methods inherited from class orbital.algorithm.evolutionary.Gene.Float
doubleValue, get, recombine, set
 
Methods inherited from class orbital.algorithm.evolutionary.Gene.Number
distanceMeasure, floatValue, intValue, inverse, longValue, mutate, toString
 
Methods inherited from class java.lang.Number
byteValue, shortValue
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Gene.BoundedFloat

public Gene.BoundedFloat(double data,
                         double min,
                         double max)

Gene.BoundedFloat

public Gene.BoundedFloat(double min,
                         double max)
Construct a non-initialized BoundedFloat.

Note: non-initialized (that is Double.NaN) Floats are immune to mutation which is no good starting-point for creating a population.

Method Detail

clone

public java.lang.Object clone()
Description copied from interface: Gene
Returns a clone of this gene.

Specified by:
clone in interface Gene
Overrides:
clone in class Gene.Float

equals

public boolean equals(java.lang.Object o)
Checks for equality.

Specified by:
equals in interface Gene
Overrides:
equals in class Gene.Number

hashCode

public int hashCode()
Description copied from class: Gene.Number
Calculates a hash code according to the doubleValue.

Specified by:
hashCode in interface Gene
Overrides:
hashCode in class Gene.Number

set

public void set(double n)
Overrides:
set in class Gene.Float

getMin

public double getMin()
Get the lower bound for value.


getMax

public double getMax()
Get the upper bound for value.


Orbital library
1.3.0: 11 Apr 2009

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