5 #include "graphTools.h"
15 vertexDescriptor frontier=TransitionSystem::null_vertex();
16 std::vector<vertexDescriptor> connecting;
20 Frontier(vertexDescriptor _f,
const std::vector<vertexDescriptor>&_c):frontier(_f), connecting(_c){}
31 bool operator()(
const std::pair<State*, Frontier>& p1,
const std::pair<State*, Frontier>& p2)
const{
32 return (*p1.first).phi<(*p2.first).phi;
43 vertexDescriptor m_currentVertex=0, m_goalVertex=TransitionSystem::null_vertex();
45 Task m_overarchingGoal;
47 std::vector <vertexDescriptor> m_plan;
51 void been(
bool b){m_been=b;}
53 void goalVertex(vertexDescriptor gv){m_goalVertex=gv;}
59 ExecutionInfo( vertexDescriptor _cv, vertexDescriptor _goal,
Task & _ct,
Task & _gt,
bool _been, std::vector<vertexDescriptor> _plan){
63 m_overarchingGoal=_gt;
67 void overarchingGoal(
const Task & og){m_overarchingGoal=og;}
70 vertexDescriptor currentVertex()
const{
return m_currentVertex;}
72 vertexDescriptor goalVertex()
const{
return m_goalVertex;}
74 Task& currentTask(){
return m_currentTask;}
76 Task& overarchingGoal() {
return m_overarchingGoal;}
78 bool been()
const{
return m_been;}
80 std::vector<vertexDescriptor> plan()
const{
return m_plan;}
104 virtual std::vector<vertexDescriptor>
plan(TransitionSystem& g, vertexDescriptor src,
ExecutionInfo & info,
bool *finished)=0;
165 void path2add2(std::vector<std::vector<vertexDescriptor>>::reverse_iterator & path,
const std::vector <vertexDescriptor> & add, std::vector<std::vector<vertexDescriptor>> &paths, TransitionSystem &g);
177 std::vector <vertexDescriptor>
best_path(
const std::vector<std::vector<vertexDescriptor>>& paths, vertexDescriptor goal, vertexDescriptor cv,
bool change,
const TransitionSystem& g);
200 void addToPriorityQueue(
const Frontier &f, std::vector<Frontier>& queue, TransitionSystem &g, vertexDescriptor goal=TransitionSystem::null_vertex());
205 std::vector<vertexDescriptor>
plan(TransitionSystem& g, vertexDescriptor src,
ExecutionInfo & info,
bool * finished=NULL)
override;
215 std::vector<vertexDescriptor> plan(TransitionSystem& g, vertexDescriptor src,
ExecutionInfo & info,
bool * finished=NULL)
override{}
Definition: configurator.h:17
Information about what the configurator is doing (current Task, current vertex), what it wants to do ...
Definition: planner.h:41
Performs iterative deepening search over one unit of modular expansion (see below),...
Definition: planner.h:149
const Direction frontier_direction
The depth-first search portion of iterative deepening will stop when it reaches a DEFAULT task.
Definition: planner.h:155
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.
Definition: planner.cpp:62
std::vector< Frontier > frontierVertices(vertexDescriptor v, TransitionSystem &g, ExecutionInfo &info)
Performs iterative deepening search to find the frontier.
Definition: planner.cpp:89
void addToPriorityQueue(const Frontier &f, std::vector< Frontier > &queue, TransitionSystem &g, vertexDescriptor goal=TransitionSystem::null_vertex())
Adds frontier to priority queue.
Definition: planner.cpp:161
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)
Definition: planner.cpp:22
std::vector< vertexDescriptor > plan(TransitionSystem &g, vertexDescriptor src, ExecutionInfo &info, bool *finished=NULL) override
Implements custom algorithm to search transition system for a plan.
Definition: planner.cpp:171
Does not extract a plan.
Definition: planner.h:213
Searches the transition system and extracts a plan.
Definition: planner.h:88
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 obsta...
Definition: planner.cpp:12
static float evaluationFunction(EndedResult er, const vertexDescriptor &v, std::vector< vertexDescriptor > &p)
calculates cumulative cost phi, add discount factor if in plan
Definition: planner.cpp:3
virtual std::vector< vertexDescriptor > plan(TransitionSystem &g, vertexDescriptor src, ExecutionInfo &info, bool *finished)=0
Implements custom algorithm to search transition system for a plan.
Predicate which compares evaluation functions in State-Frontier pairs.
Definition: planner.h:27
Definition: measurement.h:74
Contains the frontier (first) and the connecting vertices.
Definition: planner.h:14
Hybrid states in the transition system.
Definition: graphTools.h:69