mirror of
https://github.com/dancojocaru2000/ai-project-idastar.git
synced 2025-02-22 16:39:35 +02:00
Fixed bug where start node was valid move
This commit is contained in:
parent
e8992f8b06
commit
70fb7dcf9f
1 changed files with 2 additions and 2 deletions
|
@ -184,7 +184,8 @@ namespace IdaStar
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (_board[neighbour.Row][neighbour.Column] == CellState.OBSTACLE ||
|
if (_board[neighbour.Row][neighbour.Column] == CellState.OBSTACLE ||
|
||||||
_board[neighbour.Row][neighbour.Column] == CellState.PATH) {
|
_board[neighbour.Row][neighbour.Column] == CellState.PATH ||
|
||||||
|
_board[neighbour.Row][neighbour.Column] == CellState.START) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -213,7 +214,6 @@ namespace IdaStar
|
||||||
var threshold = heuristic(startPoint, destinationPoint);
|
var threshold = heuristic(startPoint, destinationPoint);
|
||||||
while (threshold != 0) {
|
while (threshold != 0) {
|
||||||
var newThreshold = search(startPoint, 0, threshold);
|
var newThreshold = search(startPoint, 0, threshold);
|
||||||
AlgorithmStep?.Invoke(this, threshold);
|
|
||||||
if (newThreshold == 0) {
|
if (newThreshold == 0) {
|
||||||
threshold = 0;
|
threshold = 0;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue