| Modifier and Type | Class and Description |
|---|---|
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.
|
| Modifier and Type | Field and Description |
|---|---|
(package private) String[] |
connected_island_ids |
static String |
FOUND
The found message
|
static int |
FOUND_TIMEOUT
How much to wait for the found message (on a non-blocking socket)
|
static String |
GOODBYE
The final message to be sent to all islands when an individual has been found
|
(package private) Hashtable |
info |
(package private) Hashtable |
info_immigrants |
(package private) String[] |
island_ids |
static int |
ISLAND_INDEX_LOOKUP_FAILED |
static Parameter |
islandIndexBase |
static Parameter |
islandIndexNumIslands |
(package private) int |
numIslands |
static String |
OKAY
The okay message
|
static String |
P_ID
The id
|
static String |
P_ISLAND
The parameter for the island's information
|
static String |
P_MAILBOX_CAPACITY
The size of the mailbox (for each of the subpopulations)
|
static String |
P_MIGRATING_ISLAND
the parameter for migrating islands' ids
|
static String |
P_MODULO
The parameter for the modulo (how many generations should pass between consecutive sendings of individuals
|
static String |
P_NUM_INCOMING_MIGRATING_COUNTRIES |
static String |
P_NUM_ISLANDS
The number of islands
|
static String |
P_NUM_MIGRATING_COUNTRIES
The number of islands where immigrants will be sent
|
static String |
P_OFFSET
How many generations to pass at the beginning of the evolution before the first emigration from the current island
|
static String |
P_SERVER_PORT
The server port
|
static String |
P_SIZE
The number of immigrants to be sent
|
static String |
P_SYNCHRONOUS
Whether the execution should be synchronous or asynchronous
|
static String |
RUN
The run message to be sent to the clients
|
(package private) int |
serverPort |
(package private) ServerSocket |
serverSocket |
static int |
SLEEP_TIME
How much to sleep between checking for a FOUND message
|
(package private) EvolutionState |
state |
static String |
SYNC
The synchronize message
|
(package private) boolean |
synchronous |
(package private) boolean[] |
who_is_synchronized |
| Constructor and Description |
|---|
IslandExchangeServer() |
| Modifier and Type | Method and Description |
|---|---|
int |
getIslandIndex(EvolutionState state,
String id)
Looks up the island id in the parameter database, assuming something like
exch.island.1.id = GilligansIsland
Then returns the index number (in the example before, this would be 1).
|
void |
run()
The main function running in the thread
|
void |
setupServerFromDatabase(EvolutionState state_p,
Parameter base)
This setup should get called from the IslandExchange setup method.
|
Thread |
spawnThread()
Here we spawn off the thread on ourselves
|
public static final String P_SERVER_PORT
public static final String P_NUM_ISLANDS
public static final String P_ISLAND
public static final String P_ID
public static final String P_NUM_INCOMING_MIGRATING_COUNTRIES
public static final String P_NUM_MIGRATING_COUNTRIES
public static final String P_MIGRATING_ISLAND
public static final String P_MAILBOX_CAPACITY
public static final String P_MODULO
public static final String P_SIZE
public static final String P_OFFSET
public static final String P_SYNCHRONOUS
public static final String RUN
public static final int FOUND_TIMEOUT
public static final int SLEEP_TIME
public static final String GOODBYE
public static final String FOUND
public static final String OKAY
public static final String SYNC
int numIslands
int serverPort
ServerSocket serverSocket
Hashtable info
Hashtable info_immigrants
EvolutionState state
String[] island_ids
String[] connected_island_ids
boolean synchronous
boolean[] who_is_synchronized
public static final int ISLAND_INDEX_LOOKUP_FAILED
public static final Parameter islandIndexBase
public static final Parameter islandIndexNumIslands
public void setupServerFromDatabase(EvolutionState state_p, Parameter base)
public void run()
public Thread spawnThread()
public int getIslandIndex(EvolutionState state, String id)
Copyright © 2014 Evolutionary Computation Laboratory at George Mason University. All rights reserved.