public class Individual extends Object
The Individual class forms a single solution for the given
optimization problem.
An Individual contains the Genotype, Phenotype, and
Objectives: Initially, the Individual contains only a
Genotype. The Decoder decodes the
Genotype into a Phenotype and adds it to the
Individual. Finally, the Phenotype is evaluated and the
resulting Objectives are added to the Individual.
Genotype,
Phenotype,
Objectives| Modifier and Type | Class and Description |
|---|---|
static class |
Individual.State
The possible states of an
Individual. |
| Modifier and Type | Method and Description |
|---|---|
Genotype |
getGenotype()
Returns the genotype.
|
Objectives |
getObjectives()
Returns the objectives.
|
Phenotype |
getPhenotype()
Returns the phenotype.
|
Individual.State |
getState()
Returns the
Individual.State of the Individual. |
boolean |
isDecoded()
Indicates whether this
Individual is already decoded. |
boolean |
isEvaluated()
Indicates whether this
Individual is already evaluated. |
void |
setGenotype(Genotype genotype)
Sets the genotype.
|
void |
setObjectives(Objectives objectives)
Sets the objectives.
|
void |
setPhenotype(Phenotype phenotype)
Sets the phenotype.
|
void |
setState(Individual.State state)
Sets the state of the
Individual. |
public Phenotype getPhenotype()
setPhenotype(org.opt4j.core.Phenotype)public Objectives getObjectives()
setObjectives(org.opt4j.core.Objectives)public Genotype getGenotype()
setGenotype(org.opt4j.core.Genotype)public void setGenotype(Genotype genotype)
genotype - the genotype to be setgetGenotype()public void setPhenotype(Phenotype phenotype)
phenotype - the phenotype to be setgetPhenotype()public void setObjectives(Objectives objectives)
objectives - the objectives to be setgetObjectives()public boolean isDecoded()
Individual is already decoded.true if this individual is decodedpublic boolean isEvaluated()
Individual is already evaluated.true if this inividual is evaluatedpublic void setState(Individual.State state)
Individual.state - the new statusgetState()public Individual.State getState()
Individual.State of the Individual.setState(org.opt4j.core.Individual.State)