|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.ObjectIndividuals.AbstractIndividual
Individuals.GEIndividual
public class GEIndividual
GEIndividual. Has a genotype, Phenotype and a GEGrammar. Has fields for validity and mapped status. Only has one chromosome and grammar
Field Summary |
---|
Fields inherited from class Individuals.AbstractIndividual |
---|
age, evaluated, fitness, parentUIDs |
Constructor Summary | |
---|---|
GEIndividual()
Creates a new instance of GEIndividual |
|
GEIndividual(GEGrammar g,
Phenotype p,
Genotype gen,
Fitness f)
Create new GEindividual instance |
Method Summary | |
---|---|
Individual |
clone()
Clone this individual, invialidate and return the clone |
int[] |
getCrossoverPoints()
|
Genotype |
getGenotype()
Get the genotype |
static GEIndividual |
getIndividual(GEGrammar grammar,
Phenotype phen,
Genotype genotype,
Fitness fitness)
Factory method for creating GEIndivdual with different grammars |
Mapper |
getMapper()
Get the map use to map input and output |
int[] |
getMutationPoints()
|
java.util.ArrayList<Fitness> |
getParents()
|
Phenotype |
getPhenotype()
Get phenotype |
java.lang.String |
getPhenotypeString(int map)
Get a String representation of the output(Phenotype) |
int |
getPreviouslyUsedCodons()
Get number of codons used for mapping previoulsy. |
int |
getUsedCodons()
Get number of codons used for mapping |
int |
getUsedWraps()
Get number of wraps used for mapping |
void |
invalidate()
Invalidate the individual. |
boolean |
isMapped()
Is the individual mapped |
boolean |
isValid()
Get the validity of the individual |
void |
map(int map)
Setting these both here so as to negate the need for multiple copies of the Mapper. |
void |
revalidate(GEIndividual ind)
Sets the values reset by invalidate to the values from the individual passed in. |
void |
setCrossoverPoints(int[] crossoverPoints)
|
void |
setGenotype(Genotype g)
Invalidates the individual because a change has been made to the genotype. |
void |
setMapped(boolean mapped)
Set the mapped status of the individual |
void |
setMapper(Mapper m)
Set mapper |
void |
setMutationPoints(int[] mutationPoints)
|
void |
setParents(java.util.ArrayList<Fitness> parents)
|
void |
setPhenotype(Phenotype p)
Set phenotype |
void |
setPreviouslyUsedCodons(int previouslyUsedCodons)
|
void |
setUsedCodons(int usedCodons)
Set how many codons were used |
void |
setUsedWraps(int usedWraps)
Set how many wraps were used |
void |
setValid(boolean b)
Set the validity of the individual |
java.lang.String |
toString()
|
boolean |
wasPreviouslyValid()
Find out whether individual was *previously* valid. |
Methods inherited from class Individuals.AbstractIndividual |
---|
compareTo, getAge, getFitness, getParentUIDs, getUID, increaseUIDCounter, isEvaluated, setAge, setEvaluated, setFitness, setParentUIDs |
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public GEIndividual()
public GEIndividual(GEGrammar g, Phenotype p, Genotype gen, Fitness f)
g
- mapper(grammar)p
- output(phenotype)gen
- input(genotype)f
- fitnessMethod Detail |
---|
public static GEIndividual getIndividual(GEGrammar grammar, Phenotype phen, Genotype genotype, Fitness fitness)
grammar
- grammarphen
- phenotypegenotype
- genotypefitness
- fitness
public void revalidate(GEIndividual ind)
ind
- individual which values are taken frompublic void invalidate()
public boolean isMapped()
public void setMapped(boolean mapped)
mapped
- status of the individuals mappingpublic boolean isValid()
Individual
public void setValid(boolean b)
Individual
b
- validity to be setpublic boolean wasPreviouslyValid()
public void setUsedCodons(int usedCodons)
usedCodons
- number of codons usedpublic void setUsedWraps(int usedWraps)
usedWraps
- number of wraps usedpublic void map(int map)
map
in interface Individual
map
in class AbstractIndividual
map
- index to usepublic java.lang.String getPhenotypeString(int map)
Individual
getPhenotypeString
in interface Individual
getPhenotypeString
in class AbstractIndividual
map
- phenotype to chose
public Genotype getGenotype()
Individual
getGenotype
in interface Individual
getGenotype
in class AbstractIndividual
public Mapper getMapper()
Individual
getMapper
in interface Individual
getMapper
in class AbstractIndividual
public void setMapper(Mapper m)
Individual
setMapper
in interface Individual
setMapper
in class AbstractIndividual
m
- mapperpublic void setGenotype(Genotype g)
setGenotype
in interface Individual
setGenotype
in class AbstractIndividual
g
- genotypepublic void setPhenotype(Phenotype p)
Individual
setPhenotype
in interface Individual
setPhenotype
in class AbstractIndividual
p
- phenotypepublic Phenotype getPhenotype()
Individual
getPhenotype
in interface Individual
getPhenotype
in class AbstractIndividual
public Individual clone()
clone
in interface Individual
clone
in class AbstractIndividual
public java.lang.String toString()
toString
in class java.lang.Object
public int getUsedCodons()
public void setPreviouslyUsedCodons(int previouslyUsedCodons)
public int getPreviouslyUsedCodons()
public int getUsedWraps()
public int[] getCrossoverPoints()
public int[] getMutationPoints()
public java.util.ArrayList<Fitness> getParents()
public void setCrossoverPoints(int[] crossoverPoints)
public void setMutationPoints(int[] mutationPoints)
public void setParents(java.util.ArrayList<Fitness> parents)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |