def test_little_fodder(self, example_herbivore): herbivore = example_herbivore herbivore_weight_if_not_limited = (herbivore.weight + herbivore.beta * herbivore.F) savannah = land.Savannah() savannah.f = random.randint(0, (herbivore.F - 1)) savannah.feeding() assert herbivore.weight < herbivore_weight_if_not_limited
class TestSavannah(BaseTestLandscapes): LandscapeType = land.Savannah()
def example_savannah(): params = land.Savannah.params.copy() yield land.Savannah() land.Savannah.params = params
def test_migration(self, example_carnivore): cell1, cell2 = land.Savannah(), land.Savannah() cell1.population["Carnivore"].append(example_carnivore) example_carnivore.move(cell1, cell2) assert len(cell2.population["Carnivore"]) == 1