Bratmobile
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
HorizonStarPlanner Class Reference

Performs iterative deepening search over one unit of modular expansion (see below), i.e. search over one branch stops when it reaches a DEFAULT task. Each DEFAULT Task represents the frontier. The planner expands the search from the frontier with the lowest cost phi (A*-style search), which are logged into a priority queue. More...

#include <planner.h>

Inheritance diagram for HorizonStarPlanner:
Inheritance graph
[legend]
Collaboration diagram for HorizonStarPlanner:
Collaboration graph
[legend]

Public Member Functions

std::vector< vertexDescriptor > plan (TransitionSystem &g, vertexDescriptor src, ExecutionInfo &info, bool *finished=NULL) override
 Implements custom algorithm to search transition system for a plan. More...
 

Protected Member Functions

void path2add2 (std::vector< std::vector< vertexDescriptor >>::reverse_iterator &path, const std::vector< vertexDescriptor > &add, std::vector< std::vector< vertexDescriptor >> &paths, TransitionSystem &g)
 Finds the best path to add a frontier to (frontier found separately) More...
 
std::vector< vertexDescriptor > best_path (const std::vector< std::vector< vertexDescriptor >> &paths, vertexDescriptor goal, vertexDescriptor cv, bool change, const TransitionSystem &g)
 Searches all paths for best path according to the lowest final cost phi. More...
 
std::vector< FrontierfrontierVertices (vertexDescriptor v, TransitionSystem &g, ExecutionInfo &info)
 Performs iterative deepening search to find the frontier. More...
 
void addToPriorityQueue (const Frontier &f, std::vector< Frontier > &queue, TransitionSystem &g, vertexDescriptor goal=TransitionSystem::null_vertex())
 Adds frontier to priority queue. More...
 

Protected Attributes

const Direction frontier_direction =DEFAULT
 The depth-first search portion of iterative deepening will stop when it reaches a DEFAULT task.
 

Additional Inherited Members

- Static Public Member Functions inherited from Planner
static float evaluationFunction (EndedResult er, const vertexDescriptor &v, std::vector< vertexDescriptor > &p)
 calculates cumulative cost phi, add discount factor if in plan More...
 
static EndedResult estimateCost (const State &state, b2Transform start, Direction d, Task &_goal)
 Estimates cost (phi) of a state as a measure of: past cost (gamma): the position relative to an obstacle, if present future cost heuristic (chi): the position relative to a goal, if present. More...
 

Detailed Description

Performs iterative deepening search over one unit of modular expansion (see below), i.e. search over one branch stops when it reaches a DEFAULT task. Each DEFAULT Task represents the frontier. The planner expands the search from the frontier with the lowest cost phi (A*-style search), which are logged into a priority queue.

NB: maximum amount of nodes traversed to find a DEFAULT task is three from the start node, including the DEFAULT task

                       EXAMPLE MODULE

             q2(LEFT)---q3(DEFAULT)
            /   
          q0 --- q1(DEFAULT)
            \
             q4(RIGHT)
                      \
                       q5(RIGHT)---q6(DEFAULT)      ->  maximum depth

Member Function Documentation

◆ addToPriorityQueue()

void HorizonStarPlanner::addToPriorityQueue ( const Frontier f,
std::vector< Frontier > &  queue,
TransitionSystem &  g,
vertexDescriptor  goal = TransitionSystem::null_vertex() 
)
protected

Adds frontier to priority queue.

Parameters
fthe frontier
queuethe priority queue
gthe transition system
goalthe vertex where the goal is reach

◆ best_path()

std::vector< vertexDescriptor > HorizonStarPlanner::best_path ( const std::vector< std::vector< vertexDescriptor >> &  paths,
vertexDescriptor  goal,
vertexDescriptor  cv,
bool  change,
const TransitionSystem &  g 
)
protected

Searches all paths for best path according to the lowest final cost phi.

Parameters
pathsall the paths
goalthe goal vertex (if known)
cvthe current vertex
changewhether the task needs to be changed
gthe transition system
Returns
the plan!

◆ frontierVertices()

std::vector< Frontier > HorizonStarPlanner::frontierVertices ( vertexDescriptor  v,
TransitionSystem &  g,
ExecutionInfo info 
)
protected

Performs iterative deepening search to find the frontier.

Parameters
vsource vertex: we find the frontier from here
gthe transitionSystem
d
info
Returns
std::vector <Frontier>

◆ path2add2()

void HorizonStarPlanner::path2add2 ( std::vector< std::vector< vertexDescriptor >>::reverse_iterator &  path,
const std::vector< vertexDescriptor > &  add,
std::vector< std::vector< vertexDescriptor >> &  paths,
TransitionSystem &  g 
)
protected

Finds the best path to add a frontier to (frontier found separately)

Parameters
paththe path to add to
addthe frontier
pathsall the paths
gthe transition system

◆ plan()

std::vector< vertexDescriptor > HorizonStarPlanner::plan ( TransitionSystem &  g,
vertexDescriptor  src,
ExecutionInfo info,
bool *  finished = NULL 
)
overridevirtual

Implements custom algorithm to search transition system for a plan.

Parameters
gthe transitionSystem
srcvertex from which the planning start
infoexecution info
finishedwill return true if the planning process reaches the goal
Returns
std::vector<vertexDescriptor>

Implements Planner.


The documentation for this class was generated from the following files: