File tree Expand file tree Collapse file tree 3 files changed +31
-0
lines changed Expand file tree Collapse file tree 3 files changed +31
-0
lines changed Original file line number Diff line number Diff line change
1
+ .. _evolvable_players :
2
+
3
+ Evolvable Players
4
+ =================
5
+
6
+ Several strategies in the library derive from :code: `EvolvablePlayer ` which specifies methods
7
+ allowing evolutionary or particle swarm algorithms to be used with these strategies. The
8
+ `Axelrod Dojo library <https://github.com/Axelrod-Python/axelrod-dojo >`_ [Axelrod1980 ]_
9
+ contains implementations of both algorithms for use with the Axelrod library. Examples include
10
+ FSMPlayers, ANN (neural networks), and LookerUp and Gambler (lookup tables).
11
+
12
+ New :code: `EvolvablePlayer ` subclasses can be added to the library. Any strategy that can
13
+ define :code: `mutation ` and :code: `crossover ` methods can be used with the evolutionary algorithm
14
+ and the atomic mutation version of the Moran process. To use the particle swarm algorithms, methods
15
+ to serialize the strategy to and from a vector of floats must be defined.
Original file line number Diff line number Diff line change @@ -18,3 +18,4 @@ Contents:
18
18
ecological_variant.rst
19
19
fingerprinting.rst
20
20
meta_strategies.rst
21
+ evolvable_players.rst
Original file line number Diff line number Diff line change @@ -132,3 +132,18 @@ Other types of implemented Moran processes:
132
132
133
133
- :ref: `moran-process-on-graphs `
134
134
- :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