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

Minor bug in traceLineage (patch.c) #41

Open
evgenyidc opened this issue Dec 13, 2017 · 0 comments
Open

Minor bug in traceLineage (patch.c) #41

evgenyidc opened this issue Dec 13, 2017 · 0 comments

Comments

@evgenyidc
Copy link
Collaborator

evgenyidc commented Dec 13, 2017

Minor bug in traceLineage() (patch.c):

Before the main loop of this function starts (while(proceed)), the function initializes the migration rate at the bottom of the lineage being detached (or re-connected). This is done in the loop between line 969 and 978 in patch.c (version 1.3.2, 13/12/2017). This initialization identifies all migration bands whose target population is the current population and whose time span includes the start time (age). If age is very close to the start/end time of a migration band, we might get a slight rounding error and not correctly identify a migration band as being relevant. This doesn't cause a significant difference in computation, but the program might later encounter Fatal Error 0007 (migration rate is not 0 at top of population). Error encountered by Laura Bertola (slouisianae_rd data set).

Short-term solution:
turn Fatal Error 0007 into a warning and allow program to continue

Mid-term solution:
change initialization of mig_rate to trace MIG_BAND_START and MIG_BAND_END events, so that it is consistent with later calculations regardless of rounding errors.

Long-term solution:
change way in which "living mig bands" are determined (not through events but through an time table. Accessing a single data structure to determine this should solve this problem.

evgenyidc added a commit that referenced this issue Dec 13, 2017
Turning 0007 into Warning not Fatal Error.
See Issue #41 in Github.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant