palaeoware / trevosim

TREvoSim - The [Tr]ee [Evo]lutionary [Sim]ulator program
GNU General Public License v3.0
5 stars 3 forks source link

Playing field mixing #62

Open ms609 opened 1 month ago

ms609 commented 1 month ago

A couple of areas I've found confusing about playing field mixing.

RussellGarwood commented 1 month ago

Thanks for this Martin, and sorry that sorting took me a short time - my coding time has been spent trying to set up a new laptop to build software etc.!

With the above commits I have changed the wording on mixing to highlight that it is a precentage, rather than a probability (docs update dcoming), and also added a limit to the spin boxes at 100 - this was an oversight on my part! You are correct though that it was treated as equivalent to 100%.

Line 1205 multiplies this by ten when increased mixing is included in the settings during a perturbation (docs 7.2 "Increase mixing for perturbation period"). As such this is intended, as long as in your working log you had this setting enabled! I can't find any way in the code to reach this point without that being the case.

ms609 commented 1 month ago

Ah, okay, that makes sense.

I get that "increased mixing" is a heuristic rather than an exact replication of a specific physical process. But I'd be slightly uncomfortable implementing this as a simple ×10 multiplier, which will produce probabilities > 1. This means that a mixing of 10% and 20% would behave equivalently (both with certainty of a single mixing event per generation) during the "increased mixing" phase.

Have you considered raising the probability (of not mixing) to a power of ten; or implementing a binomial distribution that allows multiple "mixes" per generation during the mixing step?

RussellGarwood commented 1 month ago

This is a very good point, and is not one that had struck me before though now you point it out it is obvious... If acceptable, I suggest I improve the documentation to make this point abundantly clear in the 3.0.0 release to accompany the JOSS paper, and then change the behaviour for a subsequent release to something more sensible - i.e. give two opportunities for mixing during the increase periods as you suggest thus doubling the base probability irrespective of what it is. Sound OK? If so I will leave this open and address in coming weeks

ms609 commented 1 month ago

Sounds good (so long as you can avoid committing to maintaining both implementations for the purposes of backwards compatibility!)

RussellGarwood commented 1 month ago

Thanks, and indeed! This feature is not being user in earnest for any studies that may require backwards compatability currently, so there should be no need to keep the old version when it is updated.