From a6d8ed822aef9b58acf48916433d67c497537016 Mon Sep 17 00:00:00 2001 From: Kamila Bobkowska Date: Sat, 2 May 2020 15:31:13 +0000 Subject: [PATCH] grammatical errors reduction --- route-planning.md | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/route-planning.md b/route-planning.md index 33cc10e..c0d5653 100644 --- a/route-planning.md +++ b/route-planning.md @@ -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):