private static void ChangeSpeed(OrganismPrototype organismExemplar) { if (RandomIntGenerator.random.Next(1, 4) == 1) { organismExemplar.Speed = RandomIntGenerator.random.Next(1, 6); } }
public void EnvironmentCycle(OrganismPrototype organismExmp) { Temperature += _changer.ChangeTemperature(); FoodAmount += _changer.GenerateFood(); FoodAmount -= organismExmp.FoodConsumption * organismExmp.Population; Radiation += _changer.ChangeRadiation(); }
public Launcher(int userPopulation = 10, int tempResistRange = 10) { organism = new Organism(tempResistRange, -tempResistRange, userPopulation); statisticCollector = StatisticCollector.GetInstance(); _changer = new EnvironmentChanger(10, 500); _environment = new Environment(300, 0, _changer); }
private static void ChangeTemperatureResist(OrganismPrototype organismExemplar, Environment environmentExemplar) { if (organismExemplar.MaxTempResist < environmentExemplar.Temperature) { organismExemplar.MaxTempResist += RandomIntGenerator.random.Next(0, 1); organismExemplar.MinTempResist--; } if (organismExemplar.MinTempResist > environmentExemplar.Temperature) { organismExemplar.MinTempResist += RandomIntGenerator.random.Next(0, 1); organismExemplar.MaxTempResist--; } }
public static void NaturalSelection(OrganismPrototype organism, Environment envExmp) { if (envExmp.Temperature > organism.MaxTempResist || envExmp.Temperature < organism.MinTempResist) { organism.Population--; } if (envExmp.FoodAmount < organism.FoodConsumption * organism.Population) { organism.Population--; } //TODO: remake RAD reaction if (organism.Speed < 3) { int eated = RandomIntGenerator.random.Next(0, 5); organism.Population -= eated; organism.EatedByPredators += eated; } }
public static void Evolute(OrganismPrototype organismExemplar, Environment environmentExemplar) { ChangeTemperatureResist(organismExemplar, environmentExemplar); ChangeSpeed(organismExemplar); }