From 0acfe8622fc38733090ec31ffcf1f269c6e23c0f Mon Sep 17 00:00:00 2001 From: Farid Date: Thu, 14 Mar 2024 20:22:16 +0000 Subject: [PATCH] fixed logic error in generateMutations --- MoranModel/MoranModel.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/MoranModel/MoranModel.cpp b/MoranModel/MoranModel.cpp index 0eae833..f400f55 100644 --- a/MoranModel/MoranModel.cpp +++ b/MoranModel/MoranModel.cpp @@ -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); }