Fixed last dijkstra classes. Algorithm working for squared maze but bugs for non square mazes.

This commit is contained in:
antograb committed 2017-12-06 22:30:58 +01:00
1 parent 5d7c970e1b
commit d7368f7cda
10 files changed
+64 -54

No files matched your search

+7 -5
View File
@@ -6,10 +6,10 @@ import maze.Box;
public class ASet implements ASetInterface {
private HashSet<Box> vertexHashSet = new HashSet<Box>() ;
private HashSet<VertexInterface> vertexHashSet = new HashSet<VertexInterface>() ;
public ASet(HashSet<Box> vertexHashSet) {
public ASet(HashSet<VertexInterface> vertexHashSet) {
this.vertexHashSet = vertexHashSet;
@@ -23,11 +23,13 @@ public class ASet implements ASetInterface {
public boolean contains(VertexInterface vertex) {
for (VertexInterface v: vertexHashSet) {
if (v == vertex) return true ;
}
if (vertexHashSet.contains(vertex)) return true ;
return false ;
}
public HashSet<VertexInterface> getVertexHashSet() {
return vertexHashSet;
}
}