File tree Expand file tree Collapse file tree 1 file changed +17
-0
lines changed
Expand file tree Collapse file tree 1 file changed +17
-0
lines changed Original file line number Diff line number Diff line change @@ -132,6 +132,23 @@ after two consequtive rounds of `(D, C)`::
132132 >>> from axelrod.strategy_transformers import TrackHistoryTransformer
133133 >>> player = TrackHistoryTransformer(axelrod.Random)()
134134
135+ * :code: `MutateTransformer `: Randomly plays a mutation to another strategy (or
136+ set of strategies. Here is the syntax to do this with a set of strategies::
137+
138+ >>> import axelrod
139+ >>> from axelrod.strategy_transformers import MutateTransformer
140+ >>> strategies = [axelrod.Grudger, axelrod.TitForTat]
141+ >>> probability = [.2, .3] # .5 chance of mutated to one of above
142+ >>> player = MutateTransformer(probability, strategies)(axelrod.Cooperator)
143+
144+ Here is the syntax when passing a single strategy::
145+
146+ >>> import axelrod
147+ >>> from axelrod.strategy_transformers import MutateTransformer
148+ >>> strategy = axelrod.Grudger
149+ >>> probability = .2
150+ >>> player = MutateTransformer(probability, strategy)(axelrod.Cooperator)
151+
135152
136153Composing Transformers
137154----------------------
You can’t perform that action at this time.
0 commit comments