-
Notifications
You must be signed in to change notification settings - Fork 87
Open
Labels
Description
During the A* Search problem, every time a state/node is explored the following procedure is applied:
- call action function to retrieve a list of actions that can be applied to that specific state;
- call the transition function for each action retrieved in 1.
- call the cost function (g) for each new generated state in 2.
- call the estimate function (h) for each new generated state in 2.
- insert the new generated states into the "sorted by f=g+h queue" of states to be explored.
- explore the next state in the "sorted queue" which have smaller f.
However I think a good optimisation is to call, before 5., the search predicate function (isGoal) for each new generated state, and if it is a goal state, then, after inserting into the "sorted queue", all the states in that queue which f is greater than the inserted state f could be removed, because they won't be never explored, and with that, a bunch of memory is saved during the search, which turn the Garbage Collector happier.
By the way, during the search and before the result, how can I have access to some basic stats?
Like: number of explored nodes and number of nodes that are in the queue to be explored?
Thank you.