>>> e = Entity(True, coords=(0, 0)) >>> e.reset_reproduction_time() >>> e.remaining_reproduction_time == PREY_REPRODUCTION_TIME True >>> e = Entity(False, coords=(0, 0)) >>> e.reset_reproduction_time() >>> e.remaining_reproduction_time == PRED
(self)
| 60 | self.alive = True |
| 61 | |
| 62 | def reset_reproduction_time(self) -> None: |
| 63 | """ |
| 64 | >>> e = Entity(True, coords=(0, 0)) |
| 65 | >>> e.reset_reproduction_time() |
| 66 | >>> e.remaining_reproduction_time == PREY_REPRODUCTION_TIME |
| 67 | True |
| 68 | >>> e = Entity(False, coords=(0, 0)) |
| 69 | >>> e.reset_reproduction_time() |
| 70 | >>> e.remaining_reproduction_time == PREDATOR_REPRODUCTION_TIME |
| 71 | True |
| 72 | """ |
| 73 | self.remaining_reproduction_time = ( |
| 74 | PREY_REPRODUCTION_TIME if self.prey is True else PREDATOR_REPRODUCTION_TIME |
| 75 | ) |
| 76 | |
| 77 | def __repr__(self) -> str: |
| 78 | """ |