|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object evolution.BitChromosome
public class BitChromosome
Chromosome with bit representation
Constructor Summary | |
---|---|
BitChromosome(int chromosomeSize,
double crossOverProbability,
double mutationProbability,
FitnessFunctionModel fitnessFunction)
Creates a new instance of BitChromosome |
|
BitChromosome(int chromosomeSize,
FitnessFunctionModel fitnessFunction)
Creates a new instance of BitChromosome with Cross over probability - set to 1.0 Mutatation probability - set to 0 |
|
BitChromosome(java.lang.String chromosomeString,
FitnessFunctionModel fitnessFunction)
Creates a new instance of BitChromosome from Chromosome String where: 1 represent gene with true value 0 represent gene with falce value |
Method Summary | |
---|---|
java.lang.Object |
clone()
Return copy of the chromosome |
boolean |
equals(java.lang.Object obj)
Indicates whether some other object is "equal to" this network. |
int |
geneMutation(int geneNumber)
Mutant gene specified by genNumber. |
int |
getChromosomeSize()
Return size of the chromosome |
double |
getCrossOverProbability()
Return cross over propability |
FitnessFunctionModel |
getFitnessFunciton()
Return reference to fitness function |
double |
getFitnessValue()
Return fitness value of the chromosome |
java.lang.Object |
getGene(int geneNumber)
Return gene for with specified gene NUmber |
double |
getMutationProbability()
Return mutation propability |
void |
setCrossOverProbability(double crossOverProbality)
Set propability of cross over |
void |
setFitnessFunciton(FitnessFunctionModel fitnessFunction)
Set fitness function |
void |
setGene(int geneNumber,
java.lang.Object value)
Set gene with specified value. |
void |
setMutationProbability(double mutationProbability)
Set mutation probability |
java.lang.String |
toString()
Return string representation of chromosome where 1 - represent true 2 - represent false |
Methods inherited from class java.lang.Object |
---|
finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public BitChromosome(int chromosomeSize, FitnessFunctionModel fitnessFunction)
chromosomeSize
- size of chromosomefitnessFunction
- reference to fitness functionpublic BitChromosome(int chromosomeSize, double crossOverProbability, double mutationProbability, FitnessFunctionModel fitnessFunction)
chromosomeSize
- Chromosome sizecrossOverProbability
- cross over propabilitymutationProbability
- mutation propabilityfitnessFunction
- reference to fitness functionpublic BitChromosome(java.lang.String chromosomeString, FitnessFunctionModel fitnessFunction)
chromosomeString
- String representation of chromosomefitnessFunction
- reference to fitness functionMethod Detail |
---|
public void setGene(int geneNumber, java.lang.Object value)
setGene
in interface ChromosomeModel
geneNumber
- Gene numbervalue
- Gene valuepublic void setMutationProbability(double mutationProbability)
setMutationProbability
in interface ChromosomeModel
mutationProbability
- Mutation propabilitypublic double getMutationProbability()
getMutationProbability
in interface ChromosomeModel
public java.lang.Object getGene(int geneNumber)
getGene
in interface ChromosomeModel
geneNumber
- Gene number
public double getCrossOverProbability()
getCrossOverProbability
in interface ChromosomeModel
public void setCrossOverProbability(double crossOverProbality)
setCrossOverProbability
in interface ChromosomeModel
crossOverProbality
- cross over propabilitypublic void setFitnessFunciton(FitnessFunctionModel fitnessFunction)
setFitnessFunciton
in interface ChromosomeModel
fitnessFunction
- referenct to fitness functionpublic FitnessFunctionModel getFitnessFunciton()
getFitnessFunciton
in interface ChromosomeModel
FitnessFunctionModel
public double getFitnessValue()
getFitnessValue
in interface ChromosomeModel
public int getChromosomeSize()
getChromosomeSize
in interface ChromosomeModel
public int geneMutation(int geneNumber)
geneMutation
in interface ChromosomeModel
geneNumber
- gene number
public java.lang.String toString()
toString
in interface ChromosomeModel
toString
in class java.lang.Object
public boolean equals(java.lang.Object obj)
equals
in interface ChromosomeModel
equals
in class java.lang.Object
obj
- the reference object to compare with
public java.lang.Object clone()
clone
in interface ChromosomeModel
clone
in class java.lang.Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |