5 #include "graphTools.h"
17 vertexDescriptor frontier=TransitionSystem::null_vertex();
18 std::vector<vertexDescriptor> connecting;
22 Frontier(vertexDescriptor _f,
const std::vector<vertexDescriptor>&_c):frontier(_f), connecting(_c){}
24 bool operator==(
const Frontier &f)
const{
25 return frontier==f.frontier && connecting==f.connecting;
38 bool operator()(
const std::pair<State*, Frontier>& p1,
const std::pair<State*, Frontier>& p2)
const{
39 return (*p1.first).phi<(*p2.first).phi;
50 vertexDescriptor m_currentVertex=0, m_goalVertex=TransitionSystem::null_vertex();
52 Task m_overarchingGoal;
54 std::vector <vertexDescriptor> m_plan;
58 void been(
bool b){m_been=b;}
60 void goalVertex(vertexDescriptor gv){m_goalVertex=gv;}
66 ExecutionInfo( vertexDescriptor _cv, vertexDescriptor _goal,
Task & _ct,
Task & _gt,
bool _been, std::vector<vertexDescriptor> _plan){
70 m_overarchingGoal=_gt;
74 void overarchingGoal(
const Task & og){m_overarchingGoal=og;}
77 vertexDescriptor currentVertex()
const{
return m_currentVertex;}
79 vertexDescriptor goalVertex()
const{
return m_goalVertex;}
81 Task& currentTask(){
return m_currentTask;}
83 Task& overarchingGoal() {
return m_overarchingGoal;}
85 bool been()
const{
return m_been;}
87 std::vector<vertexDescriptor> plan()
const{
return m_plan;}
146 virtual std::vector<vertexDescriptor>
plan(TransitionSystem& g, vertexDescriptor src,
ExecutionInfo & info,
bool *finished)=0;
179 void path2add2(std::vector<std::vector<vertexDescriptor>>::reverse_iterator & path,
const std::vector <vertexDescriptor> & add, std::vector<std::vector<vertexDescriptor>> &paths, TransitionSystem &g);
191 std::vector <vertexDescriptor>
best_path(
const std::vector<std::vector<vertexDescriptor>>& paths, vertexDescriptor goal, vertexDescriptor cv,
bool change,
const TransitionSystem& g);
203 void addToPriorityQueue(
const Frontier &f, std::vector<Frontier>& queue, TransitionSystem &g,
const std::set<vertexDescriptor>&closed, vertexDescriptor goal=TransitionSystem::null_vertex());
208 std::vector<vertexDescriptor>
plan(TransitionSystem& g, vertexDescriptor src,
ExecutionInfo & info,
bool * finished=NULL)
override;
218 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:48
Performs iterative deepening search over one unit of modular expansion (see below),...
Definition: planner.h:168
void addToPriorityQueue(const Frontier &f, std::vector< Frontier > &queue, TransitionSystem &g, const std::set< vertexDescriptor > &closed, vertexDescriptor goal=TransitionSystem::null_vertex())
Adds frontier to priority queue.
Definition: planner.cpp:177
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:72
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:20
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:194
Does not extract a plan.
Definition: planner.h:216
Searches the transition system and extracts a plan.
Definition: planner.h:130
virtual std::vector< vertexDescriptor > plan(TransitionSystem &g, vertexDescriptor src, ExecutionInfo &info, bool *finished)=0
Implements custom algorithm to search transition system for a plan.
A closed hybrid control loop. It has an initial disturbance representing the continuous state and a d...
Definition: task.h:45
std::vector< Frontier > frontierVertices(vertexDescriptor v, TransitionSystem &g, ExecutionInfo &info)
Performs iterative deepening search to find the frontier.
Definition: planner.cpp:100
EndedResult estimateCost(const State &state, b2Transform start, Direction d, Task &_goal)
Provides a breakdown of the cost function into its components: past cost (gamma): the position relati...
Definition: planner.cpp:13
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
Predicate which compares evaluation functions in State-Frontier pairs.
Definition: planner.h:34
Provides information on whether a Task has ended and with what heuristic -estimated- cost (chi) and p...
Definition: measurement.h:122
Contains the frontier (first) and the connecting vertices.
Definition: planner.h:16
Hybrid states in the transition system.
Definition: graphTools.h:69