Fixed last dijkstra classes. Algorithm working for squared maze but bugs for non square mazes.
This commit is contained in:
1 parent
5d7c970e1b
commit
d7368f7cda
10 files changed
+64
-54
No files matched your search
@@ -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;
|
||||
}
|
||||
|
||||
}
|
||||
Reference in new issue
Block a user