[6152] | 1 | This package contains two implementations of the Exchange facility in ECJ to |
---|
| 2 | perform island models. The first implementation: |
---|
| 3 | |
---|
| 4 | ec.exchange.InterPopulationExchange |
---|
| 5 | |
---|
| 6 | ... works within a single evolutionary process, and treats each subpopulation |
---|
| 7 | as a separate "island", performing a synchronous island model among the |
---|
| 8 | subpopulations. This is mostly of academic interest, as it only runs on a |
---|
| 9 | single evolutionary process. Note that it's also incompatable with other |
---|
| 10 | uses of subpopulations, such as coevolution. See the inter.params file for |
---|
| 11 | an example. |
---|
| 12 | |
---|
| 13 | |
---|
| 14 | The second implementation: |
---|
| 15 | |
---|
| 16 | ec.exchange.IslandExchange |
---|
| 17 | |
---|
| 18 | ... is an elaborate multi-process, multi-machine island model. The system |
---|
| 19 | can perform both synchronous and asynchronous island models of any topology |
---|
| 20 | you like. It is graceful in handling islands which disappear but cannot handle |
---|
| 21 | new islands or replacement islands. The system is (or should be!) entirely |
---|
| 22 | compatible with the distributed evaluator, so you can have multiple islands, |
---|
| 23 | each with their own little master/slave evaluation facility. The system also |
---|
| 24 | handles (or should) checkpointing properly. |
---|
| 25 | |
---|
| 26 | IslandExchange requires that you define an ECJ process as a "server" and |
---|
| 27 | the others as "clients". If you like, a process can serve both as a server |
---|
| 28 | and as a client. The clients all connect to the server and are told by the |
---|
| 29 | server how to hook up with one another in the desired topology. The server |
---|
| 30 | also communicates signals to the clients, notably telling them to shut |
---|
| 31 | themselves down when one of the clients has discovered an optimal solution. |
---|
| 32 | |
---|
| 33 | The directories |
---|
| 34 | |
---|
| 35 | 3-Island 8-Island |
---|
| 36 | |
---|
| 37 | ...contain examples of 3- and 8-island models where the server is also a |
---|
| 38 | client. 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 |
---|
| 44 | fire up ECJ not with ec.Evolve but with ec.exchange.IslandExchange. See the |
---|
| 45 | README file in that directory for more information. |
---|
| 46 | |
---|
| 47 | There are a number of options in the island model, described more fully |
---|
| 48 | in the IslandExchange class documentation. Here's a quick overview of some |
---|
| 49 | of them. |
---|
| 50 | |
---|
| 51 | A process is told to be a server (possibly in addition to being a client) with |
---|
| 52 | the parameter |
---|
| 53 | |
---|
| 54 | exch.i-am-server=true |
---|
| 55 | |
---|
| 56 | Servers work by listening in on a socket port. You specify this port as an |
---|
| 57 | integer, ideally above 2000 or so. The clients will all need to know this |
---|
| 58 | port number as well. The port is defined as: |
---|
| 59 | |
---|
| 60 | exch.server-port= ... |
---|
| 61 | |
---|
| 62 | Communication between clients is by default compressed. Note that Java's |
---|
| 63 | compression routines are broken (they don't support PARTIAL_FLUSH), so we |
---|
| 64 | have to rely on a third-party library called JZLIB. You can get the jar |
---|
| 65 | file for this library on the ECJ main web page or at |
---|
| 66 | http://www.jcraft.com/jzlib/ |
---|
| 67 | |
---|
| 68 | To turn compression OFF for some reason, you'd say |
---|
| 69 | |
---|
| 70 | exch.compression = false |
---|
| 71 | |
---|
| 72 | A synchronous island model (where all islands send and receive at the same |
---|
| 73 | time) is defined by the server parameter: |
---|
| 74 | |
---|
| 75 | exch.sync=true |
---|
| 76 | |
---|
| 77 | If this is the case, then the server can specify when the at what generation |
---|
| 78 | the exchanges begin with |
---|
| 79 | |
---|
| 80 | exch.start= ... |
---|
| 81 | |
---|
| 82 | ... and also specify the interval between exchanges as: |
---|
| 83 | |
---|
| 84 | exch.mode= ... |
---|
| 85 | |
---|
| 86 | By default, ECJ does *asynchronous* exchanges instead, where each island is |
---|
| 87 | told independently what generation it should start at and what interval it |
---|
| 88 | should use, and the islands are free to go at their own pace rather than wait |
---|
| 89 | for the other islands synchronously. |
---|
| 90 | |
---|
| 91 | Islands each have a "mailbox" which receives incoming individuals from the |
---|
| 92 | other islands, and after breeding they check and empty that mailbox, |
---|
| 93 | replacing some individuals in the current population with the incoming |
---|
| 94 | immigrants. The selection procedure for the individuals to be replaced is by |
---|
| 95 | default random selection, but you can change that (see below). |
---|
| 96 | |
---|
| 97 | The server defines the number of islands as: |
---|
| 98 | |
---|
| 99 | exch.num-islands= ... |
---|
| 100 | |
---|
| 101 | Each island is defined with several parameters in the server's parameter files. |
---|
| 102 | In the examples below, replace n with the numbers 0 through the number of |
---|
| 103 | islands (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 | |
---|
| 131 | Once your server has defined all these topology elements, you just need to make |
---|
| 132 | some 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 | |
---|
| 152 | There's more than this, but it's sufficient to understand what's going on in |
---|
| 153 | the example directories. For more description of how things work, see |
---|
| 154 | the IslandExchange class documentation. |
---|
| 155 | |
---|