|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectlio.replacement.ElitistReplacement
public class ElitistReplacement
This class produces a new population by preserving the best individuals in the former population. By default it keeps only one individual from the former population.
Constructor Summary | |
---|---|
ElitistReplacement()
|
Method Summary | |
---|---|
LiOResourceDefinition |
getDefinition()
Return a LiOResDescription object with the information of each object. |
boolean |
getKeepIndividuals()
Returns true if a fix number of individuals from the former population must be choosen to form the new one. |
int |
getMaxPreserved()
Returns the maximum number of individuals preserved from the former population. |
static void |
main(java.lang.String[] args)
Main method to test the task. |
Individual[] |
replace(Population current,
Population former)
Generates a new population from the current and the former one. |
void |
setKeepIndividuals(boolean pKeepIndividuals)
Determines if as many individuals from the former population as indicated with maxPreserved must be preserved even if they don't improve fitness of the worst in the current population. |
void |
setMaxPreserved(int pMaxPreserved)
Sets the maximum number of individuals kept from the former population. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ElitistReplacement()
Method Detail |
---|
public Individual[] replace(Population current, Population former)
replace
in interface Replacement
former
- The former population.current
- The current population.public void setMaxPreserved(int pMaxPreserved)
pMaxPreserved
- Maximum number of individuals kept from the former population.public int getMaxPreserved()
public void setKeepIndividuals(boolean pKeepIndividuals)
pKeepIndividuals
- Whether selection must taka a number of individuals from the
former population.public boolean getKeepIndividuals()
public LiOResourceDefinition getDefinition()
getDefinition
in interface LiOResource
public static void main(java.lang.String[] args)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |