Skip to content
Snippets Groups Projects
Commit 93dcdd89 authored by Aymeric berthoumieu's avatar Aymeric berthoumieu
Browse files

update

parent 451538ec
No related branches found
No related tags found
1 merge request!20Aymeric
...@@ -110,6 +110,7 @@ vector<Animal*> PetFactory::initializePopulation(int number){ ...@@ -110,6 +110,7 @@ vector<Animal*> PetFactory::initializePopulation(int number){
for (const auto &nbPetsPerBehaviourPair : toCreate) { for (const auto &nbPetsPerBehaviourPair : toCreate) {
createdNumber = createdNumber + static_cast<int>(nbPetsPerBehaviourPair.second); createdNumber = createdNumber + static_cast<int>(nbPetsPerBehaviourPair.second);
for (int _i=0; _i<nbPetsPerBehaviourPair.second; _i++) { for (int _i=0; _i<nbPetsPerBehaviourPair.second; _i++) {
cout << " " << nbPetsPerBehaviourPair.first << endl;
createdPets.push_back(this->createMember(nbPetsPerBehaviourPair.first)); createdPets.push_back(this->createMember(nbPetsPerBehaviourPair.first));
} }
// in case the rounding, while casting to int, results in a lower number of created pets than requested // in case the rounding, while casting to int, results in a lower number of created pets than requested
...@@ -118,6 +119,7 @@ vector<Animal*> PetFactory::initializePopulation(int number){ ...@@ -118,6 +119,7 @@ vector<Animal*> PetFactory::initializePopulation(int number){
const auto nbPetsPerBehaviourPair = toCreate.end(); const auto nbPetsPerBehaviourPair = toCreate.end();
createdPets.push_back(this->createMember(nbPetsPerBehaviourPair->first)); createdPets.push_back(this->createMember(nbPetsPerBehaviourPair->first));
} }
statistics.saveData();
return createdPets; return createdPets;
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment