grammatical errors reduction
This commit is contained in:
parent
05f5f2f121
commit
a6d8ed822a
@ -2,9 +2,10 @@
|
||||
## General information
|
||||
Costs of fields:
|
||||
* **0** - Garbage Dump
|
||||
* **1-5**- dumpsters
|
||||
* **1-5** - dumpsters
|
||||
* **10** - grass
|
||||
This causes the garbage truck to sometimes move through already visited dumpsters to move more quickly.
|
||||
|
||||
This causes the garbage truck to sometimes move through already visited dumpsters to move more quickly. The garbage truck firstly visitis all houses and then visits the garbage dump
|
||||
|
||||
## Main loop of A star
|
||||
To implement A star we have used tuples and a priority queue. We start with an `openlist` with our starting node and cost of the node and then we add more nodes that are possible to visit to that list. If it did not find anything in `openlist` then it would mean that there is no target, but in our case that cannot happen. If the current node we are visiting is our goal then it means that we are done and can retrace our path. `openlist` represents nodes that are possible to visit.
|
||||
@ -38,7 +39,7 @@ To implement A star we have used tuples and a priority queue. We start with an `
|
||||
```
|
||||
|
||||
## Successor function
|
||||
Our successor function goes thorugh the neighbors. Firstly it checks whether the neighbor is in fact in the grid or if it is outside. If it is outside then we skip it. Then we calculate the g(the distance between our starting node and the current node). If the node has not been already visited or if ot has a lower g cost to f then we add it to the closed list. Change the predecessor, reassign fscore as gscore and calcualte the priority. At the end we add it to `openlist`. Then we repeat for the next neighbor until all of them are visited(if possible).
|
||||
Our successor function goes through the neighbors. Firstly it checks whether the neighbor is in fact in the grid or if it is outside. If it is outside then we skip it. Then we calculate the g(the distance between our starting node and the current node). If the node has not been already visited or if it has a lower g cost then f, then we add it to the closed list. Change the predecessor, reassign fscore as gscore and calculate the priority. At the end we add it to `openlist`. Then we repeat for the next neighbor until all of them are visited(if possible).
|
||||
```
|
||||
#how we get nodes neighbors
|
||||
def neighbors(point):
|
||||
|
Loading…
Reference in New Issue
Block a user