ec.exchange
Class IslandExchangeServer

java.lang.Object
  extended by ec.exchange.AbstractIslandExchangeServer
      extended by ec.exchange.IslandExchangeServer
All Implemented Interfaces:
java.lang.Runnable

public class IslandExchangeServer
extends AbstractIslandExchangeServer
implements java.lang.Runnable

The IslandExchangeServer is the class that manages the main server that coordinates all the islands. The class implements Runnable (for running on a different thread).


Nested Class Summary
static class IslandExchangeServer.IslandExchangeIslandInfo
          A class indicating all the information the server knows about a given island, including its mod, size, offset, and all the migrating islands it hooks to, etc.
 
Field Summary
static java.lang.String FOUND
          The found message
static int FOUND_TIMEOUT
          How much to wait for the found message (on a non-blocking socket)
static java.lang.String GOODBYE
          The final message to be sent to all islands when an individual has been found
static java.lang.String OKAY
          The okay message
static java.lang.String P_MAILBOX_CAPACITY
          The size of the mailbox (for each of the subpopulations)
static java.lang.String P_SERVER_PORT
          The server port
static java.lang.String RUN
          The run message to be sent to the clients
static int SLEEP_TIME
          How much to sleep between checking for a FOUND message
static java.lang.String SYNC
          The synchronize message
 
Fields inherited from class ec.exchange.AbstractIslandExchangeServer
global_modulo, global_offset, info, island_ids, numIslands, P_ID, P_ISLAND, P_MIGRATING_ISLAND, P_MODULO, P_NUM_INCOMING_MIGRATING_COUNTRIES, P_NUM_ISLANDS, P_NUM_MIGRATING_COUNTRIES, P_OFFSET, P_SELECT_METHOD, P_SELECT_TO_DIE_METHOD, P_SIZE, P_SYNCHRONOUS, synchronous
 
Constructor Summary
IslandExchangeServer()
           
 
Method Summary
 void run()
          The main function running in the thread
protected  IslandInfo setupIslandInfo(EvolutionState state, Parameter localBase, Parameter islandBase)
          Populates ECJ island info.
 void setupServerFromDatabase(EvolutionState state_p, Parameter base)
          This setup should get called from the IslandExchange setup method.
 java.lang.Thread spawnThread()
          Here we spawn off the thread on ourselves
 
Methods inherited from class ec.exchange.AbstractIslandExchangeServer
getIsland, islands, setupStandardIslandInfo
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

P_SERVER_PORT

public static final java.lang.String P_SERVER_PORT
The server port

See Also:
Constant Field Values

P_MAILBOX_CAPACITY

public static final java.lang.String P_MAILBOX_CAPACITY
The size of the mailbox (for each of the subpopulations)

See Also:
Constant Field Values

RUN

public static final java.lang.String RUN
The run message to be sent to the clients

See Also:
Constant Field Values

FOUND_TIMEOUT

public static final int FOUND_TIMEOUT
How much to wait for the found message (on a non-blocking socket)

See Also:
Constant Field Values

SLEEP_TIME

public static final int SLEEP_TIME
How much to sleep between checking for a FOUND message

See Also:
Constant Field Values

GOODBYE

public static final java.lang.String GOODBYE
The final message to be sent to all islands when an individual has been found

See Also:
Constant Field Values

FOUND

public static final java.lang.String FOUND
The found message

See Also:
Constant Field Values

OKAY

public static final java.lang.String OKAY
The okay message

See Also:
Constant Field Values

SYNC

public static final java.lang.String SYNC
The synchronize message

See Also:
Constant Field Values
Constructor Detail

IslandExchangeServer

public IslandExchangeServer()
Method Detail

setupServerFromDatabase

public void setupServerFromDatabase(EvolutionState state_p,
                                    Parameter base)
This setup should get called from the IslandExchange setup method.

Overrides:
setupServerFromDatabase in class AbstractIslandExchangeServer

setupIslandInfo

protected IslandInfo setupIslandInfo(EvolutionState state,
                                     Parameter localBase,
                                     Parameter islandBase)
Populates ECJ island info.

Specified by:
setupIslandInfo in class AbstractIslandExchangeServer

run

public void run()
The main function running in the thread

Specified by:
run in interface java.lang.Runnable

spawnThread

public java.lang.Thread spawnThread()
Here we spawn off the thread on ourselves