Skip to content

Commit

Permalink
fixed logic error in generateMutations
Browse files Browse the repository at this point in the history
  • Loading branch information
Farid committed Mar 14, 2024
1 parent 4d3e766 commit 0acfe86
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions MoranModel/MoranModel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -67,13 +67,13 @@ void MoranProcess::generateMuts(){
}

mutations.insert(mutations.end(), population*events, 0);
std::uniform_int_distribution<> pick_line (0,population);
std::uniform_int_distribution<> pick_line (0,population-1);
int line;

for (int i = 0; i < events; ++i) {
while (allocations.at(i) > 0){
line = pick_line(engine);
++mutations.at(i+line);
++mutations.at(population*i+line);

--allocations.at(i);
}
Expand Down

0 comments on commit 0acfe86

Please sign in to comment.