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 |
|---|---|
(package private) int[] |
indexes |
static String |
P_TOROIDAL
This parameter stipulates whether the world is toroidal or not.
|
boolean |
toroidal |
extraBehavior, file, FILL, INDIVIDUAL_INDEX_PREAMBLE, individuals, loadInds, NUM_INDIVIDUALS_PREAMBLE, numDuplicateRetries, P_EXTRA_BEHAVIOR, P_FILE, P_RETRIES, P_SPECIES, P_SUBPOPSIZE, P_SUBPOPULATION, 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, writeSubpopulationpublic static final String P_TOROIDAL
public boolean toroidal
int[] indexes
public void setup(EvolutionState state, Parameter base)
setup in interface Setupsetup in class Subpopulationpublic void setIndex(int threadnum,
int index)
Spacepublic int getIndex(int threadnum)
Spacepublic int getIndexRandomNeighbor(EvolutionState state, int threadnum, int distance)
getIndexRandomNeighbor in interface SpaceCopyright © 2014 Evolutionary Computation Laboratory at George Mason University. All rights reserved.