|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.ObjectDistributedEvolutionaryAlgorithmsFramework.Individual
public class Individual
Individual used to populate Population
| Constructor Summary | |
|---|---|
Individual(Population pop,
java.io.DataInput in)
|
|
Individual(Population pop,
double[] vals)
|
|
Individual(Population pop,
int d)
|
|
| Method Summary | |
|---|---|
int |
compareTo(Individual o)
|
double |
getFitness()
|
double |
getGene(int i)
|
double[] |
getGenotype()
|
int |
getIndex()
|
void |
randomize()
Sets genes to random values within restrictions |
void |
readFields(java.io.DataInput in)
|
void |
setFitness(double f)
Sets Individuals fitness to given value f |
void |
setGene(int ind,
double val)
Sets one gene to defined value val |
void |
setIndex(int i)
Sets population index to value i |
void |
setPopulation(Population pop)
Sets population pointer to pop |
void |
setValue(int i,
double value)
Sets value of one gene |
void |
setValues(double[] values)
Sets whole genotype |
java.lang.String |
toString()
|
void |
write(java.io.DataOutput out)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public Individual(Population pop,
int d)
pop - Population in which Individual will be inserted intod - Number of dimensions
public Individual(Population pop,
double[] vals)
pop - Population in which Individual will be inserted intovals - Array of values used as genes
public Individual(Population pop,
java.io.DataInput in)
throws java.io.IOException
pop - Population in which Individual will be inserted intoin - DataInput with file to be read from
java.io.IOException| Method Detail |
|---|
public void randomize()
public double[] getGenotype()
public double getGene(int i)
i - index of requested gene
public void setGene(int ind,
double val)
ind - Index of gene to setval - Value to set to the genepublic void setFitness(double f)
f - Value to setpublic double getFitness()
public int getIndex()
public void setIndex(int i)
i - Index to setpublic java.lang.String toString()
toString in class java.lang.Objectpublic void setValues(double[] values)
values -
public void setValue(int i,
double value)
i - Index of gene to setvalue - Value to setpublic void setPopulation(Population pop)
pop - Population to set
public void write(java.io.DataOutput out)
throws java.io.IOException
write in interface org.apache.hadoop.io.Writablejava.io.IOException
public void readFields(java.io.DataInput in)
throws java.io.IOException
readFields in interface org.apache.hadoop.io.Writablejava.io.IOExceptionpublic int compareTo(Individual o)
compareTo in interface java.lang.Comparable<Individual>
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||