Orbital library

orbital.algorithm.evolutionary
Class Gene.BoundedInteger

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

public static class Gene.BoundedInteger
extends Gene.Integer

Bounded integer gene data.

This implementation uses an Integer 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.BoundedInteger(int min, int max)
           
Gene.BoundedInteger(int data, int min, int max)
           
 
Method Summary
 java.lang.Object clone()
          Returns a clone of this gene.
 boolean equals(java.lang.Object o)
          Checks two gene numbers for equality according to their doubleValue.
 int getMax()
          Get the upper bound for value.
 int getMin()
          Get the lower bound for value.
 int hashCode()
          Calculates a hash code according to the doubleValue.
 void set(int n)
           
 
Methods inherited from class orbital.algorithm.evolutionary.Gene.Integer
doubleValue, get, intValue, recombine, set, toString
 
Methods inherited from class orbital.algorithm.evolutionary.Gene.Number
distanceMeasure, floatValue, inverse, longValue, mutate
 
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.BoundedInteger

public Gene.BoundedInteger(int data,
                           int min,
                           int max)

Gene.BoundedInteger

public Gene.BoundedInteger(int min,
                           int max)
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.Integer

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

equals

public boolean equals(java.lang.Object o)
Description copied from class: Gene.Number
Checks two gene numbers for equality according to their doubleValue.

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

getMin

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


getMax

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


set

public void set(int n)
Overrides:
set in class Gene.Integer

Orbital library
1.3.0: 11 Apr 2009

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