Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Romain De Laage De Bellefaye
LO21-projet
Commits
e613d688
Commit
e613d688
authored
Jun 03, 2021
by
Boris Cazic
Browse files
Ebauche d'implémentation du voisinage arbitraire
parent
6956d368
Pipeline
#79110
passed with stage
in 16 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
includes/voisinage.h
View file @
e613d688
...
...
@@ -10,7 +10,7 @@
#include
"reseau_cellule_etats.h"
#include
"coordonnees.h"
#include
<stdio
.h
>
#include
<
c
stdio>
#include
<iostream>
#include
<string>
#include
<vector>
...
...
@@ -94,16 +94,10 @@ public:
};
struct
VoisinageFormat
{
//Format possible de voisinage pouvant être renvoyé par RegleVoisinage
std
::
vector
<
Coordonnees
>
positions
;
};
class
RegleVoisinageArbitraire
:
public
RegleVoisinage
{
//définit la règle pour le voisinage arbitraire
public:
Voisinage
getVoisinage
(
const
Reseau
&
reseau
,
Coordonnees
position
)
const
;
std
::
vector
<
VoisinageFormat
>
getFormat
()
const
;
//à compléter
};
...
...
src/voisinage.cpp
View file @
e613d688
...
...
@@ -40,12 +40,12 @@ void RegleVoisinage::calculVoisinage(Voisinage& v, const Reseau& r) {
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
<<
"i
è
me cellule.
\n
"
;
cout
<<
"Entrez l'abscisse de la"
<<
k
<<
"i
e
me cellule.
\n
"
;
cin
>>
i
;
cout
<<
"Entrez l'ordonn
é
e de la "
<<
k
<<
"i
è
me cellule.
\n
"
;
cout
<<
"Entrez l'ordonn
e
e de la "
<<
k
<<
"i
e
me cellule.
\n
"
;
cin
>>
j
;
if
(
i
>=
r
.
getHauteur
()
||
j
>=
r
.
getLargeur
())
cout
<<
"Coordonn
é
es incorrecte !
\n
"
;
cout
<<
"Coordonn
e
es incorrecte
s
!
\n
"
;
}
if
(
i
<
r
.
getHauteur
()
&&
j
<
r
.
getLargeur
())
v
.
voisinage
[
k
]
=
&
r
.
getReseau
()[
i
][
j
];
...
...
@@ -181,3 +181,7 @@ void RegleVoisinageMoore::calculVoisinage(Voisinage& v, const Reseau& r){
Voisinage
::~
Voisinage
()
{
voisinage
.
clear
();
}
Voisinage
RegleVoisinageArbitraire
::
getVoisinage
(
const
Reseau
&
reseau
,
Coordonnees
position
)
const
{
}
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment