@@ -48,7 +48,7 @@ class Entity:
48
48
True
49
49
"""
50
50
51
- def __init__ (self , prey : bool , coords : tuple [int , int ]):
51
+ def __init__ (self , prey : bool , coords : tuple [int , int ]) -> None :
52
52
self .prey = prey
53
53
# The (row, col) pos of the entity
54
54
self .coords = coords
@@ -205,8 +205,8 @@ def balance_predators_and_prey(self) -> None:
205
205
shuffle (entities )
206
206
207
207
if len (entities ) >= MAX_ENTITIES - MAX_ENTITIES / 10 :
208
- prey = list (filter (lambda m : m .prey is True , entities ))
209
- predators = list (filter (lambda m : m .prey is True , entities ))
208
+ prey = list (filter (lambda entity : entity .prey is True , entities ))
209
+ predators = list (filter (lambda entity : entity .prey is True , entities ))
210
210
211
211
prey_count , predator_count = len (prey ), len (predators )
212
212
@@ -471,7 +471,7 @@ def run(self, *, iteration_count: int) -> None:
471
471
472
472
>>> wt = WaTor(WIDTH, HEIGHT)
473
473
>>> wt.run(iteration_count=PREDATOR_INITIAL_ENERGY_VALUE - 1)
474
- >>> len(list(filter(lambda m: m .prey is False,
474
+ >>> len(list(filter(lambda entity: entity .prey is False,
475
475
... wt.get_entities()))) >= PREDATOR_INITIAL_COUNT
476
476
True
477
477
"""
@@ -567,7 +567,7 @@ def display_visually(wt: WaTor, iter_number: int, *, colour: bool = True) -> Non
567
567
output += "\n "
568
568
569
569
entities = wt .get_entities ()
570
- prey_count = len (list (filter (lambda m : m .prey is True , entities )))
570
+ prey_count = len (list (filter (lambda entity : entity .prey is True , entities )))
571
571
572
572
print (
573
573
f"{ output } \n Iteration: { iter_number } | Prey count: { prey_count } | "
0 commit comments