|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.ObjectDistributedEvolutionaryAlgorithmsFramework.Population
public class Population
Population used in evolutionary algorithms
| Nested Class Summary | |
|---|---|
static class |
Population.acceptImmigrantsMethod
Determines how immigrating individuals are handled. |
static class |
Population.expelEmigrantsMethod
Determines how emigrating individuals are chosen. |
| Field Summary | |
|---|---|
int |
dimensions
|
| Constructor Summary | |
|---|---|
Population()
Parameterless constructor |
|
Population(java.util.ArrayList<Individual> population)
Constructs Population with given Individuals |
|
| Method Summary | |
|---|---|
void |
acceptImmigrants(Population immigrants,
Population.acceptImmigrantsMethod method)
Accepts immigrants into existing population. |
void |
add(Individual ind)
Ads one Individual to population |
void |
clear()
Clears Population by removing all Individuals |
Population |
clone()
|
int |
compareTo(Population o)
|
void |
drop(int i)
Removes one Individual from Population with given index i |
double |
evaluateIndividual(Individual i)
|
Individual |
get(int j)
|
int |
getBestIndex()
Get population index of the best Individual |
static int |
getBestIndex(java.util.ArrayList<Individual> list)
Get population index of the best Individual from ArrayList of Individuals.) |
Individual |
getBestIndividual()
|
int |
getByIndex(int i)
Get Individual by his population index |
Population |
getEmigrants(int nMigratingIndividuals,
Population.expelEmigrantsMethod method)
Expels immigrants from evolved population. |
int |
getKey()
|
double |
getMaxRestriction(int i)
|
boolean |
getMigratingFlag()
|
double |
getMinRestriction(int i)
|
java.util.ArrayList<Individual> |
getPopulation()
|
java.util.Iterator<Individual> |
iterator()
|
void |
randomize()
Sets all Individuals to random values |
void |
readFields(java.io.DataInput in)
|
void |
resetIndividualsPopulation()
Set Individuals population to this Population. |
void |
set(int j,
Individual ind)
Sets one Individual with index j, rewriting the old one |
void |
setFitnessFunction(FitnessFunction ff)
Sets fitness function of this Population which is later used to create Individuals and determine their fitness |
void |
setKey(int k)
Each population has its unique key given by the framework at initialization by this function. |
void |
setMigratingFlag()
Migrating flag marks if the population is used for evolution or for migration |
void |
setPopulation(java.util.ArrayList<Individual> individuals)
Makes new Population from Individuals given in the individuals parameter |
int |
size()
|
void |
sort()
Sorts the population by fitness |
java.lang.String |
toString()
|
void |
write(java.io.DataOutput out)
|
| Methods inherited from class java.lang.Object |
|---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public int dimensions
| Constructor Detail |
|---|
public Population(java.util.ArrayList<Individual> population)
population - ArrayList of Individuals who will become the new Populationpublic Population()
| Method Detail |
|---|
public double getMinRestriction(int i)
i - Dimension from which the restriction is returned
public double getMaxRestriction(int i)
i - Dimension from which the restriction is returned
public void randomize()
public double evaluateIndividual(Individual i)
i - Individual to be evalueated
public java.util.ArrayList<Individual> getPopulation()
public void setFitnessFunction(FitnessFunction ff)
ff - FitnessFunction extending classpublic void resetIndividualsPopulation()
public void setMigratingFlag()
public boolean getMigratingFlag()
public void setKey(int k)
k - integer to set the key to.public int getKey()
public void add(Individual ind)
ind - Individual to addpublic Individual get(int j)
j - Index of Individual to return
public void set(int j,
Individual ind)
j - Index of new Individualind - Individual to be addedpublic void setPopulation(java.util.ArrayList<Individual> individuals)
individuals - ArrayList of new Individualspublic int size()
public void drop(int i)
i - Index of removed Individualpublic void clear()
public void sort()
public static int getBestIndex(java.util.ArrayList<Individual> list)
list - ArrayList of Individuals to search in.
public Individual getBestIndividual()
public void acceptImmigrants(Population immigrants,
Population.acceptImmigrantsMethod method)
immigrants - Immigrating Populationmethod - One of Population.acceptImmigrantsMethod (REPLACE_WORST, REPLACE_BEST, REPLACE_RANDOM, NO_REPLACE).Population.acceptImmigrantsMethod
public Population getEmigrants(int nMigratingIndividuals,
Population.expelEmigrantsMethod method)
nMigratingIndividuals - Number of emigrantsmethod - One of Population.expelEmigrantsMethod (EXPEL_BEST, EXPEL_RANDOM).Population.expelEmigrantsMethodpublic int getByIndex(int i)
i - Order of the Individual by fitness
getBestIndexpublic Population clone()
clone in class java.lang.Objectpublic java.util.Iterator<Individual> iterator()
iterator in interface java.lang.Iterable<Individual>
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(Population o)
compareTo in interface java.lang.Comparable<Population>public java.lang.String toString()
toString in class java.lang.Objectpublic int getBestIndex()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||