ENH: Add ZeroResp strategy (#2 in Medium Pool benchmark) - #1495
Closed
Evreu1pro wants to merge 4 commits into
Closed
ENH: Add ZeroResp strategy (#2 in Medium Pool benchmark)#1495Evreu1pro wants to merge 4 commits into
Evreu1pro wants to merge 4 commits into
Conversation
Adds an adaptive state-machine strategy with dynamic epochs, a stochastic
retaliation buffer (5 + U{1..10}), and a permanent red-line ban after
systemic defections. Includes unit tests (initial C, buffer queue, red line,
reset), strategy registration, classifier entry, and docs index update.
Adds tests for match-length edge cases, end-game harvest, anti-raider, hostile live ban, and epoch/red-line close paths. Updates stochastic and makes_use_of length filter counts after registering ZeroResp.
NumPy 2.x changes scalar repr (np.int64/np.float64) which breaks doctests, match.scores output, and fingerprint probe string equality under CI. Tox already pins numpy==1.26.4 for install_deps; package deps were upgrading to 2.x via numpy>=1.26.4. Constrain the dependency and harden Point creation.
pytest already green (5252 passed, 100% coverage). CI failed on black --check for test_zeroresp and a few pre-existing modules under black 26.x. Format those files so tox commands[1] passes.
Merged
Author
|
Closing in favour of #1496, which includes ZeroResp and the tournament-ready ZeroResp v2 (rev 2.2), plus CI fixes and a fuller test suite. Showcase package: https://github.com/Evreu1pro/ZeroResp |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Adds ZeroResp, an adaptive long-memory strategy for the iterated Prisoner's Dilemma.
Why
ZeroResp combines:
5 + U{1..10}) — delays punishment to avoid cascade wars and to disrupt short-horizon MDP / Q-learning estimates.is_red_line = True) after systemic abuse (dynamic threshold 2–3).Pre-submission benchmarks (external sandbox): Axelrod medium pool rank #2 (median ≈ 2.918).
How to test
Covered:
is_red_line = Truereset()cleans state for multi-rep tournamentsChanges
axelrod/strategies/zeroresp.py— strategyaxelrod/tests/strategies/test_zeroresp.py— TestPlayer suiteaxelrod/strategies/_strategies.py— registration (from ._strategies import *viastrategies/__init__.py)axelrod/data/all_classifiers.yml— classifier entrydocs/reference/strategy_index.rst— documentation automoduledocs/index.rst— strategy count doctest243 → 244Breaking
No — additive strategy only.