public class Spatial1DSubpopulation extends Subpopulation implements 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?) |
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
P_TOROIDAL
This parameter stipulates whether the world is toroidal or not.
|
boolean |
toroidal |
extraBehavior, file, FILL, INDIVIDUAL_INDEX_PREAMBLE, individuals, initialSize, loadInds, NUM_INDIVIDUALS_PREAMBLE, numDuplicateRetries, P_EXTRA_BEHAVIOR, P_FILE, P_RETRIES, P_SPECIES, P_SUBPOPSIZE, P_SUBPOPULATION, parents, species, TRUNCATE, V_FILL, V_TRUNCATE, V_WRAP, WRAP
Constructor and Description |
---|
Spatial1DSubpopulation() |
Modifier and Type | Method and Description |
---|---|
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.
|
clear, defaultBase, emptyClone, populate, printSubpopulation, printSubpopulation, printSubpopulation, printSubpopulationForHumans, printSubpopulationForHumans, readSubpopulation, readSubpopulation, truncate, writeSubpopulation
public static final java.lang.String P_TOROIDAL
public boolean toroidal
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