From adcc4ff65962696ece40ee6069adb19e5a404d09 Mon Sep 17 00:00:00 2001 From: Caeden Perelli-Harris Date: Sun, 30 Jul 2023 19:37:40 +0100 Subject: [PATCH] Update cellular_automata/wa_tor.py Co-authored-by: Tianyi Zheng --- cellular_automata/wa_tor.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cellular_automata/wa_tor.py b/cellular_automata/wa_tor.py index c87561f17..cb9252aed 100644 --- a/cellular_automata/wa_tor.py +++ b/cellular_automata/wa_tor.py @@ -204,7 +204,7 @@ class WaTor: if len(entities) >= MAX_ENTITIES - MAX_ENTITIES / 10: prey = [entity for entity in entities if entity.prey] - predators = list(filter(lambda entity: entity.prey is True, entities)) + predators = [entity for entity in entities if not entity.prey] prey_count, predator_count = len(prey), len(predators)