Addition de label.java

This commit is contained in:
Guillaume Vincent 2020-04-28 09:17:03 +02:00
parent 870726461b
commit 7fea8f8df7
2 changed files with 27 additions and 1 deletions

View file

@ -0,0 +1,26 @@
package org.insa.graphs.algorithm.shortestpath;
import org.insa.graphs.model.*;
public class Label
{
private Node currentNode;
private boolean mark;
private double cost;
private Arc fatherArc;
public Label(Node cN, Arc fA)
{
this.currentNode = cN;
this.fatherArc = fA;
this.cost = Double.MAX_VALUE;
this.mark = false;
}
public double getCost()
{
return this.cost;
}
}

View file

@ -136,7 +136,7 @@ public class BinaryHeap<E extends Comparable<E>> implements PriorityQueue<E> {
@Override
public void remove(E x) throws ElementNotFoundException {
// TODO:
// DONE:
int index = array.indexOf(x);
if (isEmpty() || index < 0 || index >= this.currentSize) {
throw new ElementNotFoundException(x);