-
Notifications
You must be signed in to change notification settings - Fork 264
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
Moran process #534
Moran process #534
Conversation
89600a3
to
ed156f0
Compare
Doc tests to skip Doctest Add Moran doc to toc tree
28f2ef4
to
9de867e
Compare
|
||
def play(self): | ||
"""Play the process out to completion.""" | ||
while True: # O_o |
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.
Why this inline comment?
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.
It's not necessary
This looks really great @marcharper, I'm heading to class now. Going to take another look at it later. |
Docstring improvement More review updates
9a2d9e5
to
fc831f3
Compare
if self.noise: | ||
return True | ||
else: | ||
return any(p.classifier['stochastic'] for p in self.players) |
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 is almost identical to the one in the Match class. I think they both ought to be abstracted out somewhere.
@marcharper the
? Not too sure what but I don't like that the type of |
One of my comments on the docs seemed to have been described as 'on an outdated diff': On further_topics/probabilistict_end_tournaments.rst we have:
Perhaps do that in the docs here for consistency? |
The sequence of populations:: | ||
|
||
>>> import pprint | ||
>>> pprint.pprint(mp.populations) # doctest: +SKIP |
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.
Given the base print below, do we want the same here for consistency? (minor)
A part from my pprint/print comment inline my one remaining comment about the docs would be whether it should sit in |
I think pprint does a better job in less code in this case -- I don't have an opinion on the docs, whatever you think is best is fine. |
Fine. |
Can you move it to |
More review updates more review
697be81
to
b487bde
Compare
Ok, but I'd say the same logic applies to the ecological variant, no? |
I think that given that it comes out of the standard tournament/results class (it's a simple manipulation of the payoff matrix) I'd suggest that it should stay there. The moran process is as you said a different type of interaction all together... |
Fix doc test
609a07a
to
9a950d8
Compare
I've moved it but I don't agree with your position. IMO the main value of the library comes from
The ecological variant is somewhat of a side curiosity that isn't going to excite anyone about the library; the Moran process and other population dynamics that are actively studied would actually be of interest to other researchers. Just because the ecological variant falls out of the results for the tournament code doesn't really make it a first class citizen. I could code the Moran process to use the tournament objects to run its matches and achieve the same effect. |
Thanks :) Have marked this with a positive review.
I completely agree. I would suggest a 4th strength is the accessibility of the library: a few people have been introduced to dev, game theory and open source through it (something I'm completely delighted about).
I see what you're saying and understand/agree that from a high level game theoretic research point of view (which is certainly what the library is) that the moran process is far more of interest. However, I think the getting started tutorial should perhaps be aimed also at people who have very little knowledge of game theory. Explaining that the eco variant is based on the payoff matrix is simpler and more immediately accessible than a different interaction type: as you said the moran process is a hybrid of an n player match and a tournament. I do not at all mean that the moran process is a second citizen (far from it, and apologies if that is how I came across with this awesome contribution of yours), I just don't feel it's what's needed in the introduction (which is not only aimed at experts in game theory but also complete novices). I am 98% sure that with some of my students for whom I've said "work through the intro", I would have probably said "except the moran process", only because it requires them to create a different class to the Tournament, Results, Plot (some of my students have come to the library with not the strongest code/game theory background). No doubt experts/researchers would perhaps even come looking for the moran process and I don't think it's too hard to find (just as for the probabilistic ending tournaments). Anyway, sorry, I realise you were trying to put this to bed (perhaps we can open issue if we should chat about this further: onboarding is important to get right). I just wanted to make sure you didn't think I thought this was a second class citizen. I really do think it's awesome and am excited to learn more about it. The fact that it's heavily used in the literature is awesome. :) 👍 |
Having written that and realised that we need the Perhaps moving the ecological variant to the Further topics is the way to go. I'll leave it up to you :), either of these is fine by me:
|
Let's discuss in a future PR / on gitter. I agree that accessibility is both important and valuable aspect of the library. I think this one is good to go in pending a second review. |
Good stuff! My opinion about the docs: create something like |
@meatballs this is good to go I believe (assuming you're happy). The conversation about the docs has been moved to #536 :) |
Closes #224
The Moran process is somewhat of a hybrid of a match and a tournament. It's sort of a
n >= 2
match, but also has several rounds. The process is widely studied in the literature.