Addition de label.java
Šī revīzija ir iekļauta:
vecāks
870726461b
revīzija
7fea8f8df7
2 mainīti faili ar 27 papildinājumiem un 1 dzēšanām
|
|
@ -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
|
@Override
|
||||||
public void remove(E x) throws ElementNotFoundException {
|
public void remove(E x) throws ElementNotFoundException {
|
||||||
// TODO:
|
// DONE:
|
||||||
int index = array.indexOf(x);
|
int index = array.indexOf(x);
|
||||||
if (isEmpty() || index < 0 || index >= this.currentSize) {
|
if (isEmpty() || index < 0 || index >= this.currentSize) {
|
||||||
throw new ElementNotFoundException(x);
|
throw new ElementNotFoundException(x);
|
||||||
|
|
|
||||||
Notiek ielāde…
Atsaukties uz šo jaunā problēmā