wodka.util
Class DoubleValues

java.lang.Object
  extended bywodka.util.DoubleValues
All Implemented Interfaces:
ContentComparable, java.io.Serializable, StreamPersistable
Direct Known Subclasses:
DoubleTestValues, DoubleTestValuesArray, SodaGlobals

public abstract class DoubleValues
extends java.lang.Object
implements StreamPersistable, ContentComparable

A set of double values that can be easily configured and on which genetic operations can be applied.

Author:
wwagner4
See Also:
Serialized Form

Field Summary
protected  DoubleRanges ranges
           
protected  java.util.Map values
           
 
Constructor Summary
DoubleValues()
           
DoubleValues(DoubleRanges ranges)
           
 
Method Summary
protected abstract  DoubleValues createInstance()
           
 DoubleValues crossover(DoubleValues father)
           
protected  void defineValueWithDefault(java.lang.String name, double val)
           
 void fromStream(java.io.DataInputStream inStream, int version)
           
protected  java.lang.String getName(int index)
           
protected abstract  java.lang.String getRangeKey(java.lang.String name)
           
 double getValue(java.lang.String name)
           
 int getVersion()
           
 boolean hasEqualContents(java.lang.Object obj)
           
protected abstract  void initDefaultValues()
           
 void mutate(double mutationRate)
           
 void setAllValues(double val)
           
 void setRandomValues()
           
 void setRanges(DoubleRanges ranges)
           
 void setValue(java.lang.String name, double value)
           
 void toStream(java.io.DataOutputStream outStream)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

values

protected transient java.util.Map values

ranges

protected transient DoubleRanges ranges
Constructor Detail

DoubleValues

public DoubleValues()

DoubleValues

public DoubleValues(DoubleRanges ranges)
Method Detail

setRanges

public void setRanges(DoubleRanges ranges)

fromStream

public void fromStream(java.io.DataInputStream inStream,
                       int version)
                throws java.io.IOException
Specified by:
fromStream in interface StreamPersistable
Throws:
java.io.IOException

getVersion

public int getVersion()
Specified by:
getVersion in interface StreamPersistable

toStream

public void toStream(java.io.DataOutputStream outStream)
              throws java.io.IOException
Specified by:
toStream in interface StreamPersistable
Throws:
java.io.IOException

initDefaultValues

protected abstract void initDefaultValues()

getRangeKey

protected abstract java.lang.String getRangeKey(java.lang.String name)

getValue

public double getValue(java.lang.String name)

setValue

public void setValue(java.lang.String name,
                     double value)

mutate

public void mutate(double mutationRate)

getName

protected java.lang.String getName(int index)

createInstance

protected abstract DoubleValues createInstance()

setAllValues

public void setAllValues(double val)

crossover

public DoubleValues crossover(DoubleValues father)

defineValueWithDefault

protected void defineValueWithDefault(java.lang.String name,
                                      double val)

setRandomValues

public void setRandomValues()

hasEqualContents

public boolean hasEqualContents(java.lang.Object obj)
Specified by:
hasEqualContents in interface ContentComparable