MCPcopy Create free account
hub / github.com/TheAlgorithms/Python / __init__

Method __init__

cellular_automata/wa_tor.py:51–60  ·  view source on GitHub ↗
(self, prey: bool, coords: tuple[int, int])

Source from the content-addressed store, hash-verified

49 """
50
51 def __init__(self, prey: bool, coords: tuple[int, int]) -> None:
52 self.prey = prey
53 # The (row, col) pos of the entity
54 self.coords = coords
55
56 self.remaining_reproduction_time = (
57 PREY_REPRODUCTION_TIME if prey else PREDATOR_REPRODUCTION_TIME
58 )
59 self.energy_value = None if prey is True else PREDATOR_INITIAL_ENERGY_VALUE
60 self.alive = True
61
62 def reset_reproduction_time(self) -> None:
63 """

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected