Commit 65abe823 authored by Maxime Goret's avatar Maxime Goret
Browse files

Modif voisinage

parent 60ba7199
Pipeline #79181 failed with stage
......@@ -45,7 +45,7 @@ public:
i++;
}
bool isDone(){
return (vsn->voisinage.size() <= i);
return (vsn->voisinage.size() <= i);
}
Cellule* currentItem(){
return vsn->voisinage[i];
......
......@@ -184,4 +184,20 @@ Voisinage::~Voisinage() {
Voisinage RegleVoisinageArbitraire::getVoisinage(const Reseau& reseau, Coordonnees position) const {}
void RegleVoisinageArbitraire::calculVoisinage(Voisinage &v, const Reseau& r) {}
void RegleVoisinageArbitraire::calculVoisinage(Voisinage &v, const Reseau& r) {
v.voisinage = std::vector<Cellule*>();
for (int k = 0; k < nbVoisin; k++) {
unsigned int i, j;
while (i >= r.getHauteur() || j >= r.getLargeur()) {
cout << "Entrez l'abscisse de la" << k << "ieme cellule.\n";
cin >> i;
cout << "Entrez l'ordonnee de la " << k << "ieme cellule.\n";
cin >> j;
if (i >= r.getHauteur() || j >= r.getLargeur())
cout << "Coordonnees incorrectes !\n";
}
if (i < r.getHauteur() && j < r.getLargeur())
v.voisinage[k] = &r.getReseau()[i][j];
}
}
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment