Skip to content

Commit adcc4ff

Browse files
Update cellular_automata/wa_tor.py
Co-authored-by: Tianyi Zheng <tianyizheng02@gmail.com>
1 parent bf422b1 commit adcc4ff

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

cellular_automata/wa_tor.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@ def balance_predators_and_prey(self) -> None:
204204

205205
if len(entities) >= MAX_ENTITIES - MAX_ENTITIES / 10:
206206
prey = [entity for entity in entities if entity.prey]
207-
predators = list(filter(lambda entity: entity.prey is True, entities))
207+
predators = [entity for entity in entities if not entity.prey]
208208

209209
prey_count, predator_count = len(prey), len(predators)
210210

0 commit comments

Comments
 (0)