Compare commits

..

No commits in common. "7fedb6de7a48f19d0ef11cb635d696af5b5d099d" and "9b40dc4c4e00a02ae4197c1499edbacd7d9d0c31" have entirely different histories.

View file

@ -250,38 +250,11 @@ public class Path {
* *
* @return true if the path is valid, false otherwise. * @return true if the path is valid, false otherwise.
* *
* @deprecated Need to be implemented.
*/ */
public boolean isValid() { public boolean isValid() {
Arc old = null; // TODO:
// it is empty return false;
if (this.isEmpty()) {
return true;
}
// Origin is ok
if ((this.origin != null) && (this.arcs.size() == 0)) {
return true;
}
if (this.arcs.size() == 0) {
return false;
}
// destination of the first one is the origin of the second node
if (this.arcs.get(0).getOrigin() == this.origin) {
for (Arc a : this.arcs) {
if (this.arcs.get(0) == a) {
old = this.arcs.get(0);
}
else if (old.getDestination() == a.getOrigin()) {
old = a;
}
else {
return false;
}
}
return true;
}
else {
return false;
}
} }
/** /**
@ -292,7 +265,7 @@ public class Path {
*/ */
public float getLength() { public float getLength() {
float acc = 0; float acc = 0;
for (Arc l : this.arcs) { for (Arc l : arcs) {
acc += l.getLength(); acc += l.getLength();
} }
@ -319,13 +292,11 @@ public class Path {
* *
* @return Minimum travel time to travel this path (in seconds). * @return Minimum travel time to travel this path (in seconds).
* *
* @deprecated Need to be implemented.
*/ */
public double getMinimumTravelTime() { public double getMinimumTravelTime() {
float acc = 0; // TODO:
for (Arc l : this.arcs) { return 0;
acc += l.getMinimumTravelTime();
}
return acc;
} }
} }