-
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
Moran Process with Mutation #754
Conversation
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.
Awesome.
1 minor request but could you also add something to the documentation please? In particular showing how it needs to be used as an iterator?
The background noise, if any. Randomly flips plays with probability `noise`. | ||
deterministic_cache: axelrod.DeterministicCache, None | ||
A optional prebuilt deterministic cache | ||
mutation_rate: float, 0 |
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.
A lot of the literature I've seen write this in a generic way with a matrix
More of a question than a request. We could simply have that the mutation rate could either be a float or a 2 d array... (Or whatever: not suggest this needs to be done here).
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.
Yes, we could do that. This implementation uses the "standard matrix" which is 1 - mu on the diagonal and mu / (n-1) elsewhere with n being the number of types and mu the mutation rate.
In my experience this is far more common than an arbitrary mutation matrix but we can certainly generalize later.
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.
In my experience this is far more common than an arbitrary mutation matrix but we can certainly generalize later.
Yeah no doubt I'm reading theoretic stuff but in general the numeric computations would be using this form. :)
d = dict() | ||
for p in players: | ||
d[str(p)] = p | ||
mt = dict() |
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 mt
: mutation_matrix
or similar?
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.
Sure
I also made some improvements to the Moran process implementation -- it better handles unique player types now by using the string representations of the players. In the previous implementation the process would not have distinguished between
Random(0.5)
andRandom(0.25)
, for example.Re #754