void BottomDijkstra(Cell parent) { Cell BottomCell = grids [parent.Get_i() + 1, parent.Get_j()]; pathOfMaze temp = new pathOfMaze(parent.Get_i(), parent.Get_j(), BottomCell.Get_i(), BottomCell.Get_j()); DijkstraPathQueue.Enqueue(temp); if (parent.dijkstraValue + 1 < BottomCell.dijkstraValue) { BottomCell.dijkstraValue = parent.dijkstraValue + 1; BottomCell.dijkstraPrevious = parent; } }
void RightDijkstra(Cell parent) { Cell RightCell = grids[parent.Get_i(), parent.Get_j() - 1]; pathOfMaze temp = new pathOfMaze(parent.Get_i(), parent.Get_j(), RightCell.Get_i(), RightCell.Get_j()); DijkstraPathQueue.Enqueue(temp); if (parent.dijkstraValue + 1 < RightCell.dijkstraValue) { RightCell.dijkstraValue = parent.dijkstraValue + 1; RightCell.dijkstraPrevious = parent; } }
void TopDijkstra(Cell parent) { Cell TopCell = grids [parent.Get_i() - 1, parent.Get_j()]; pathOfMaze temp = new pathOfMaze(parent.Get_i(), parent.Get_j(), TopCell.Get_i(), TopCell.Get_j()); DijkstraPathQueue.Enqueue(temp); if (parent.dijkstraValue + 1 < TopCell.dijkstraValue) { TopCell.dijkstraValue = parent.dijkstraValue + 1; TopCell.dijkstraPrevious = parent; } }
void LefDijkstra(Cell parent) { Cell leftCell = grids[parent.Get_i(), parent.Get_j() + 1]; pathOfMaze temp = new pathOfMaze(parent.Get_i(), parent.Get_j(), leftCell.Get_i(), leftCell.Get_j()); DijkstraPathQueue.Enqueue(temp); if (parent.dijkstraValue + 1 < leftCell.dijkstraValue) { leftCell.dijkstraValue = parent.dijkstraValue + 1; leftCell.dijkstraPrevious = parent; } }
void AstarCheckBottom(Cell currentCell, List <Cell> openedSet) { Cell BottomCell = grids [currentCell.Get_i() + 1, currentCell.Get_j()]; if (!BottomCell.GetVisited()) { pathOfMaze temp = new pathOfMaze(currentCell.Get_i(), currentCell.Get_j(), BottomCell.Get_i(), BottomCell.Get_j()); AstarPathQueue.Enqueue(temp); openedSet.Add(BottomCell); BottomCell.Astar_G = currentCell.Astar_G + 1; BottomCell.Update_Astar_F(); BottomCell.Astar_Parent = currentCell; } }
void AstarCheckTop(Cell currentCell, List <Cell> openedSet) { Cell TopCell = grids [currentCell.Get_i() - 1, currentCell.Get_j()]; if (!TopCell.GetVisited()) { pathOfMaze temp = new pathOfMaze(currentCell.Get_i(), currentCell.Get_j(), TopCell.Get_i(), TopCell.Get_j()); AstarPathQueue.Enqueue(temp); openedSet.Add(TopCell); TopCell.Astar_G = currentCell.Astar_G + 1; TopCell.Update_Astar_F(); TopCell.Astar_Parent = currentCell; } }
void AstarCheckLeft(Cell currentCell, List <Cell> openedSet) { Cell LeftCell = grids [currentCell.Get_i(), currentCell.Get_j() + 1]; if (!LeftCell.GetVisited()) { pathOfMaze temp = new pathOfMaze(currentCell.Get_i(), currentCell.Get_j(), LeftCell.Get_i(), LeftCell.Get_j()); AstarPathQueue.Enqueue(temp); openedSet.Add(LeftCell); LeftCell.Astar_G = currentCell.Astar_G + 1; LeftCell.Update_Astar_F(); LeftCell.Astar_Parent = currentCell; } }