jenes.tutorials.problem5
Class DoubleAlleleSet

java.lang.Object
  extended by jenes.chromosome.GenericAlleleSet<java.lang.Double>
      extended by jenes.tutorials.problem5.DoubleAlleleSet
All Implemented Interfaces:
AlleleSet<java.lang.Double>

public class DoubleAlleleSet
extends GenericAlleleSet<java.lang.Double>

Tutorial illustrating the use of object-oriented chromosomes, whose allele set can be defined by the user for each gene. In this example the chromosomes are combinations of colors. We aim at finding the vector of colors closest to a given sequence. This class defines an allele set made of doubles.

Since:
1.0
Version:
1.0
Author:
Luigi Troiano, Pierpaolo Lombardi

Constructor Summary
DoubleAlleleSet(java.util.Set<java.lang.Double> set)
           
 
Method Summary
static DoubleAlleleSet createRandom(int size, double lowerBound, double upperBound)
          Builds a DoubleAlleleSet with random values within the range [lowerBound,upperBound]
static DoubleAlleleSet createUniform(int size, int lowerBound, int upperBound)
          Builds a new DoubleAlleleSet with uniformly distributed values within the range [lowerBound,upperBound]
 
Methods inherited from class jenes.chromosome.GenericAlleleSet
getElementAt, getRandomValue, size
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DoubleAlleleSet

public DoubleAlleleSet(java.util.Set<java.lang.Double> set)
Method Detail

createRandom

public static DoubleAlleleSet createRandom(int size,
                                           double lowerBound,
                                           double upperBound)
Builds a DoubleAlleleSet with random values within the range [lowerBound,upperBound]

Parameters:
size - the allala set cardinality
lowerBound - the min value to choose
upperBound - the max value to choose
Returns:
a new DoubleAlleleSet

createUniform

public static DoubleAlleleSet createUniform(int size,
                                            int lowerBound,
                                            int upperBound)
Builds a new DoubleAlleleSet with uniformly distributed values within the range [lowerBound,upperBound]

Parameters:
size - the allala set cardinality
lowerBound - the min value to choose
upperBound - the max value to choose
Returns:
a new DoubleAlleleSet