public abstract class Decoder
extends java.lang.Object
implements java.lang.Cloneable
Modifier and Type | Field and Description |
---|---|
protected Chromosome |
chromosome
The chromosome to decode.
|
protected int |
chromosomeNumber
The chromosome index.
|
protected int |
geneLength
Length of the gene on the chromosome.
|
protected int |
geneStart
The start index of a gene on the chromosome.
|
protected java.util.List |
transferList
A utility list for data transfer.
|
Modifier | Constructor and Description |
---|---|
protected |
Decoder()
Constructs the Decoder.
|
Modifier and Type | Method and Description |
---|---|
Decoder |
clone()
Return a shallow clone.
|
Chromosome |
getChromosome()
Returns the chromosome, for which the decoder is responsible.
|
int |
getChromosomeNumber()
Returns the chromosome number for this decoder.
|
int |
getGeneLength()
Returns the length (number of bases) of a gene on the chromosome.
|
int |
getGeneStart()
Returns the start index of the gene on the chromosome.
|
java.util.List<java.lang.Boolean> |
read(int count)
Reads the given number of bits.
|
java.util.List<java.lang.Double> |
read(int count,
double min,
double max)
Reads the given number of double values.
|
java.util.List<java.lang.Integer> |
read(int count,
int min,
int max)
Reads the given number of integer values.
|
abstract boolean |
readBit(int start)
Read a bit from the given chromosome.
|
abstract int |
readInt(int start,
double min,
double max)
Read an integer from the chromosome.
|
abstract double |
readReal(int start,
double min,
double max)
Read a real value from the chromosome.
|
void |
setChromosome(Chromosome chromosome)
Sets the chromosome to be decoded.
|
void |
setChromosome(java.util.List<Chromosome> chromosomes)
Sets the chromosome to be decoded from a list of chromosomes.
|
void |
setChromosomeNumber(int chromosomeNumber)
Sets the chromosome number for this decoder.
|
void |
setGeneLength(int geneLength)
Sets the length (number of bases) of a gene on the chromosome.
|
void |
setGeneStart(int geneStart)
Sets the start index of the gene on the chromosome.
|
java.lang.String |
toString()
Returns a description of this Feature.
|
protected Chromosome chromosome
protected int chromosomeNumber
protected int geneStart
protected int geneLength
protected java.util.List transferList
public Decoder clone()
clone
in class java.lang.Object
public Chromosome getChromosome()
public void setChromosome(Chromosome chromosome)
chromosome
- a chromosomepublic void setChromosome(java.util.List<Chromosome> chromosomes)
chromosomes
- a genotypepublic int getChromosomeNumber()
public void setChromosomeNumber(int chromosomeNumber)
chromosomeNumber
- the index of the chromosome in the JEvolution chromosome listpublic int getGeneStart()
public void setGeneStart(int geneStart)
geneStart
- the indexpublic int getGeneLength()
public void setGeneLength(int geneLength)
geneLength
- the lengthpublic java.util.List<java.lang.Integer> read(int count, int min, int max)
count
- the number of valuesmin
- the minimal valuemax
- the maximal valuepublic java.util.List<java.lang.Double> read(int count, double min, double max)
count
- the number of valuesmin
- the minimal valuemax
- the maximal valuepublic java.util.List<java.lang.Boolean> read(int count)
count
- the number of valuespublic java.lang.String toString()
toString
in class java.lang.Object
public abstract boolean readBit(int start)
start
- the start base to read frompublic abstract int readInt(int start, double min, double max)
start
- the start base to read frommin
- the minimal valuemax
- the maximal valuepublic abstract double readReal(int start, double min, double max)
start
- the start base to read frommin
- the minimal valuemax
- the maximal value