batching_pomp  1.0
This is an implementation of an algorithmic framework for anytime motion planning on large dense roadmaps.
SingleBatching.hpp
1 /***********************************************************************
2 Copyright (c) 2017, Shushman Choudhury
3 All rights reserved.
4 Authors: Shushman Choudhury <shushmanchoudhury@gmail.com>
5 
6 Redistribution and use in source and binary forms, with or without
7 modification, are permitted provided that the following conditions are
8 met:
9  Redistributions of source code must retain the above copyright
10  notice, this list of conditions and the following disclaimer.
11  Redistributions in binary form must reproduce the above copyright
12  notice, this list of conditions and the following disclaimer in the
13  documentation and/or other materials provided with the distribution.
14 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
15 "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
16 LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
17 A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
18 HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
19 SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
20 LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
21 DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
22 THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
23 (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
24 OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
25 *************************************************************************/
26 
27 #ifndef BATCHING_POMP_SINGLE_BATCHING_HPP_
28 #define BATCHING_POMP_SINGLE_BATCHING_HPP_
29 
30 #include <ompl/base/StateSpace.h>
31 #include <ompl/util/Console.h>
32 #include <boost/graph/adjacency_list.hpp>
33 #include <boost/graph/properties.hpp>
34 #include "batching_pomp/batching/BatchingManager.hpp"
35 
36 namespace batching_pomp{
37 namespace batching {
38 
40 
44 template<class Graph, class VStateMap, class StateCon, class EDistance>
45 class SingleBatching : public BatchingManager<Graph, VStateMap, StateCon, EDistance>
46 {
47 
48 typedef boost::graph_traits<Graph> GraphTypes;
49 typedef typename GraphTypes::vertex_iterator VertexIter;
50 typedef typename GraphTypes::vertex_descriptor Vertex;
51 
52 
53 public:
54 
55  SingleBatching(const ompl::base::StateSpacePtr _space,
56  VStateMap _stateMap,
57  EDistance _distanceMap,
58  std::string _roadmapFileName,
59  Graph& _fullRoadmap,
60  Graph& _currentRoadmap
61  )
63  (_space,_stateMap,_distanceMap,_roadmapFileName,_fullRoadmap,_currentRoadmap)
64  {
66  }
67 
70  void updateWithNewSolutionCost(double _newSolnCost) override
71  {
72  }
73 
74  void nextBatch(const std::function<bool(const ompl::base::State*)>& _pruneFunction,
75  ompl::NearestNeighbors<Vertex>& _vertexNN) override
76  {
78  OMPL_INFORM("Batching exhausted! No updates with nextBatch!");
79  return;
80  }
81 
82  OMPL_INFORM("Single Batch called!");
84 
85  // You know there is only one batch
86  // Now remove all invalid vertices
88 
90 
91  }
92 
93 };
94 
95 
96 
97 } // namespace batching
98 } // namespace batching_pomp
99 #endif // BATCHING_POMP_SINGLE_BATCHING_HPP_
void nextBatch(const std::function< bool(const ompl::base::State *)> &_pruneFunction, ompl::NearestNeighbors< Vertex > &_vertexNN) override
Definition: SingleBatching.hpp:74
void updateWithNewSolutionCost(double _newSolnCost) override
Overriden methods.
Definition: SingleBatching.hpp:70
Abstract class that represents the batching strategy used for the planning algorithm.
Definition: BatchingManager.hpp:51
Derived class of BatchingManager that implements a single batch search.
Definition: SingleBatching.hpp:45
Definition: BatchingManager.hpp:36
void pruneVertices(const std::function< bool(const ompl::base::State *)> &_pruneFunction, ompl::NearestNeighbors< Vertex > &_vertexNN)
Definition: BatchingManager.hpp:144