Compare commits
No commits in common. "52df139bd81e14b9803c93c91ef6d8e86ff27ac8" and "3bba01976383c95bc4b0f54082a5e03c54b58436" have entirely different histories.
52df139bd8
...
3bba019763
2 changed files with 14 additions and 27 deletions
|
|
@ -201,15 +201,8 @@ public class Path {
|
||||||
* @deprecated Need to be implemented.
|
* @deprecated Need to be implemented.
|
||||||
*/
|
*/
|
||||||
public boolean isValid() {
|
public boolean isValid() {
|
||||||
boolean valid = isEmpty() || (this.arcs.size() == 0 && this.origin != null);
|
// TODO:
|
||||||
if (!valid) {
|
return false;
|
||||||
valid = this.arcs.get(0).getOrigin().equals(this.origin);
|
|
||||||
for (int i = 1; i < 3; i++) {
|
|
||||||
if (this.arcs.size() > i)
|
|
||||||
valid = valid && (this.arcs.get(i).getOrigin().equals(this.arcs.get(i-1).getDestination()));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return valid;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -217,13 +210,11 @@ public class Path {
|
||||||
*
|
*
|
||||||
* @return Total length of the path (in meters).
|
* @return Total length of the path (in meters).
|
||||||
*
|
*
|
||||||
|
* @deprecated Need to be implemented.
|
||||||
*/
|
*/
|
||||||
public float getLength() {
|
public float getLength() {
|
||||||
float length = 0;
|
// TODO:
|
||||||
for (Arc a : this.arcs) {
|
return 0;
|
||||||
length += a.getLength();
|
|
||||||
}
|
|
||||||
return length;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -234,13 +225,11 @@ public class Path {
|
||||||
* @return Time (in seconds) required to travel this path at the given speed (in
|
* @return Time (in seconds) required to travel this path at the given speed (in
|
||||||
* kilometers-per-hour).
|
* kilometers-per-hour).
|
||||||
*
|
*
|
||||||
|
* @deprecated Need to be implemented.
|
||||||
*/
|
*/
|
||||||
public double getTravelTime(double speed) {
|
public double getTravelTime(double speed) {
|
||||||
float time = 0;
|
// TODO:
|
||||||
for (Arc a : this.arcs) {
|
return 0;
|
||||||
time += a.getTravelTime(speed);
|
|
||||||
}
|
|
||||||
return time;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -249,13 +238,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 time = 0;
|
// TODO:
|
||||||
for (Arc a : this.arcs) {
|
return 0;
|
||||||
time += a.getMinimumTravelTime();
|
|
||||||
}
|
|
||||||
return time;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
BIN
uml.dia
Normal file
BIN
uml.dia
Normal file
Binary file not shown.
Loading…
Reference in a new issue