From 3289ad8c3dbe08728b2b5a3afcf5307950bd55f2 Mon Sep 17 00:00:00 2001 From: Matthew Andres Moreno Date: Thu, 23 Nov 2023 21:33:39 -0500 Subject: [PATCH] Bugfix: actually apply immune protection Original diff must have gotten lost in the mix --- avida-core/source/main/cPopulation.cc | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/avida-core/source/main/cPopulation.cc b/avida-core/source/main/cPopulation.cc index 592b83377..2dfbdd54d 100644 --- a/avida-core/source/main/cPopulation.cc +++ b/avida-core/source/main/cPopulation.cc @@ -1211,6 +1211,12 @@ bool cPopulation::ActivateParasite(cOrganism* host, Systematics::UnitPtr parent, ){ cDeme& deme = GetDeme(m_world->GetMigrationMatrix().GetProbabilisticDemeID(host_cell.GetDemeID(), m_world->GetRandom(),true)); const int infection_mode = m_world->GetConfig().DEMES_PARASITE_MIGRATION_TARGET_SELECTION_METHOD.Get(); + const auto immune_thresh = m_world->GetConfig().DEMES_PARASITE_MIGRATION_MEMORY_SCORE_PROTECTIVE_THRESHOLD.Get(); + if ( + immune_thresh != 0.0 + && deme.GetParasiteMemoryScore() >= immune_thresh + ) return false; + if (infection_mode == 0) { // Implementation #1 - Picks randomly of ALL cells in to-deme and then finds if the one it chose was occupied // -- Not ensured to infect an individual