1 #ifndef PPL_SIPP_METHOD_H_
2 #define PPL_SIPP_METHOD_H_
33 return vid == _other.
vid &&
51 typedef std::unordered_set<size_t>
VIDSet;
57 typedef std::map<std::pair<size_t,size_t>,
78 virtual void Print(std::ostream& _os)
const override;
95 std::pair<std::vector<size_t>,std::vector<size_t>>
96 GeneratePath(
const size_t _start,
const std::vector<size_t> _goals);
125 virtual void Reset();
132 virtual bool PerformSubQuery(
const size_t _start,
const std::vector<size_t> _goals);
144 virtual double PathWeight(
typename SIPPGraph::adj_edge_iterator& _ei,
145 const double _sourceDistance,
const double _targetDistance);
155 typename SIPPGraph::vertex_descriptor _source,
156 typename SIPPGraph::vertex_descriptor _target);
161 template <
typename AbstractRoadmap>
163 AbstractRoadmap* _rm);
166 template <
typename AbstractRoadmap>
167 void BuildNeighbors(
typename SIPPGraph::vertex_descriptor _sippSource,
168 size_t _rmTarget, AbstractRoadmap* _rm);
207 template <
typename AbstractRoadmap>
211 typename SIPPGraph::vertex_descriptor _vid,
212 AbstractRoadmap* _rm) {
215 auto vid = vertex.vid;
218 auto vit = _rm->find_vertex(vid);
221 if(vit == _rm->end())
225 for(
auto eit = vit->begin(); eit != vit->end(); eit++) {
231 template <
typename AbstractRoadmap>
234 BuildNeighbors(
typename SIPPGraph::vertex_descriptor _sippSource,
size_t _rmTarget,
235 AbstractRoadmap* _rm) {
238 const size_t rmSource = vertex.vid;
241 std::vector<Range<size_t>> endIntervals;
249 for(
auto& inter : endIntervals) {
253 targetVertex.
vid = _rmTarget;
259 newEdge.
source = rmSource;
260 newEdge.
target = _rmTarget;
#define WHERE
Macro for retrieving info about file, function, and line number.
Definition: RuntimeUtils.h:32
std::ostream & operator<<(std::ostream &_os, const SIPPVertex &_vertex)
Definition: SIPPMethod.cpp:637
std::istream & operator>>(std::istream &_is, SIPPVertex &_vertex)
Definition: SIPPMethod.cpp:633
Definition: GenericStateGraph.h:67
virtual EID AddEdge(const VID _source, const VID _target, const Edge &_w) noexcept
Definition: GenericStateGraph.h:698
virtual VID AddVertex(const Vertex &_v) noexcept
Definition: GenericStateGraph.h:591
VP & GetVertex(T &_t) noexcept
Retrieve a reference to a vertex property by descriptor or iterator.
Definition: GenericStateGraph.h:1034
Definition: GroupCfg.h:39
Definition: GroupLocalPlan.h:24
Definition: GroupRoadmap.h:25
Definition: MapEvaluatorMethod.h:16
Definition: SIPPMethod.h:44
virtual void Print(std::ostream &_os) const override
Definition: SIPPMethod.cpp:38
void SetEdgeIntervals(EdgeIntervalMap _edgeIntervals)
Set the edge intervals to use to generate a path.
Definition: SIPPMethod.cpp:570
MPBaseObject::GroupCfgType GroupCfgType
Definition: SIPPMethod.h:54
GenericStateGraph< SIPPVertex, SIPPEdge > SIPPGraph
Definition: SIPPMethod.h:62
virtual bool PerformSubQuery(const size_t _start, const std::vector< size_t > _goals)
Definition: SIPPMethod.cpp:344
std::map< size_t, std::vector< Range< size_t > > > VertexIntervalMap
Definition: SIPPMethod.h:60
void BuildNeighbors(typename SIPPGraph::vertex_descriptor _sippSource, size_t _rmTarget, AbstractRoadmap *_rm)
Construct the SIPP neighbors for roadmap edge.
Definition: SIPPMethod.h:234
double SIPPHeuristic(const SIPPGraph *_g, typename SIPPGraph::vertex_descriptor _source, typename SIPPGraph::vertex_descriptor _target)
Definition: SIPPMethod.cpp:493
EdgeIntervalMap m_edgeIntervals
Set of safe edge intervals.
Definition: SIPPMethod.h:186
size_t m_startTime
The start time of the path.
Definition: SIPPMethod.h:192
SIPPMethod()
Definition: SIPPMethod.cpp:16
void SetDMLabel(const std::string &_dmLabel)
Set the distance metric to use.
Definition: SIPPMethod.cpp:308
virtual bool operator()() override
Definition: SIPPMethod.cpp:64
std::map< std::pair< size_t, size_t >, std::vector< Range< size_t > > > EdgeIntervalMap
Definition: SIPPMethod.h:58
MPBaseObject::RoadmapType RoadmapType
Definition: SIPPMethod.h:52
virtual ~SIPPMethod()=default
void SetStartTime(size_t _start)
Set the start time of the query.
Definition: SIPPMethod.cpp:315
bool m_minTime
Flag indiciating if search is minimizing time or distance metric.
Definition: SIPPMethod.h:196
MPBaseObject::GroupWeightType GroupWeightType
Definition: SIPPMethod.h:55
std::string m_dmLabel
Distance metric label.
Definition: SIPPMethod.h:202
virtual double PathWeight(typename SIPPGraph::adj_edge_iterator &_ei, const double _sourceDistance, const double _targetDistance)
Definition: SIPPMethod.cpp:385
size_t m_goalIndex
Index of the current goal to extend the path to.
Definition: SIPPMethod.h:180
size_t m_minEndTime
The minimum end time of the path.
Definition: SIPPMethod.h:193
void InitializeCostToGo(const std::vector< size_t > _goal)
Initialize the cost to go from the start point to the goal.
Definition: SIPPMethod.cpp:522
std::unordered_map< size_t, double > m_costToGoMap
Cost-to-go map used for heuristic values.
Definition: SIPPMethod.h:184
bool m_initialized
Flag indicating if the object has been initialized.
Definition: SIPPMethod.h:195
void SetVertexIntervals(VertexIntervalMap _vertexIntervals)
Set the edge intervals to use to generate a path.
Definition: SIPPMethod.cpp:577
std::pair< std::vector< size_t >, std::vector< size_t > > GeneratePath(const size_t _start, const std::vector< size_t > _goals)
Definition: SIPPMethod.cpp:199
VertexIntervalMap m_vertexIntervals
Set of safe vertex intervals.
Definition: SIPPMethod.h:187
void SetMinEndTime(size_t _end)
Set the end time of the query.
Definition: SIPPMethod.cpp:322
std::string m_safeIntervalLabel
Label of the SI Tool to use.
Definition: SIPPMethod.h:201
MPBaseObject::GroupRoadmapType GroupRoadmapType
Definition: SIPPMethod.h:53
SIPPGraph * m_sippGraph
The graph representing the time-interval extended state space.
Definition: SIPPMethod.h:178
void SIPPNeighbors(SIPPGraph *_g, typename SIPPGraph::vertex_descriptor _vid)
Neighbors function for Safe interval path planning.
Definition: SIPPMethod.cpp:507
size_t m_startVID
The start vid in the sipp graph.
Definition: SIPPMethod.h:181
virtual void Initialize() override
Definition: SIPPMethod.cpp:49
virtual void Reset()
Definition: SIPPMethod.cpp:329
bool SatisfyConstraints(Range< size_t > _interval)
Check if the path satisfies all constraints.
Definition: SIPPMethod.cpp:584
std::unordered_map< size_t, std::unordered_map< size_t, size_t > > m_waitTimesteps
Compute wait timesteps at each vertex during the search process.
Definition: SIPPMethod.h:190
std::unordered_set< size_t > VIDSet
Definition: SIPPMethod.h:51
Definition: PMPLExceptions.h:62
Definition: SIPPMethod.h:38
size_t source
Definition: SIPPMethod.h:39
Range< double > interval
Definition: SIPPMethod.h:41
size_t target
Definition: SIPPMethod.h:40
Definition: SIPPMethod.h:28
bool operator==(const SIPPVertex &_other) const
Definition: SIPPMethod.h:32
Range< size_t > interval
Definition: SIPPMethod.h:30
size_t vid
Definition: SIPPMethod.h:29