Skip to content
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

Merged
merged 7 commits into from
Nov 2, 2016
Merged

Moran Process with Mutation #754

merged 7 commits into from
Nov 2, 2016

Conversation

marcharper
Copy link
Member

@marcharper marcharper commented Nov 2, 2016

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) and Random(0.25), for example.

Re #754

Copy link
Member

@drvinceknight drvinceknight left a 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
Copy link
Member

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 $M$ for mutation where $M_ij$ is the probability if mutating from species $i$ to $j$. Is that worth doing (perhaps at a later date)?

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).

Copy link
Member Author

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.

Copy link
Member

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()
Copy link
Member

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?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure

@meatballs meatballs merged commit f83b481 into master Nov 2, 2016
@meatballs meatballs deleted the moran branch November 2, 2016 11:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants