Changes to be committed:
modified: be-graphes-model/src/main/java/org/insa/graphs/model/Path.java
This commit is contained in:
parent
fcf385ba21
commit
3651cfadd2
1 changed files with 23 additions and 9 deletions
|
|
@ -201,15 +201,26 @@ public class Path {
|
||||||
* @deprecated Need to be implemented.
|
* @deprecated Need to be implemented.
|
||||||
*/
|
*/
|
||||||
public boolean isValid() {
|
public boolean isValid() {
|
||||||
if (!this.isEmpty()) {
|
if (this.isEmpty()) {
|
||||||
return false;
|
return true;
|
||||||
}
|
}
|
||||||
if (this.getArcs().size() != 0) {
|
else if (this.size() == 1) {
|
||||||
return false;
|
return true;
|
||||||
}
|
}
|
||||||
return true;
|
else {
|
||||||
}
|
Node origine = this.getOrigin();
|
||||||
|
for (Arc arc : this.arcs) {
|
||||||
|
if (!origine.equals(arc.getOrigin())) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
origine = arc.getDestination();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Compute the length of this path (in meters).
|
* Compute the length of this path (in meters).
|
||||||
*
|
*
|
||||||
|
|
@ -251,8 +262,11 @@ public class Path {
|
||||||
* @deprecated Need to be implemented.
|
* @deprecated Need to be implemented.
|
||||||
*/
|
*/
|
||||||
public double getMinimumTravelTime() {
|
public double getMinimumTravelTime() {
|
||||||
// TODO:
|
double temps = 0;
|
||||||
return 0;
|
for(Arc myArc : this.arcs) {
|
||||||
|
temps+= myArc.getMinimumTravelTime();
|
||||||
|
}
|
||||||
|
return temps;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue