wodka.util
Class DoubleValues
java.lang.Object
wodka.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
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
values
protected transient java.util.Map values
ranges
protected transient DoubleRanges ranges
DoubleValues
public DoubleValues()
DoubleValues
public DoubleValues(DoubleRanges ranges)
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