From 95080a2540b08745b4d1346836060f51eb74df9c Mon Sep 17 00:00:00 2001 From: E Shaw Date: Sun, 30 Jul 2017 17:37:39 +0800 Subject: [PATCH] solves dual problem for single dual --- axelrod/strategy_transformers.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/axelrod/strategy_transformers.py b/axelrod/strategy_transformers.py index a584be805..349ca1c1a 100644 --- a/axelrod/strategy_transformers.py +++ b/axelrod/strategy_transformers.py @@ -184,6 +184,9 @@ def reduce_for_decorated_class(self_): "__reduce__": reduce_for_decorated_class, }) + if strategy_wrapper == dual_wrapper: + setattr(new_class, 'for_dual', PlayerClass) + return new_class return Decorator @@ -317,10 +320,10 @@ def dual_wrapper(player, opponent: Player, proposed_action: Action) -> Action: flip_play_attributes(player) - if is_strategy_static(player.original_class): - action = player.original_class.strategy(opponent) + if is_strategy_static(player.for_dual): + action = player.for_dual.strategy(opponent) else: - action = player.original_class.strategy(player, opponent) + action = player.for_dual.strategy(player, opponent) flip_play_attributes(player)