Package evo.search.ga
Class DiscreteChromosome
- java.lang.Object
-
- io.jenetics.AbstractChromosome<DiscreteGene>
-
- evo.search.ga.DiscreteChromosome
-
- All Implemented Interfaces:
XmlEntity<DiscreteChromosome>
,io.jenetics.Chromosome<DiscreteGene>
,io.jenetics.util.BaseSeq<DiscreteGene>
,io.jenetics.util.Factory<io.jenetics.Chromosome<DiscreteGene>>
,io.jenetics.util.Verifiable
,Serializable
,Iterable<DiscreteGene>
,RandomAccess
public class DiscreteChromosome extends io.jenetics.AbstractChromosome<DiscreteGene> implements XmlEntity<DiscreteChromosome>
Chromosome consisting of a permutations of the distances from theConfiguration
in an evolved order associated with valid positional indices.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description DiscreteChromosome(DiscreteGene... genes)
Create a newDiscreteChromosome
from the givengenes
array.DiscreteChromosome(io.jenetics.util.ISeq<? extends DiscreteGene> genes)
Create a newDiscreteChromosome
from the givengenes
array.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description io.jenetics.Chromosome<DiscreteGene>
newInstance()
io.jenetics.Chromosome<DiscreteGene>
newInstance(io.jenetics.util.ISeq<DiscreteGene> genes)
DiscreteChromosome
parse(org.dom4j.Element element)
Parse aElement
and return the entity.org.dom4j.Element
serialize()
Serialize the entity into aElement
.-
Methods inherited from class io.jenetics.AbstractChromosome
equals, get, hashCode, isValid, length, toString
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
-
-
-
Constructor Detail
-
DiscreteChromosome
public DiscreteChromosome(io.jenetics.util.ISeq<? extends DiscreteGene> genes)
Create a newDiscreteChromosome
from the givengenes
array.- Parameters:
genes
- the genes that form the chromosome.- Throws:
NullPointerException
- if the given gene array isnull
.IllegalArgumentException
- if the length of the gene sequence is empty.
-
DiscreteChromosome
public DiscreteChromosome(DiscreteGene... genes)
Create a newDiscreteChromosome
from the givengenes
array.- Parameters:
genes
- the genes that form the chromosome.- Throws:
NullPointerException
- if the given gene array isnull
.IllegalArgumentException
- if the length of the gene sequence is empty.
-
-
Method Detail
-
newInstance
public io.jenetics.Chromosome<DiscreteGene> newInstance(io.jenetics.util.ISeq<DiscreteGene> genes)
- Specified by:
newInstance
in interfaceio.jenetics.Chromosome<DiscreteGene>
-
newInstance
public io.jenetics.Chromosome<DiscreteGene> newInstance()
- Specified by:
newInstance
in interfaceio.jenetics.util.Factory<io.jenetics.Chromosome<DiscreteGene>>
-
serialize
public org.dom4j.Element serialize()
Description copied from interface:XmlEntity
Serialize the entity into aElement
.- Specified by:
serialize
in interfaceXmlEntity<DiscreteChromosome>
- Returns:
- serialized document
-
parse
public DiscreteChromosome parse(org.dom4j.Element element)
Description copied from interface:XmlEntity
Parse aElement
and return the entity.- Specified by:
parse
in interfaceXmlEntity<DiscreteChromosome>
- Parameters:
element
- element to parse- Returns:
- parsed entity
-
-