From d443d4bc2f5a9afc54d4f35c5d3d0d826c7f5fb3 Mon Sep 17 00:00:00 2001 From: Matthew Andres Moreno Date: Wed, 13 Dec 2023 15:16:56 -0500 Subject: [PATCH] Zero memory if emtpy (should be redundant) --- avida-core/source/main/cDeme.cc | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/avida-core/source/main/cDeme.cc b/avida-core/source/main/cDeme.cc index 6887c5b20e..371bcc5a52 100644 --- a/avida-core/source/main/cDeme.cc +++ b/avida-core/source/main/cDeme.cc @@ -351,7 +351,10 @@ int cDeme::GetNumParasites() const } void cDeme::UpdateParasiteMemoryScore(const double decay) { - if (GetSize() == 0) return; + if (GetSize() == 0) { + SetParasiteMemoryScore(0.0); + return; + } const double inc = static_cast(GetNumParasites()) / GetSize(); SetParasiteMemoryScore(GetParasiteMemoryScore() * decay + inc); }