|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--ec.Exchanger | +--ec.exchange.InterPopulationExchange
InterPopulationExchange is an Exchanger which implements a simple exchanger between subpopulations. IterPopulationExchange uses an arbitrary graph topology for migrating individuals from subpopulations. The assumption is that all subpopulations have the same representation and same task to solve, otherwise the exchange between subpopulations does not make much sense.
InterPopulationExchange has a topology which is similar to the one used by IslandExchange. Every few generations, a subpopulation will send some number of individuals to other subpopulations. Since all subpopulations evolve at the same generational speed, this is a synchronous procedure (IslandExchange instead is asynchronous by default, though you can change it to synchronous).
Individuals are sent from a subpopulation prior to breeding. They are stored in a waiting area until after all subpopulations have bred; thereafter they are added into the new subpopulation. This means that the subpopulation order doesn't matter. Also note that it means that some individuals will be created during breeding, and immediately killed to make way for the migrants. A little wasteful, we know, but it's simpler that way.
Parameters
Note: For each subpopulation in your population, there must be one exch.subpop... declaration set.
base.subpop.n.select classname, inherits and != ec.SelectionMethod |
The selection method used by subpopulation #n for picking migrants to emigrate to other subpopulations | ||||||||
base.subpop.n.mod int >= 1 |
The number of generations that subpopulation #n waits between sending emigrants | ||||||||
base.subpop.n.start int >= 0 |
The generation when subpopulation #n begins sending emigrants | ||||||||
base.subpop.n.size int >= 0 |
The number of emigrants sent at one time by generation #n | ||||||||
base.subpop.n.num-dest int >= 0 |
The number of destination subpopulations for this subpopulation. | ||||||||
base.subpop.n.dest.m int >= 0 |
Subpopulation #n's destination #m is this subpopulation. |
base.subpop.n.select | selection method for subpopulation #n's migrants |
Field Summary | |
Parameter |
base
My parameter base -- I need to keep this in order to help the server reinitialize contacts |
static java.lang.String |
P_DEST
The prefix for destinations |
static java.lang.String |
P_DEST_FOR_SUBPOP
The number of destinations from current island |
static java.lang.String |
P_MODULO
The parameter for the modulo (how many generations should pass between consecutive sendings of individuals |
static java.lang.String |
P_OFFSET
How many generations to pass at the beginning of the evolution before the first emigration from the current subpopulation |
static java.lang.String |
P_SELECT_METHOD
The selection method for sending individuals to other islands |
static java.lang.String |
P_SELECT_TO_DIE_METHOD
The selection method for deciding individuals to be replaced by immigrants |
static java.lang.String |
P_SIZE
The number of emigrants to be sent |
static java.lang.String |
P_SUBPOP
The subpopulation delimiter |
Constructor Summary | |
InterPopulationExchange()
|
Method Summary | |
void |
closeContacts(EvolutionState state,
int result)
Closes contacts with other processes, if that's what you're doing. |
void |
initializeContacts(EvolutionState state)
Initializes contacts with other processes, if that's what you're doing. |
Population |
postBreedingExchangePopulation(EvolutionState state)
Performs exchanges after the population has been bred but before it has been evaluated, once every generation (or pseudogeneration). |
Population |
preBreedingExchangePopulation(EvolutionState state)
Performs exchanges after the population has been evaluated but before it has been bred, once every generation (or pseudogeneration). |
void |
reinitializeContacts(EvolutionState state)
Initializes contacts with other processes, if that's what you're doing. |
java.lang.String |
runComplete(EvolutionState state)
Called after preBreedingExchangePopulation(...) to evaluate whether or not the exchanger wishes the run to shut down (with ec.EvolutionState.R_FAILURE). |
void |
setup(EvolutionState state,
Parameter _base)
Sets up the object by reading it from the parameters stored in state, built off of the parameter base base. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final java.lang.String P_SUBPOP
public static final java.lang.String P_MODULO
public static final java.lang.String P_SIZE
public static final java.lang.String P_OFFSET
public static final java.lang.String P_DEST_FOR_SUBPOP
public static final java.lang.String P_DEST
public static final java.lang.String P_SELECT_METHOD
public static final java.lang.String P_SELECT_TO_DIE_METHOD
public Parameter base
Constructor Detail |
public InterPopulationExchange()
Method Detail |
public void setup(EvolutionState state, Parameter _base)
Setup
public void initializeContacts(EvolutionState state)
initializeContacts
in class Exchanger
public void reinitializeContacts(EvolutionState state)
reinitializeContacts
in class Exchanger
public Population preBreedingExchangePopulation(EvolutionState state)
Exchanger
preBreedingExchangePopulation
in class Exchanger
public Population postBreedingExchangePopulation(EvolutionState state)
Exchanger
postBreedingExchangePopulation
in class Exchanger
public java.lang.String runComplete(EvolutionState state)
runComplete
in class Exchanger
public void closeContacts(EvolutionState state, int result)
closeContacts
in class Exchanger
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |