Free cookie consent management tool by TermsFeed Policy Generator

source: branches/OKBJavaConnector/ECJClient/src/ec/exchange/README @ 6152

Last change on this file since 6152 was 6152, checked in by bfarka, 14 years ago

added ecj and custom statistics to communicate with the okb services #1441

File size: 6.1 KB
Line 
1This package contains two implementations of the Exchange facility in ECJ to
2perform island models.  The first implementation:
3
4  ec.exchange.InterPopulationExchange
5
6... works within a single evolutionary process, and treats each subpopulation
7as a separate "island", performing a synchronous island model among the
8subpopulations.  This is mostly of academic interest, as it only runs on a
9single evolutionary process.  Note that it's also incompatable with other
10uses of subpopulations, such as coevolution.  See the inter.params file for
11an example.
12
13
14The second implementation:
15
16  ec.exchange.IslandExchange
17
18... is an elaborate multi-process, multi-machine island model.  The system
19can perform both synchronous and asynchronous island models of any topology
20you like.  It is graceful in handling islands which disappear but cannot handle
21new islands or replacement islands.  The system is (or should be!) entirely
22compatible with the distributed evaluator, so you can have multiple islands,
23each with their own little master/slave evaluation facility.  The system also
24handles (or should) checkpointing properly.
25
26IslandExchange requires that you define an ECJ process as a "server" and
27the others as "clients".  If you like, a process can serve both as a server
28and as a client.  The clients all connect to the server and are told by the
29server how to hook up with one another in the desired topology.  The server
30also communicates signals to the clients, notably telling them to shut
31themselves down when one of the clients has discovered an optimal solution.
32
33The directories
34
35  3-Island  8-Island
36
37...contain examples of 3- and 8-island models where the server is also a
38client.  The directory
39
40  2-Island
41
42... contains an example of a simple 2-Island model with a separate server
43(thus 2 clients and 1 server).  Note that to run the server separately, you
44fire up ECJ not with ec.Evolve but with ec.exchange.IslandExchange.  See the
45README file in that directory for more information.
46
47There are a number of options in the island model, described more fully
48in the IslandExchange class documentation.  Here's a quick overview of some
49of them.
50
51A process is told to be a server (possibly in addition to being a client) with
52the parameter
53
54  exch.i-am-server=true
55
56Servers work by listening in on a socket port.  You specify this port as an
57integer, ideally above 2000 or so.  The clients will all need to know this
58port number as well.  The port is defined as:
59
60  exch.server-port= ...
61
62Communication between clients is by default compressed.  Note that Java's
63compression routines are broken (they don't support PARTIAL_FLUSH), so we
64have to rely on a third-party library called JZLIB.  You can get the jar
65file for this library on the ECJ main web page or at
66http://www.jcraft.com/jzlib/
67
68To turn compression OFF for some reason, you'd say
69
70  exch.compression = false
71
72A synchronous island model (where all islands send and receive at the same
73time) is defined by the server parameter:
74
75  exch.sync=true
76
77If this is the case, then the server can specify when the at what generation
78the exchanges begin with
79
80  exch.start= ...
81
82... and also specify the interval between exchanges as:
83
84  exch.mode= ...
85
86By default, ECJ does *asynchronous* exchanges instead, where each island is
87told independently what generation it should start at and what interval it
88should use, and the islands are free to go at their own pace rather than wait
89for the other islands synchronously. 
90
91Islands each have a "mailbox" which receives incoming individuals from the
92other islands, and after breeding they check and empty that mailbox,
93replacing some individuals in the current population with the incoming
94immigrants.  The selection procedure for the individuals to be replaced is by
95default random selection, but you can change that (see below).
96
97The server defines the number of islands as:
98
99  exch.num-islands= ...
100
101Each island is defined with several parameters in the server's parameter files.
102In the examples below, replace n with the numbers 0 through the number of
103islands (minus 1).
104
105  exch.island.n.id  The name of island number n (a string)
106  exch.island.n.num-mig How many islands this island sends to.
107  exch.island.n.mig.m The name of island number m that this island
108        sends to.  (m is a number from 0 to
109        exch.island.n.num-mig minus 1).
110  exch.island.n.size
111  exch.size (default) How many individuals this island sends to
112        each of the other islands at one time.
113  exch.island.n.start
114  exch.start (default)  What generation the island should start sending
115        (only used if asynchronous)
116  exch.island.n.mod
117  exch.mod (default)  The interval between sends (only used with
118        asynchronous)
119  exch.island.n.mailbox-capacity 
120  exch.mailbox-capacity (default) How large the island's mailbox should
121          be.  This should be large enough to
122          accept enough individuals from other
123          islands, but not so big that it's
124          larger than your population size!
125          The mailbox will overflow if full.
126          You'll need to tune this size if
127          you have some islands that are much
128          faster at sending out individuals
129          than others are at incorporating them.
130
131Once your server has defined all these topology elements, you just need to make
132some clients.  Client parameters are quite simple.  The primary ones are:
133
134  exch.server-addr  The IP address of the server, so the client
135        knows where to connect and get its marching
136        orders.
137  exch.server-port  The socket port of the server.
138  exch.client-port  The desired socket port of the client that
139        other clients will connect to it via to set up
140        the island model.  This should be different
141        than server-port if you have a client which is
142        also a server.
143  exch.id     The name of the client's island.  The server
144        will use this name information to determine the
145        topology as above.
146  exch.select   The selection method used to pick individuals
147        to emigrate TO other islands.
148  exch.select-to-die  The selection method used to pick individuals
149        to be replaced by incoming immigrants.  By
150        default this is random selection.
151
152There's more than this, but it's sufficient to understand what's going on in
153the example directories.  For more description of how things work, see
154the IslandExchange class documentation.
155
Note: See TracBrowser for help on using the repository browser.