-
Notifications
You must be signed in to change notification settings - Fork 278
Some strategy reorganizations #296
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Some strategy reorganizations #296
Conversation
…efines basic_strategies automatically. Handles dependency issues with Meta strategies.
…ifier dictionary; various PEP8
…chastic due to inconsistency and favoring explicit over implicit
axelrod/strategies/__init__.py
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this still give the same set of strategies as before?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could we include a test for it similar to the one for is_cheater
? https://github.com/Axelrod-Python/Axelrod/blob/master/axelrod/tests/unit/test_classification.py#L54
This all looks good to me, just the one comment about the basic_strategies. |
basic_strategies is bit bigger now:
I think this makes sense though, Bully, SuspiciousTitForTat, and AntiTitForTat are very similar to TitForTat (as is WSLS); Alternator would be CyclerCD. |
Cool, thanks for the test and I'm happy with the new basic strategies but now the docs need updating - there's that example with basic_strategies... Again the docs need a whole revamp I think and a lot of tlc but if you could change it to something that was not wrong with the new code? |
The new scores are a bit ugly, I'm not sure if they were rounded the last time around. |
I liked the simplicity of the previous four basic strategies. On Tue, Sep 15, 2015 at 8:56 AM, Marc Harper, PhD notifications@github.com
|
I thought the same but did like the simplicity of the creation of the new ones. Perhaps creating another (loath to suggest this) list which is example_strategies or something which really is to just create an example tournament? |
Ultimately the question is: what are the |
Well yeah, that's why it was called basic :) it's like the smallest On Tue, Sep 15, 2015 at 12:07 PM, Vince Knight notifications@github.com
|
Actually this list isn't correct -- the cycler strategies have memory_depth greater than 1 and are misclassified. Let me fix this, and check the others. |
Ok, now the list is: Alternator We could bump GoByMajority by excluding the default case (memory_depth 0, which is somewhat trivial). There are already multiple derivatives with depth 5, 10, 20, and 40. |
@meatballs Can you please check that the tournament_factory tests and run_axelrod still make sense now that basic_strategies is a subset of ordinary strategies? |
I thought basic_strategies being a subset was a non issue? I think someone Re the actual list: I've thought about it more. While I like the simpler The slight issue I have with the new basic_strategies is that that demo is In that vain, perhaps creating the same old list but calling it Having said all that, I'm not terribly against the change. Although for I'm just voicing where I stand, if the new list becomes popular: fine but Heading to bed :) On Tue, 15 Sep 2015 21:46 Marc Harper, PhD notifications@github.com wrote:
|
I guess I don't understand what the issue is -- seems to me like you could just do:
In any case, I don't really care much about basic_strategies, and if you all want to revert it to a static list that's fine with me. It was just on the todo list of #294, so I did it. Some of the other changes I introduced are important though (some strategies were not classified properly, and they need to be instantiated before they are filtered, so the movement of the meta strategies is also necessary). For the record, I don't see why any of the strategies other than GoByMajority are hard to explain (and I recommended removing that one above). The others essentially do something very similar to TFT, e.g. defecting initially instead. If someone does want to update the usage docs with a different list, here is the script I used to make it easier:
|
Yeah completely agree about everything else - this is a valuable PR. I On Tue, 15 Sep 2015 23:04 Marc Harper, PhD notifications@github.com wrote:
|
That is also my vote, for all the reasons Vince pointed out. Everything else here is great. |
Ok, so I woke up and realised I was going to be a pain to everyone... I think there might be merit in changing the Great job @marcharper ! |
Some strategy reorganizations
I have opened #297. |
Some strategy reorganizations
It is necessary to instantiate strategies to determine the proper classifiers since
__init__
can overwrite them. This PR has the following changes:_strategies.py
strategies/__init__.py
. This is necessary because instantiating the Meta strategies creates a circular dependency, so they have to be appended afterward.