|
||||||||||
| 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 - fitness| Method 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 Individualmap in class AbstractIndividualmap - index to usepublic java.lang.String getPhenotypeString(int map)
Individual
getPhenotypeString in interface IndividualgetPhenotypeString in class AbstractIndividualmap - phenotype to chose
public Genotype getGenotype()
Individual
getGenotype in interface IndividualgetGenotype in class AbstractIndividualpublic Mapper getMapper()
Individual
getMapper in interface IndividualgetMapper in class AbstractIndividualpublic void setMapper(Mapper m)
Individual
setMapper in interface IndividualsetMapper in class AbstractIndividualm - mapperpublic void setGenotype(Genotype g)
setGenotype in interface IndividualsetGenotype in class AbstractIndividualg - genotypepublic void setPhenotype(Phenotype p)
Individual
setPhenotype in interface IndividualsetPhenotype in class AbstractIndividualp - phenotypepublic Phenotype getPhenotype()
Individual
getPhenotype in interface IndividualgetPhenotype in class AbstractIndividualpublic Individual clone()
clone in interface Individualclone in class AbstractIndividualpublic java.lang.String toString()
toString in class java.lang.Objectpublic 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 | |||||||||