getlength in path is done
This commit is contained in:
parent
dddfa37a72
commit
c97fc51b94
2 changed files with 7 additions and 4 deletions
|
@ -311,7 +311,8 @@ public abstract class PriorityQueueTest {
|
||||||
Assume.assumeFalse(queue.isEmpty());
|
Assume.assumeFalse(queue.isEmpty());
|
||||||
int min = Collections.min(Arrays.asList(parameters.data)).get();
|
int min = Collections.min(Arrays.asList(parameters.data)).get();
|
||||||
for (MutableInteger mi : parameters.data) {
|
for (MutableInteger mi : parameters.data) {
|
||||||
// Update value before removing it. This is what happens when updating a Dijkstra label before updating it.
|
// Update value before removing it. This is what happens when updating a
|
||||||
|
// Dijkstra label before updating it.
|
||||||
mi.set(--min);
|
mi.set(--min);
|
||||||
queue.remove(mi);
|
queue.remove(mi);
|
||||||
assertEquals(parameters.data.length - 1, queue.size());
|
assertEquals(parameters.data.length - 1, queue.size());
|
||||||
|
|
|
@ -195,11 +195,13 @@ public class Path {
|
||||||
* Compute the length of this path (in meters).
|
* Compute the length of this path (in meters).
|
||||||
*
|
*
|
||||||
* @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() {
|
||||||
// TODO:
|
float lg = 0;
|
||||||
return 0;
|
for (Arc a : this.arcs) {
|
||||||
|
lg = lg + a.getLength();
|
||||||
|
}
|
||||||
|
return lg;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in a new issue