|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectes.udc.gii.common.eaf.algorithm.parallel.migration.acceptance.GenerationBasedAcceptance
public class GenerationBasedAcceptance
Accepts the individuals that come in a MigrationObject
based on
the generation of the sending node.
Field Summary | |
---|---|
private int |
acceptIndividualsFrom
Generation from which individuals are accepted. |
static int |
ANY_GENERATION
States that individuals from other processes in the any generation are going to be considered for inmigration. |
static int |
NEWER_GENERATION
States that only individuals from other processes in a newer generation or in the same generation are going to be considered for inmigration. |
static int |
OLDER_GENERATION
States that only individuals from other processes in an older generation or in the same generation are going to be considered for inmigration. |
private java.util.List<MigrationObject> |
pendingMigrants
Individuals that have not been yet accepted but that might be accepted in the future. |
static int |
SAME_GENERATION
States that only individuals from other processes in the same generation are going to be considered for inmigration. |
Constructor Summary | |
---|---|
GenerationBasedAcceptance()
Creates a new instance of GenerationBasedAcceptance |
|
GenerationBasedAcceptance(int acceptIndividualsFrom)
Creates a new instance of GenerationBasedAcceptance |
Method Summary | |
---|---|
java.util.List<Individual> |
accept(MigrationObject migrant,
EvolutionaryAlgorithm algorithm,
java.util.List<Individual> currentPopulation)
Accepts the individuals that come in a MigrationObject based on
the generation of the sending node. |
void |
configure(org.apache.commons.configuration.Configuration conf)
Configures this class with a given Configuration . |
int |
getAcceptIndividualsFrom()
|
java.util.List<MigrationObject> |
getPendingMigrants()
|
void |
setAcceptIndividualsFrom(int acceptIndividualsFrom)
Configures the way individuals are accepted. |
void |
setPendingMigrants(java.util.List<MigrationObject> pendingMigrants)
|
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final int SAME_GENERATION
public static final int ANY_GENERATION
public static final int OLDER_GENERATION
public static final int NEWER_GENERATION
private int acceptIndividualsFrom
private java.util.List<MigrationObject> pendingMigrants
Constructor Detail |
---|
public GenerationBasedAcceptance()
public GenerationBasedAcceptance(int acceptIndividualsFrom)
Method Detail |
---|
public java.util.List<Individual> accept(MigrationObject migrant, EvolutionaryAlgorithm algorithm, java.util.List<Individual> currentPopulation)
MigrationObject
based on
the generation of the sending node.
accept
in interface MigAcceptancePolicy
public void configure(org.apache.commons.configuration.Configuration conf)
Configuration
.Configuration example:
... <AcceptancePolicy> <Class>...parallel.migration.GenerationBasedAcceptance</Class> <AcceptIndividualsFrom>ANY_GENERATION</AcceptIndividualsFrom> </AcceptancePolicy> ...
This configures this class for accepting any individual from any
generation. The following values are allowed for AcceptIndividualsFrom
:
ANY_GENERATION OLDER_GENERATION NEWER_GENERATION SAME_GENERATION
configure
in interface Configurable
public java.lang.String toString()
toString
in class java.lang.Object
public int getAcceptIndividualsFrom()
public void setAcceptIndividualsFrom(int acceptIndividualsFrom)
ANY_GENERATION
: Accepts any individual from any generation.SAME_GENERATION
: Accepts any individual from the sending
node that has the same generation of the receiving node.OLDER_GENERATION
: Accepts any individual from the sending
node that has the same generation of the receiving node
or an older one.NEWER_GENERATION
: Accepts any individual from the sending
node that has the same generation of the receiving node
or a newer one.
The default is ANY_GENERATION
. A runtime exception is thrown
if an invalid value is passed.
public java.util.List<MigrationObject> getPendingMigrants()
public void setPendingMigrants(java.util.List<MigrationObject> pendingMigrants)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |