mirror of
https://github.com/TheAlgorithms/Python.git
synced 2025-02-25 10:28:39 +00:00
Update cellular_automata/wa_tor.py
Co-authored-by: Tianyi Zheng <tianyizheng02@gmail.com>
This commit is contained in:
parent
bf422b1f32
commit
adcc4ff659
@ -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)
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user