File tree Expand file tree Collapse file tree 2 files changed +20
-15
lines changed Expand file tree Collapse file tree 2 files changed +20
-15
lines changed Original file line number Diff line number Diff line change @@ -13,3 +13,20 @@ New :code:`EvolvablePlayer` subclasses can be added to the library. Any strategy
13
13
define :code: `mutation ` and :code: `crossover ` methods can be used with the evolutionary algorithm
14
14
and the atomic mutation version of the Moran process. To use the particle swarm algorithms, methods
15
15
to serialize the strategy to and from a vector of floats must be defined.
16
+
17
+ Moran Process: Atomic Mutation for Evolvable Players
18
+ ----------------------------------------------------
19
+
20
+ Additionally, the Moran process implementation supports a second style of mutation suitable for
21
+ evolving new strategies utilizing the :code: `EvolvablePlayer ` class via its :code: `mutate ` method.
22
+ This is in contrast to the transitional mutation that selects one of the other player types rather than (possibly)
23
+ generating a new player variant. To use this mutation style set `mutation_method=atomic ` in the initialisation
24
+ of the Moran process:
25
+
26
+ >>> C = axl.Action.C
27
+ >>> players = [axl.EvolvableFSMPlayer(num_states = 2 , initial_state = 1 , initial_action = C) for _ in range (5 )]
28
+ >>> mp = axl.MoranProcess(players, turns = 10 , mutation_method = " atomic" )
29
+ >>> population = mp.play() # doctest: +SKIP
30
+
31
+ Note that this may cause the Moran process to fail to converge, if the mutation rates are very high or the
32
+ population size very large. See :ref: `moran ` for more information.
Original file line number Diff line number Diff line change @@ -99,6 +99,9 @@ use a larger population to get a bit more data::
99
99
:width: 50%
100
100
:align: center
101
101
102
+ Moran Process with Mutation
103
+ ---------------------------
104
+
102
105
The :code: `MoranProcess ` class also accepts an argument for a mutation rate.
103
106
Nonzero mutation changes the Markov process so that it no longer has absorbing
104
107
states, and will iterate forever. To prevent this, iterate with a loop (or
@@ -132,18 +135,3 @@ Other types of implemented Moran processes:
132
135
133
136
- :ref: `moran-process-on-graphs `
134
137
- :ref: `approximate-moran-process `
135
-
136
- Atomic Mutation for Evolvable Players
137
- -------------------------------------
138
-
139
- Additionally, the Moran process implementation supports a second style of mutation suitable for
140
- evolving new strategies. The :code: `EvolvablePlayer ` class supplies a method that typically produces
141
- a similar but mutated strategy. This is in contrast to the above method of mutation that selects
142
- one of the other player types rather than generating a new player type. To use this mutation style
143
- set `mutation_method=atomic `
144
-
145
- >>> C = axl.Action.C
146
- >>> players = [axl.EvolvableFSMPlayer(num_states = 2 , initial_state = 1 , initial_action = C) for _ in range (5 )]
147
- >>> mp = axl.MoranProcess(players, turns = 10 , mutation_method = " atomic" )
148
- >>> population = mp.play() # doctest: +SKIP
149
-
You can’t perform that action at this time.
0 commit comments