Skip to content

Commit 3b7d9b6

Browse files
committed
Move EvolvablePlayer Moran docs to further_topics
1 parent e95b41c commit 3b7d9b6

File tree

2 files changed

+20
-15
lines changed

2 files changed

+20
-15
lines changed

docs/tutorials/further_topics/evolvable_players.rst

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,20 @@ New :code:`EvolvablePlayer` subclasses can be added to the library. Any strategy
1313
define :code:`mutation` and :code:`crossover` methods can be used with the evolutionary algorithm
1414
and the atomic mutation version of the Moran process. To use the particle swarm algorithms, methods
1515
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.

docs/tutorials/getting_started/moran.rst

Lines changed: 3 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,9 @@ use a larger population to get a bit more data::
9999
:width: 50%
100100
:align: center
101101

102+
Moran Process with Mutation
103+
---------------------------
104+
102105
The :code:`MoranProcess` class also accepts an argument for a mutation rate.
103106
Nonzero mutation changes the Markov process so that it no longer has absorbing
104107
states, and will iterate forever. To prevent this, iterate with a loop (or
@@ -132,18 +135,3 @@ Other types of implemented Moran processes:
132135

133136
- :ref:`moran-process-on-graphs`
134137
- :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-

0 commit comments

Comments
 (0)