org.encog.ml.genetic.genome
Class DoubleArrayGenome
- java.lang.Object
-
- org.encog.ml.ea.genome.BasicGenome
-
- org.encog.ml.genetic.genome.DoubleArrayGenome
-
- All Implemented Interfaces:
- java.io.Serializable, Genome, ArrayGenome, MLMethod
- Direct Known Subclasses:
- MLMethodGenome
public class DoubleArrayGenome extends BasicGenome implements ArrayGenome
A genome made up of continuous doubles.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor and Description DoubleArrayGenome(DoubleArrayGenome other)Construct a genome based on another genome.DoubleArrayGenome(int size)Construct a genome of a specific size.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description voidcopy(ArrayGenome source, int sourceIndex, int targetIndex)Copy elements from another array genome into this one.voidcopy(Genome source)Copy from the specified genome into this one.double[]getData()intsize()voidswap(int iswap1, int iswap2)Swap two elements in this genome.-
Methods inherited from class org.encog.ml.ea.genome.BasicGenome
getAdjustedScore, getBirthGeneration, getPopulation, getScore, getSource, getSpecies, setAdjustedScore, setBirthGeneration, setPopulation, setScore, setSource, setSpecies, toString
-
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.encog.ml.ea.genome.Genome
getAdjustedScore, getBirthGeneration, getPopulation, getScore, getSource, getSpecies, setAdjustedScore, setBirthGeneration, setPopulation, setScore, setSource, setSpecies
-
-
-
-
Constructor Detail
-
DoubleArrayGenome
public DoubleArrayGenome(int size)
Construct a genome of a specific size.- Parameters:
size- The size.
-
DoubleArrayGenome
public DoubleArrayGenome(DoubleArrayGenome other)
Construct a genome based on another genome.- Parameters:
other- the genome to clone
-
-
Method Detail
-
size
public int size()
-
copy
public void copy(ArrayGenome source, int sourceIndex, int targetIndex)
Copy elements from another array genome into this one.- Specified by:
copyin interfaceArrayGenome- Parameters:
source- The source genome.sourceIndex- The source index.targetIndex- The target index.
-
getData
public double[] getData()
- Returns:
- The data.
-
copy
public void copy(Genome source)
Copy from the specified genome into this one.
-
swap
public void swap(int iswap1, int iswap2)Swap two elements in this genome.- Specified by:
swapin interfaceArrayGenome- Parameters:
iswap1- The first element index to swap.iswap2- The second element index to swap.
-
-
DMelt 3.0 © DataMelt by jWork.ORG