ec.exchange
Class AbstractIslandExchangeServer<D extends IslandInfo>

java.lang.Object
  extended by ec.exchange.AbstractIslandExchangeServer<D>
Direct Known Subclasses:
IslandExchangeServer

public abstract class AbstractIslandExchangeServer<D extends IslandInfo>
extends java.lang.Object

Base class for island exchange servers. This contains parameter declarations and methods common to both the ECJ island server and the ORIGIN Frontier-based island implementation.


Field Summary
 int global_modulo
          If synchronous this generation modulo is used for all islands
 int global_offset
          If synchronous this generation offset is used for all islands
 java.util.HashMap<java.lang.String,D> info
          Maps between island ids and info structures
 java.lang.String[] island_ids
          Island ids from parameter files
 int numIslands
          The number of islands in the topology
static java.lang.String P_ID
          The id
static java.lang.String P_ISLAND
          The parameter for the island's information
static java.lang.String P_MIGRATING_ISLAND
          the parameter for migrating islands' ids
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_NUM_INCOMING_MIGRATING_COUNTRIES
           
static java.lang.String P_NUM_ISLANDS
          The number of islands
static java.lang.String P_NUM_MIGRATING_COUNTRIES
          The number of islands where emigrants will be sent
static java.lang.String P_OFFSET
          How many generations to pass at the beginning of the evolution before the first emigration from the current island
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_SYNCHRONOUS
          Whether the execution should be synchronous or asynchronous
 boolean synchronous
          true if islands execute synchronously
 
Constructor Summary
AbstractIslandExchangeServer()
           
 
Method Summary
 D getIsland(java.lang.String islandId)
          Gets island info
 java.util.Collection<D> islands()
           
protected abstract  D setupIslandInfo(EvolutionState state, Parameter localBase, Parameter islandBase)
           
 void setupServerFromDatabase(EvolutionState state, Parameter base)
           
protected  void setupStandardIslandInfo(EvolutionState state, Parameter localBase, IslandInfo ieii)
          Populates island info from parameter database
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

P_NUM_ISLANDS

public static final java.lang.String P_NUM_ISLANDS
The number of islands

See Also:
Constant Field Values

P_ISLAND

public static final java.lang.String P_ISLAND
The parameter for the island's information

See Also:
Constant Field Values

P_ID

public static final java.lang.String P_ID
The id

See Also:
Constant Field Values

P_NUM_INCOMING_MIGRATING_COUNTRIES

public static final java.lang.String P_NUM_INCOMING_MIGRATING_COUNTRIES
See Also:
Constant Field Values

P_NUM_MIGRATING_COUNTRIES

public static final java.lang.String P_NUM_MIGRATING_COUNTRIES
The number of islands where emigrants will be sent

See Also:
Constant Field Values

P_MIGRATING_ISLAND

public static final java.lang.String P_MIGRATING_ISLAND
the parameter for migrating islands' ids

See Also:
Constant Field Values

P_MODULO

public static final java.lang.String P_MODULO
The parameter for the modulo (how many generations should pass between consecutive sendings of individuals

See Also:
Constant Field Values

P_SIZE

public static final java.lang.String P_SIZE
The number of emigrants to be sent

See Also:
Constant Field Values

P_OFFSET

public static final java.lang.String P_OFFSET
How many generations to pass at the beginning of the evolution before the first emigration from the current island

See Also:
Constant Field Values

P_SYNCHRONOUS

public static final java.lang.String P_SYNCHRONOUS
Whether the execution should be synchronous or asynchronous

See Also:
Constant Field Values

P_SELECT_METHOD

public static final java.lang.String P_SELECT_METHOD
The selection method for sending individuals to other islands

See Also:
Constant Field Values

P_SELECT_TO_DIE_METHOD

public static final java.lang.String P_SELECT_TO_DIE_METHOD
The selection method for deciding individuals to be replaced by immigrants

See Also:
Constant Field Values

numIslands

public int numIslands
The number of islands in the topology


island_ids

public java.lang.String[] island_ids
Island ids from parameter files


info

public java.util.HashMap<java.lang.String,D extends IslandInfo> info
Maps between island ids and info structures


synchronous

public boolean synchronous
true if islands execute synchronously


global_modulo

public int global_modulo
If synchronous this generation modulo is used for all islands


global_offset

public int global_offset
If synchronous this generation offset is used for all islands

Constructor Detail

AbstractIslandExchangeServer

public AbstractIslandExchangeServer()
Method Detail

setupServerFromDatabase

public void setupServerFromDatabase(EvolutionState state,
                                    Parameter base)

islands

public java.util.Collection<D> islands()
Returns:
Collection of islands

getIsland

public D getIsland(java.lang.String islandId)
Gets island info

Parameters:
islandId - Island id
Returns:
Island info for this island, or null if the island doesn't exist.

setupIslandInfo

protected abstract D setupIslandInfo(EvolutionState state,
                                     Parameter localBase,
                                     Parameter islandBase)

setupStandardIslandInfo

protected void setupStandardIslandInfo(EvolutionState state,
                                       Parameter localBase,
                                       IslandInfo ieii)
Populates island info from parameter database

Parameters:
state - Evolution state
localBase - Island parameter base
ieii - Island info