Skip to content
This repository was archived by the owner on May 8, 2023. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions src/files/controllers/Input.java
Original file line number Diff line number Diff line change
Expand Up @@ -103,9 +103,6 @@ private void addEventListeners(ArrayList<Node> nodes){
selectPathfinding.setValue("A*");
model.setPathfinding((String) selectPathfinding.getValue());
selectPathfinding.setOnAction(event -> {
model.setPathfinding((String) selectPathfinding.getValue());



model.getGraph().getVertices().forEach(vertex -> {
// Iterator necessary because we need to remove from ArrayList
Expand All @@ -127,6 +124,7 @@ private void addEventListeners(ArrayList<Node> nodes){
model.getGraph().setEnd(null, model.getEnvironment());
model.getPathfinding().state = "unset";

model.setPathfinding((String) selectPathfinding.getValue());

controller.updatePath();
});
Expand Down
12 changes: 0 additions & 12 deletions src/files/models/Graph.java
Original file line number Diff line number Diff line change
Expand Up @@ -163,13 +163,6 @@ public void setStart(Vertex start,Environment environment){
double distance = Math.sqrt(Math.pow(other.getX() - start.getX(), 2) + Math.pow(other.getY() - start.getY(), 2));
newEdge(start, other, distance, distance); // from, to, distance, time
}
/*
// Make the other direction also
if (creatableRelation) {
double distance = Math.sqrt(Math.pow(other.getX() - start.getX(), 2) + Math.pow(other.getY() - start.getY(), 2));
newEdge(other, start, distance, distance); // from, to, distance, time
}
*/
}

}
Expand Down Expand Up @@ -205,11 +198,6 @@ public void setEnd(Vertex end,Environment environment){
double distance = Math.sqrt(Math.pow(end.getX() - other.getX(), 2) + Math.pow(end.getY() - other.getY(), 2));
newEdge(other, end, distance, distance); // from, to, distance, time
}
// Make the other way also
if (creatableRelation) {
double distance = Math.sqrt(Math.pow(end.getX() - other.getX(), 2) + Math.pow(end.getY() - other.getY(), 2));
newEdge(end, other, distance, distance); // from, to, distance, time
}
}

}
Expand Down