#include <Planner.h>
Definition at line 17 of file Planner.h.
◆ Planner()
Divide::goap::Planner::Planner |
( |
| ) |
|
|
defaultnoexcept |
◆ addToOpenList()
void Planner::addToOpenList |
( |
Node && |
node | ) |
|
|
private |
Moves the given Node (an rvalue reference) into the 'open' list.
- Parameters
-
node | an rvalue reference to a Node that will be moved to the open list |
Definition at line 12 of file Planner.cpp.
◆ calculateHeuristic()
Given two worldstates, calculates an estimated distance (the A* 'heuristic') between the two.
- Parameters
-
now | the present worldstate |
goal | the desired worldstate |
- Returns
- an estimated distance between them
Definition at line 8 of file Planner.cpp.
◆ memberOfClosed()
bool Planner::memberOfClosed |
( |
const WorldState & |
ws | ) |
const |
|
private |
Is the given worldstate a member of the closed list? (And by that we mean, does any node on the closed list contain an equal worldstate.)
- Parameters
-
ws | the worldstate in question |
- Returns
- true if it's been closed, false if not
Definition at line 28 of file Planner.cpp.
◆ memberOfOpen()
Is the given worldstate a member of the open list? (And by that we mean, does any node on the open list contain an equal worldstate.)
- Parameters
-
ws | the worldstate in question |
- Returns
- a pointer to the note if found, end(open_) if not
Definition at line 35 of file Planner.cpp.
◆ plan()
Actually attempt to formulate a plan to get from start to goal, given a pool of available actions.
- Parameters
-
start | the starting worldstate |
goal | the goal worldstate |
actions | the available action pool |
- Returns
- a vector of Actions in REVERSE ORDER - use a reverse_iterator on this to get stepwise-order
- Exceptions
-
std::runtime_error | if no plan could be made with the available actions and states |
Definition at line 57 of file Planner.cpp.
◆ popAndClose()
Node & Planner::popAndClose |
( |
| ) |
|
|
private |
Pops the first Node from the 'open' list, moves it to the 'closed' list, and returns a reference to this newly-closed Node. Its behavior is undefined if you call on an empty list.
- Returns
- a reference to the newly closed Node
Definition at line 20 of file Planner.cpp.
◆ printClosedList()
Useful when you're debugging a GOAP plan: simply dumps the closed list to stdout.
Definition at line 48 of file Planner.cpp.
◆ printOpenList()
Useful when you're debugging a GOAP plan: simply dumps the open list to stdout.
Definition at line 39 of file Planner.cpp.
◆ closed_
◆ known_nodes_
A master lookup table of ID-to-Node; useful during the action replay.
Definition at line 20 of file Planner.h.
◆ open_
The documentation for this class was generated from the following files:
- G:/Divide-Framework/Source/AI/ActionInterface/CustomGOAP/Planner.h
- G:/Divide-Framework/Source/AI/ActionInterface/CustomGOAP/Planner.cpp