|
eaLib API Docs Last Modified : January 7 2002 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--mss.ea.core.Individual
Base class for an individual.
Field Summary | |
protected long |
birthDate
Birthdate in milliseconds. |
protected ChromosomeSet |
cs
Chromosome set, representing the genetic information. |
protected Fitness |
fs
Fitness of individual. |
protected long |
id
ID of the individual. |
protected java.lang.String |
name
Name of the individual. |
protected static java.lang.String |
namePrefix
Prefix of the name of the individual. |
protected static java.lang.String |
nameSuffix
Suffix of the name of the individual. |
protected AbstractPopulation |
pop
Deprecated. because of stream based concept this is not supported any longer |
protected Score |
sc
Score of individual. |
Constructor Summary | |
Individual()
Constructor. |
|
Individual(ChromosomeSet set)
Constructor with initial chromosome set. |
|
Individual(int chromosomeCount)
Constructor with chromosome number. |
|
Individual(java.lang.String name)
Constructor with name. |
|
Individual(java.lang.String name,
ChromosomeSet set)
Constructor with name and chromosome set. |
|
Individual(java.lang.String name,
int chromosomeCount)
Constructor with name and number of chromosomes. |
Method Summary | |
java.lang.Object |
clone()
Clones an individual. |
int |
compareTo(java.lang.Object o)
Compares two individuals. |
boolean |
equalSet(Individual i)
Deprecated. replaced by hasEqualSet( Individual ) |
long |
getAge()
Gets the age of the individual. |
ChromosomeSet |
getChromosomeSet()
Gets the chromosome set. |
Fitness |
getFitness()
Get the fitness of the individual. |
long |
getID()
Gets the ID of the individual. |
java.lang.String |
getInfo()
Returns information (name, age, score and fitness) about this individual as a string. |
java.lang.String |
getName()
Returns the name (ID) of the individual. |
AbstractPopulation |
getPopulation()
Deprecated. because of stream based concept this is not supported any longer |
Score |
getScore()
Gets the score of the individual. |
boolean |
hasEqualSet(Individual i)
Test for equal chromosome sets. |
boolean |
hasFitness()
Checks if a fitness value has been set. |
boolean |
hasScore()
Checks if a score has been set. |
void |
save()
Saves the individual. |
void |
save(java.lang.String filename)
Saves the individual to a given file. |
void |
setChromosomeSet(ChromosomeSet set)
Sets a new chromosome set. |
void |
setFitness(Fitness f)
Sets the fitness. |
static void |
setIDPrefix(java.lang.String prefix)
Sets the prefix of the ID. |
static void |
setIDSuffix(java.lang.String suffix)
Sets the suffix of the ID. |
void |
setName(java.lang.String name)
Sets the name (ID) of the individual. |
void |
setPopulation(AbstractPopulation p)
Deprecated. because of stream based concept this is not supported any longer |
void |
setScore(Score s)
Sets the score of the individual. |
java.lang.String |
toString()
Returns the chromosome representation of this individual as a string. |
Methods inherited from class java.lang.Object |
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
protected AbstractPopulation pop
protected Fitness fs
protected Score sc
protected ChromosomeSet cs
protected static java.lang.String namePrefix
protected static java.lang.String nameSuffix
protected java.lang.String name
protected long id
protected long birthDate
Constructor Detail |
public Individual()
public Individual(java.lang.String name)
name
- name of individualpublic Individual(int chromosomeCount)
chromosomeCount
- number of chromosomespublic Individual(java.lang.String name, int chromosomeCount)
name
- name of the individualchromosomeCount
- number of chromosomespublic Individual(ChromosomeSet set)
set
- chromosome setpublic Individual(java.lang.String name, ChromosomeSet set)
name
- nameset
- initial chromosome setMethod Detail |
public Fitness getFitness()
public void setFitness(Fitness f)
f
- new fitnesspublic boolean hasFitness()
public Score getScore()
public void setScore(Score s)
s
- new scorepublic boolean hasScore()
public ChromosomeSet getChromosomeSet()
public void setChromosomeSet(ChromosomeSet set)
set
- new chromosome setpublic AbstractPopulation getPopulation()
public void setPopulation(AbstractPopulation p)
p
- new populationpublic int compareTo(java.lang.Object o)
compareTo
in interface java.lang.Comparable
o
- individual to compare withClassCastException
- in case that o is not an individualpublic static void setIDPrefix(java.lang.String prefix)
prefix
- prefix of IDpublic static void setIDSuffix(java.lang.String suffix)
suffix
- suffix of IDpublic java.lang.String getName()
public void setName(java.lang.String name)
name
- new namepublic long getAge()
public long getID()
public java.lang.Object clone()
clone
in class java.lang.Object
public java.lang.String getInfo()
public java.lang.String toString()
toString
in class java.lang.Object
public boolean equalSet(Individual i)
public boolean hasEqualSet(Individual i)
public void save()
public void save(java.lang.String filename)
filename
- name of the file
|
eaLib API Docs Last Modified : January 7 2002 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |