Commentaire comparaison arcs
This commit is contained in:
parent
44991cfab2
commit
a75f05b9a3
1 changed files with 6 additions and 0 deletions
|
@ -415,6 +415,9 @@ public abstract class ShortestPathAlgorithmTest {
|
||||||
final ShortestPathSolution pathSousPCC = algoSousPCC.doRun();
|
final ShortestPathSolution pathSousPCC = algoSousPCC.doRun();
|
||||||
|
|
||||||
if (path.getPath() != null) {
|
if (path.getPath() != null) {
|
||||||
|
// Note: comme les chemins des arcs sont récupérés au même en droit entre pathSousPCC et path,
|
||||||
|
// on peut comparer directement les objets soit leurs adresses. Sinon, il aurait fallu comparer
|
||||||
|
// l'id des noeuds origines et destination du chemin.
|
||||||
for (int k = 0 ; k < pathSousPCC.getPath().size()-1; k++) {
|
for (int k = 0 ; k < pathSousPCC.getPath().size()-1; k++) {
|
||||||
assert(pathSousPCC.getPath().getArcs().get(k) == path.getPath().getArcs().get(indiceOrigine + k));
|
assert(pathSousPCC.getPath().getArcs().get(k) == path.getPath().getArcs().get(indiceOrigine + k));
|
||||||
}
|
}
|
||||||
|
@ -490,6 +493,9 @@ public abstract class ShortestPathAlgorithmTest {
|
||||||
final ShortestPathSolution pathSousPCC = algoSousPCC.doRun();
|
final ShortestPathSolution pathSousPCC = algoSousPCC.doRun();
|
||||||
|
|
||||||
if (path.getPath() != null) {
|
if (path.getPath() != null) {
|
||||||
|
// Note: comme les chemins des arcs sont récupérés au même en droit entre pathSousPCC et path,
|
||||||
|
// on peut comparer directement les objets soit leurs adresses. Sinon, il aurait fallu comparer
|
||||||
|
// l'id des noeuds origines et destination du chemin.
|
||||||
for (int k = 0 ; k < pathSousPCC.getPath().size()-1; k++) {
|
for (int k = 0 ; k < pathSousPCC.getPath().size()-1; k++) {
|
||||||
assert(pathSousPCC.getPath().getArcs().get(k) == path.getPath().getArcs().get(indiceOrigine + k));
|
assert(pathSousPCC.getPath().getArcs().get(k) == path.getPath().getArcs().get(indiceOrigine + k));
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue