Skip to content

Commit af562e7

Browse files
jakobjakob
authored andcommitted
fix typo
1 parent d2f3efc commit af562e7

4 files changed

Lines changed: 20 additions & 20 deletions

File tree

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,3 +21,4 @@
2121

2222
# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
2323
hs_err_pid*
24+
/bin/

VisualizationOfSearchAlgorithms/src/controller/Controller.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,12 +44,12 @@ public void applyChanges(int size, long stepSize, ArrayList<GridCell> cellsToUpd
4444
}
4545

4646
public synchronized long accessStepSize(long stepSize) {
47-
//if stepSize is -1 this methode acts as a getter
47+
//if stepSize is -1 this method acts as a getter
4848
if(stepSize == -1) {
4949
return this.stepSize;
5050
}
5151

52-
//if stepsize is != to -1 this methode acts as a setter returning -1
52+
//if stepSize is != to -1 this method acts as a setter returning -1
5353
this.stepSize = stepSize;
5454
return -1;
5555

VisualizationOfSearchAlgorithms/src/model/SearchAlgorithms.java

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ public class SearchAlgorithms {
1919

2020
private static final double cellCostMultiplicator = 1;
2121

22-
public static Queue<AnimationInstruction> BFS(Grid grid, GridCell startCell, GridCell endCell) {
22+
public static Queue<AnimationInstruction> bfs(Grid grid, GridCell startCell, GridCell endCell) {
2323
int traversedCells = 0;
2424

2525
Queue<AnimationInstruction> animationQueue = new LinkedList<AnimationInstruction>();
@@ -56,7 +56,7 @@ public static Queue<AnimationInstruction> BFS(Grid grid, GridCell startCell, Gri
5656
return animationQueue;
5757
}
5858

59-
// getting adjacent cells which have been not visited yet
59+
// getting adjacent cells which have not been visited yet
6060
for (GridCell neighbor : grid.getNeighbors(current)) {
6161

6262
if (!(visited.contains(neighbor))) {
@@ -77,7 +77,7 @@ public static Queue<AnimationInstruction> BFS(Grid grid, GridCell startCell, Gri
7777
return animationQueue;
7878
}
7979

80-
public static Queue<AnimationInstruction> DFS(Grid grid, GridCell startCell, GridCell endCell) {
80+
public static Queue<AnimationInstruction> dfs(Grid grid, GridCell startCell, GridCell endCell) {
8181
int traversedCells = 0;
8282

8383
Queue<AnimationInstruction> animationQueue = new LinkedList<AnimationInstruction>();
@@ -114,7 +114,7 @@ public static Queue<AnimationInstruction> DFS(Grid grid, GridCell startCell, Gri
114114
return animationQueue;
115115
}
116116

117-
// getting adjacent cells which have been not visited yet
117+
// getting adjacent cells which have not been visited yet
118118
for (GridCell neighbor : grid.getNeighbors(current)) {
119119

120120
if (!(visited.contains(neighbor))) {
@@ -135,7 +135,7 @@ public static Queue<AnimationInstruction> DFS(Grid grid, GridCell startCell, Gri
135135
return animationQueue;
136136
}
137137

138-
public static Queue<AnimationInstruction> AStar(Grid grid, GridCell startCell, GridCell endCell) {
138+
public static Queue<AnimationInstruction> aStar(Grid grid, GridCell startCell, GridCell endCell) {
139139
int traversedCells = 0;
140140

141141
Queue<AnimationInstruction> animationQueue = new LinkedList<AnimationInstruction>();
@@ -172,7 +172,7 @@ public static Queue<AnimationInstruction> AStar(Grid grid, GridCell startCell, G
172172
return animationQueue;
173173
}
174174

175-
// getting adjacent cells which have been not visited yet
175+
// getting adjacent cells which have not been visited yet
176176
for (GridCell neighbor : grid.getNeighbors(current)) {
177177

178178
if (!(visited.contains(neighbor))) {
@@ -197,7 +197,7 @@ public static Queue<AnimationInstruction> AStar(Grid grid, GridCell startCell, G
197197
return animationQueue;
198198
}
199199

200-
public static Queue<AnimationInstruction> BestFirstSearch(Grid grid, GridCell startCell, GridCell endCell) {
200+
public static Queue<AnimationInstruction> bestFirstSearch(Grid grid, GridCell startCell, GridCell endCell) {
201201
int traversedCells = 0;
202202
Queue<AnimationInstruction> animationQueue = new LinkedList<AnimationInstruction>();
203203
PriorityQueue<PQueueEntry> PQueue = new PriorityQueue<PQueueEntry>();
@@ -233,7 +233,7 @@ public static Queue<AnimationInstruction> BestFirstSearch(Grid grid, GridCell st
233233
return animationQueue;
234234
}
235235

236-
// getting adjacent cells which have been not visited yet
236+
// getting adjacent cells which have not been visited yet
237237
for (GridCell neighbor : grid.getNeighbors(current)) {
238238

239239
if (!(visited.contains(neighbor))) {
@@ -257,7 +257,7 @@ public static Queue<AnimationInstruction> BestFirstSearch(Grid grid, GridCell st
257257
return animationQueue;
258258
}
259259

260-
public static Queue<AnimationInstruction> HeuristicDephthFirstSearch(Grid grid, GridCell startCell, GridCell endCell) {
260+
public static Queue<AnimationInstruction> heuristicDepthFirstSearch(Grid grid, GridCell startCell, GridCell endCell) {
261261
int traversedCells = 0;
262262

263263
Queue<AnimationInstruction> animationQueue = new LinkedList<AnimationInstruction>();
@@ -294,7 +294,7 @@ public static Queue<AnimationInstruction> HeuristicDephthFirstSearch(Grid grid,
294294
return animationQueue;
295295
}
296296

297-
// getting adjacent cells which have been not visited yet
297+
// getting adjacent cells which have not been visited yet
298298

299299
PriorityQueue<PQueueEntry> localMinHeuristic = new PriorityQueue<PQueueEntry>();
300300
for (GridCell neighbor : grid.getNeighbors(current)) {

VisualizationOfSearchAlgorithms/src/view/MainWindow.java

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,7 @@ public class MainWindow extends JFrame {
4747
private JButton startButton;
4848
private JComboBox<String> algorithmSelection;
4949

50-
// TODO Edit here to display new algorithms
51-
String[] algorithmsToChoose = { "BFS (optimal Path)", "DFS", "Best First Search","Heuristic Dephth First Search" ,"A* (optimal Path)" };
50+
String[] algorithmsToChoose = { "BFS (optimal Path)", "DFS", "Best First Search","Heuristic Depth First Search" ,"A* (optimal Path)" };
5251
private MainWindow window;
5352
private int status = 0; // 0 before start of the animation, 1 after start of animation, 2 after end of
5453
// animation
@@ -160,7 +159,7 @@ public void actionPerformed(ActionEvent e) {
160159

161160
if (algorithm == "BFS (optimal Path)") {
162161
displayMessage("Starting path calculation...");
163-
Queue<AnimationInstruction> animationQueue = SearchAlgorithms.BFS(grid, grid.getStartCell(),
162+
Queue<AnimationInstruction> animationQueue = SearchAlgorithms.bfs(grid, grid.getStartCell(),
164163
grid.getEndCell());
165164
displayMessage("Starting animation...");
166165

@@ -171,7 +170,7 @@ public void actionPerformed(ActionEvent e) {
171170

172171
if (algorithm == "DFS") {
173172
displayMessage("Starting path calculation...");
174-
Queue<AnimationInstruction> animationQueue = SearchAlgorithms.DFS(grid, grid.getStartCell(),
173+
Queue<AnimationInstruction> animationQueue = SearchAlgorithms.dfs(grid, grid.getStartCell(),
175174
grid.getEndCell());
176175
displayMessage("Starting animation...");
177176

@@ -182,7 +181,7 @@ public void actionPerformed(ActionEvent e) {
182181

183182
if (algorithm == "A* (optimal Path)") {
184183
displayMessage("Starting path calculation...");
185-
Queue<AnimationInstruction> animationQueue = SearchAlgorithms.AStar(grid, grid.getStartCell(),
184+
Queue<AnimationInstruction> animationQueue = SearchAlgorithms.aStar(grid, grid.getStartCell(),
186185
grid.getEndCell());
187186
displayMessage("Starting animation...");
188187

@@ -192,17 +191,17 @@ public void actionPerformed(ActionEvent e) {
192191
}
193192
if (algorithm == "Best First Search") {
194193
displayMessage("Starting path calculation...");
195-
Queue<AnimationInstruction> animationQueue = SearchAlgorithms.BestFirstSearch(grid,
194+
Queue<AnimationInstruction> animationQueue = SearchAlgorithms.bestFirstSearch(grid,
196195
grid.getStartCell(), grid.getEndCell());
197196
displayMessage("Starting animation...");
198197

199198
AnimationThread animation = new AnimationThread(animationQueue, window, controller);
200199
Thread animationThread = new Thread(animation);
201200
animationThread.start();
202201
}
203-
if (algorithm == "Heuristic Dephth First Search") {
202+
if (algorithm == "Heuristic Depth First Search") {
204203
displayMessage("Starting path calculation...");
205-
Queue<AnimationInstruction> animationQueue = SearchAlgorithms.HeuristicDephthFirstSearch(grid,
204+
Queue<AnimationInstruction> animationQueue = SearchAlgorithms.heuristicDepthFirstSearch(grid,
206205
grid.getStartCell(), grid.getEndCell());
207206
displayMessage("Starting animation...");
208207

0 commit comments

Comments
 (0)