-
Notifications
You must be signed in to change notification settings - Fork 269
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
Michaelos strategy #1091
Michaelos strategy #1091
Conversation
This reverts commit a49d448.
…emoval of SlowTitForTwoTats
Closes Axelrod-Python#1085 This doesn't fix that issue so to speak although it does just fix matplotlib as a strict requirement. The current check does not work.
Currently when we pip install axelrod we also install hypothesis. This is however only used for development. I've added a tweak to the setup.py file to just remove it from the read in requirements. I don't think we need to adjust the contributing documentation as `pip install -r requirements` will still install hypothesis.
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.
This is looking great @dmanc!
I think the classification is not correct for the memory depth.
This change will impact the failing tests. They're both failures on strategies called Meta
strategies which make use of teams of other strategies.
The first TestMetaMajorityMemoryOne
is a player that uses a team of Memory One players so this will no longer be the case (as the player is not memory one).
The second TestNMWEStochastic
is a failure for the stochastic players. That might indeed need to change (so you can just tweak the test).
axelrod/strategies/titfortat.py
Outdated
return D | ||
if self.history[-1] == D and opponent.history[-1] == C: | ||
decision = random_choice() | ||
if(decision == C): |
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.
PEP8:
if decision == C:
axelrod/strategies/titfortat.py
Outdated
|
||
name = 'Michaelos' | ||
classifier = { | ||
'memory_depth': 1, |
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.
I believe that the memory depth is not 1.
If on turn n
Michaelos defects and the opponent cooperates then 50% of the time I defect and defect throughout, However if I have already become a defector than I will defect 100% of the time so I not only need to know the previous turns (that I D and you C but I also need to know if I D'd because I have already "transformed" in to a defector).
I believe the memory depth is in fact float('inf')
:
If our actions are ...(D, D), (D, C)
then I do not know if my previous plays of D
are TfT retaliations or because I have previously been turned in to a defector so I do not know if I need to randomly sample as a result of the last round being (D, C)
.
attrs={"is_defector": False}, | ||
match_attributes={"length": -1}, seed=2) | ||
|
||
# Chance of becoming a defector is 50% after (D, C) occurs. |
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 you repeat this test with a different seed to show differing behaviour after (C, D)
(so only need 4 round please):
actions = [(C, C), (C, D), (C, C), (C, D)]
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.
Wait, I don't think this scenario is possible for the strategy unless I am misinterpreting something. After (C, D) Michaelos will play D since it is still playing like Tit-for-Tat.
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.
For the second test, does tweaking the test mean changing the expected actions?
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.
After (C, D) Michaelos will play D since it is still playing like Tit-for-Tat.
Sorry you're correct, that was a typo from me, I simply mean to include a random seed version to illustrate that 50% of the time after (D, C)
(not (C, D)
- sorry) the strategy will cooperate **and ** is_defector
will be False (so kind of like your seed=1
test but without the second (C, D)
.
For the second test, does tweaking the test mean changing the expected actions?
Yes.
How do I fix the Travis build error for python 3.5? |
I've set the build going again. It's hypothesis (a tool to find random test scenarios) falling over because it didn't find anything in time. I'll keep an eye on it, if it fails again we might need to tweak the settings but I'll assist with that. |
This looks good to me, thanks @dmanc 👍 |
Implemented a strategy from this link (specifically letter H) mentioned in #379. For some reason it shows commits that I pulled from upstream, are those supposed to be there?