Update cellular_automata/wa_tor.py

Co-authored-by: Tianyi Zheng <tianyizheng02@gmail.com>
This commit is contained in:
Caeden Perelli-Harris 2023-07-30 19:37:40 +01:00 committed by GitHub
parent bf422b1f32
commit adcc4ff659
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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)