de.kumpe.hadooptimizer
Class EsIndividual

java.lang.Object
  extended by de.kumpe.hadooptimizer.EsIndividual
All Implemented Interfaces:
Serializable

public final class EsIndividual
extends Object
implements Serializable

A special type of an immutable individual for evolution strategies.

The actual individual is a vector of real numbers (double[]). It is combined with an increment (the standard deviation during the mutation of the vector), which is mutated by itself.

Note: a instance is considered immutable, so you should not modify the contained individual. See getIndividual() for additional hints.

Author:
Christian Kumpe
See Also:
Serialized Form

Constructor Summary
EsIndividual(double individual)
          Creates a new EsIndividual with the given single individual, which is converted to one-dimensional vector, and an increment of 1.
EsIndividual(double[] individual)
          Creates a new EsIndividual with the given individual and an increment of 1.
EsIndividual(double[] individual, double increment)
          Creates a new EsIndividual with the given individual and increment.
EsIndividual(double individual, double increment)
          Creates a new EsIndividual with the given single individual, which is converted to one-dimensional vector, and the given increment.
 
Method Summary
 boolean equals(Object obj)
           
 double getIncrement()
          Returns the current increment.
 double[] getIndividual()
          Return the contained actual individual.
 int hashCode()
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

EsIndividual

public EsIndividual(double individual)
Creates a new EsIndividual with the given single individual, which is converted to one-dimensional vector, and an increment of 1.


EsIndividual

public EsIndividual(double[] individual)
Creates a new EsIndividual with the given individual and an increment of 1.

Throws:
NullPointerException - if individual is null
IllegalArgumentException - if individual is an empty array

EsIndividual

public EsIndividual(double individual,
                    double increment)
Creates a new EsIndividual with the given single individual, which is converted to one-dimensional vector, and the given increment.


EsIndividual

public EsIndividual(double[] individual,
                    double increment)
Creates a new EsIndividual with the given individual and increment.

Throws:
NullPointerException - if individual is null
IllegalArgumentException - if individual is an empty array
Method Detail

getIndividual

public double[] getIndividual()
Return the contained actual individual.

Note: An instance of EsIndividual is considered to be immutable, but for performance reasons the contained array is not copied. So don't modify the returned array.

Returns:
the contained actual individual; cannot be null

getIncrement

public double getIncrement()
Returns the current increment.

Returns:
the current increment

hashCode

public int hashCode()
Overrides:
hashCode in class Object

equals

public boolean equals(Object obj)
Overrides:
equals in class Object

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2011 Christian Kumpe. All Rights Reserved.