getlength in path is done

This commit is contained in:
knzrd 2025-04-04 09:48:07 +02:00
parent dddfa37a72
commit c97fc51b94
2 changed files with 7 additions and 4 deletions

View file

@ -311,7 +311,8 @@ public abstract class PriorityQueueTest {
Assume.assumeFalse(queue.isEmpty());
int min = Collections.min(Arrays.asList(parameters.data)).get();
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);
queue.remove(mi);
assertEquals(parameters.data.length - 1, queue.size());

View file

@ -195,11 +195,13 @@ public class Path {
* Compute the length of this path (in meters).
*
* @return Total length of the path (in meters).
* @deprecated Need to be implemented.
*/
public float getLength() {
// TODO:
return 0;
float lg = 0;
for (Arc a : this.arcs) {
lg = lg + a.getLength();
}
return lg;
}
/**