Merge the last Dijkstra classes #7
No files matched your search
@@ -42,4 +42,5 @@ public class Dijkstra {
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -0,0 +1,21 @@
|
|||||||
|
package dijkstra;
|
||||||
|
|
||||||
|
import java.util.Hashtable;
|
||||||
|
|
||||||
|
public class Pi implements PiInterface {
|
||||||
|
|
||||||
|
private Hashtable<VertexInterface, Integer> hashPi = new Hashtable<VertexInterface, Integer>() ;
|
||||||
|
|
||||||
|
public int getPi(VertexInterface vertex) {
|
||||||
|
|
||||||
|
return hashPi.get(vertex) ;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setPi(int i, VertexInterface vertex) {
|
||||||
|
|
||||||
|
hashPi.put(vertex, i) ;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
+1
-1
@@ -27,7 +27,7 @@ public class Maze
|
|||||||
Box endBox = (Box) end ;
|
Box endBox = (Box) end ;
|
||||||
|
|
||||||
if (startBox.getNeighbourList().contains(endBox)) {
|
if (startBox.getNeighbourList().contains(endBox)) {
|
||||||
if (startBox.isWalkable() & endBox.isWalkable()) {
|
if (startBox.isWalkable() && endBox.isWalkable()) {
|
||||||
return 1 ;
|
return 1 ;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
|||||||
Reference in new issue
Block a user