Addition de label.java
This commit is contained in:
parent
870726461b
commit
7fea8f8df7
2 changed files with 27 additions and 1 deletions
|
@ -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;
|
||||
}
|
||||
|
||||
|
||||
}
|
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue