|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectec.Subpopulation
ec.spatial.Spatial1DSubpopulation
public class Spatial1DSubpopulation
A Spatial1DSubpopulation is an EC subpopulation that is additionally embedded into a one-dimmensional space. In a spatially-embedded EA, the subpopulations of individuals are assumed to be spatially distributed in some sort of space, be it one-dimmensional, two- dimmensional, or whatever else. The space may or may not be toroidal (although it usually is). Each location in the space has a set of neighboring locations. Thus, each individual has an index in the subpopulation, and also a location in the space.
This public interface provides a method to obtain the indexes of the neighbors of a location.
This Subpopulation does not include toroidalness in writing out to streams.
Parameters
toroidal true (default) or false |
(Is this space toroidal?) |
Field Summary | |
---|---|
static java.lang.String |
P_TOROIDAL
This parameter stipulates whether the world is toroidal or not. |
boolean |
toroidal
|
Fields inherited from class ec.Subpopulation |
---|
INDIVIDUAL_INDEX_PREAMBLE, individuals, loadInds, NUM_INDIVIDUALS_PREAMBLE, numDuplicateRetries, P_FILE, P_RETRIES, P_SPECIES, P_SUBPOPSIZE, P_SUBPOPULATION, species |
Constructor Summary | |
---|---|
Spatial1DSubpopulation()
|
Method Summary | |
---|---|
int |
getIndex(int threadnum)
Functionality: retrieve the index for a specific threanum. |
int |
getIndexRandomNeighbor(EvolutionState state,
int threadnum,
int distance)
Returns a the index of a random neighbor. |
void |
setIndex(int threadnum,
int index)
Input: a threadnumber (either for evaluation or for breeding), and an index in a subpopulation (the index in the subpopulation is, of course, associated with a location in the space) Functionality: stores the index and the threadnumber for further accesses to the getIndexRandomNeighbor method. |
void |
setup(EvolutionState state,
Parameter base)
Read additional parameters for the spatially-embedded subpopulation. |
Methods inherited from class ec.Subpopulation |
---|
defaultBase, emptyClone, populate, printSubpopulation, printSubpopulation, printSubpopulation, printSubpopulationForHumans, printSubpopulationForHumans, readSubpopulation, readSubpopulation, writeSubpopulation |
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_TOROIDAL
public boolean toroidal
Constructor Detail |
---|
public Spatial1DSubpopulation()
Method Detail |
---|
public void setup(EvolutionState state, Parameter base)
setup
in interface Setup
setup
in class Subpopulation
public void setIndex(int threadnum, int index)
Space
public int getIndex(int threadnum)
Space
public int getIndexRandomNeighbor(EvolutionState state, int threadnum, int distance)
getIndexRandomNeighbor
in interface Space
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |