-
Notifications
You must be signed in to change notification settings - Fork 263
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
BM player addition #1002
BM player addition #1002
Conversation
Fixed everything, everything should be ready to merge! |
axelrod/strategies/bm.py
Outdated
|
||
class BM(Player): | ||
""" | ||
A player that is based on Bush Mosteller reinforced learning algorithm, he decides what he'll |
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 please use gender neutral pronouns? - 'it' rather than 'he'
axelrod/strategies/bm.py
Outdated
class BM(Player): | ||
""" | ||
A player that is based on Bush Mosteller reinforced learning algorithm, he decides what he'll | ||
play only depending on his own previous payoffs. |
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.
'its' not 'his'
axelrod/strategies/bm.py
Outdated
play only depending on his own previous payoffs. | ||
|
||
The probability of playing C or D will be updated using a stimulus which represents | ||
a win or a loss of value based on his previous play's payoff in the specified probability. |
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.
'its' not 'his'
axelrod/strategies/bm.py
Outdated
|
||
The probability of playing C or D will be updated using a stimulus which represents | ||
a win or a loss of value based on his previous play's payoff in the specified probability. | ||
The more a play will be rewarded through rounds , the more the player will be tempted to use it. |
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.
typo: remove the space before the comma
axelrod/strategies/bm.py
Outdated
self._learning_rate = learning_rate | ||
|
||
|
||
def stimulus_update(self, opponent: Player): |
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 method needs a docstring
axelrod/strategies/bm.py
Outdated
self._d_probability = self._d_probability + self._learning_rate * self._stimulus * self._d_probability | ||
|
||
|
||
def BM_random_choice(self) -> Action: |
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.
docstring
axelrod/tests/strategies/test_bm.py
Outdated
Note that this test is referred to in the documentation as an example on | ||
writing tests. If you modify the tests here please also modify the | ||
documentation. | ||
""" |
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.
Please remove this docstring. It doesn't apply here
@GGOUSSEAUD There are a lot of PEP8 errors in Shout on gitter if you need help with that. |
Thank you for your review, I'll patch everything that is needed when I have time, right back at you when it's done. |
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 make the name of the player and the file more verbose please?
I suggest bush_mosteller.py
and BushMosteller
.
Gotcha ! I'll fix this when I have some spare time. I'm having a tough time with PEP 8 , I get a lot of errors x) |
Added Bush Mosteller test player and player
- Improving docstrings; - PEP8 improvements; - Removing unneeded reset - Using the in built random choice - Changing the name
@GGOUSSEAUD and @meatballs in 72ba385 I've made the minor adjustments:
There might well be other things (it's been a while since I looked at this PR) that are still needed. (I've also fixed merge conflicts and rebased on to master, as it's been a while the diff was horrendous other wise :) 👍.) |
It updates it's scores every turn (but remembers them).
@marcharper: @meatballs and I have gone through and OK'd this but I did the last couple of things and made minor adjustments like memory length etc. If you could have a quick check and OK that'd be great 👍 |
No description provided.