A ProductGraph represents the weighted, directed, graph-based Cartesian product of a PropositionalDecomposition object, an Automaton corresponding to a co-safe LTL specification, and an Automaton corresponding to a safe LTL specification. More...
#include <ompl/control/planners/ltl/ProductGraph.h>
Classes | |
struct | Edge |
class | State |
A State of a ProductGraph represents a vertex in the graph-based Cartesian product represented by the ProductGraph. A State is simply a tuple consisting of a PropositionalDecomposition region, a co-safe Automaton state, and a safe Automaton state. More... | |
Public Member Functions | |
ProductGraph (PropositionalDecompositionPtr decomp, AutomatonPtr cosafetyAut, AutomatonPtr safetyAut) | |
Initializes a ProductGraph with a given PropositionalDecomposition, co-safe Automaton, and safe Automaton. | |
ProductGraph (const PropositionalDecompositionPtr &decomp, AutomatonPtr cosafetyAut) | |
Initializes an abstraction with a given propositional decomposition and cosafety automaton. The safety automaton is set to be one that always accepts. | |
const PropositionalDecompositionPtr & | getDecomp () const |
Returns the PropositionalDecomposition contained within this ProductGraph. | |
const AutomatonPtr & | getCosafetyAutom () const |
Returns the co-safe Automaton contained within this ProductGraph. | |
const AutomatonPtr & | getSafetyAutom () const |
Returns the safe Automaton contained within this ProductGraph. | |
std::vector< State * > | computeLead (State *start, const std::function< double(State *, State *)> &edgeWeight) |
Returns a shortest-path sequence of ProductGraph states, beginning with a given initial State and ending with a State for which the corresponding safety Automaton state is accepting, and the corresponding co-safety Automaton state is as close as possible to an accepting state given the adjacency properties of the PropositionalDecomposition. Dijkstra's shortest-path algorithm is used to compute the path with the given edge-weight function. | |
void | clear () |
Clears all memory belonging to this ProductGraph. | |
void | buildGraph (State *start, const std::function< void(State *)> &initialize=[](State *){}) |
Constructs this ProductGraph beginning with a given initial State, using a breadth-first search. Accepts an optional initialization method, which will be called exactly once on each State (including the given initial State) that is added to the ProductGraph. The default argument for the initialization method is a no-op method. | |
bool | isSolution (const State *s) const |
Returns whether the given State is an accepting State in this ProductGraph. We call a State accepting if its safety Automaton state component is accepting, and its co-safety Automaton state component is as close as possible to an accepting state in the co-safety Automaton given the adjacency properties of the PropositionalDecomposition. | |
State * | getStartState () const |
Returns the initial State of this ProductGraph. | |
double | getRegionVolume (const State *s) |
Helper method to return the volume of the PropositionalDecomposition region corresponding to the given ProductGraph State. | |
int | getCosafeAutDistance (const State *s) const |
Helper method to return the distance from a given State's co-safety state to an accepting state in the co-safety Automaton. | |
int | getSafeAutDistance (const State *s) const |
Helper method to return the distance from a given State's safety state to an accepting state in the safety Automaton. | |
State * | getState (const base::State *cs) const |
Returns a ProductGraph State with initial co-safety and safety Automaton states, and the PropositionalDecomposition region that contains a given base::State. | |
State * | getState (const base::State *cs, int cosafe, int safe) const |
Returns a ProductGraph State with given co-safety and safety Automaton states, and the PropositionalDecomposition region that contains a given base::State. | |
State * | getState (const State *parent, int nextRegion) const |
Returns a ProductGraph State with a given PropositionalDecomposition region. The co-safety and safety Automaton states are calculated using a given parent ProductGraph State and the decomposition region. | |
State * | getState (const State *parent, const base::State *cs) const |
Returns a ProductGraph state with the PropositionalDecomposition region that contains a given base::State. The co-safety and safety Automaton states are calculated using a given parent ProductGraph State and the decomposition region. | |
State * | getState (int region, int cosafe, int safe) const |
Returns the ProductGraph state corresponding to the given region, co-safety state, and safety state. | |
Protected Types | |
using | GraphType = boost::adjacency_list<boost::vecS, boost::vecS, boost::directedS, State *, Edge> |
using | Vertex = boost::graph_traits<GraphType>::vertex_descriptor |
using | VertexIter = boost::graph_traits<GraphType>::vertex_iterator |
using | VertexIndexMap = boost::property_map<GraphType, boost::vertex_index_t>::type |
using | EdgeIter = boost::graph_traits<GraphType>::edge_iterator |
Protected Attributes | |
PropositionalDecompositionPtr | decomp_ |
AutomatonPtr | cosafety_ |
AutomatonPtr | safety_ |
GraphType | graph_ |
State * | startState_ |
std::vector< State * > | solutionStates_ |
std::unordered_map< State, State *, HashState > | stateToPtr_ |
std::unordered_map< State *, int > | stateToIndex_ |
Detailed Description
A ProductGraph represents the weighted, directed, graph-based Cartesian product of a PropositionalDecomposition object, an Automaton corresponding to a co-safe LTL specification, and an Automaton corresponding to a safe LTL specification.
Definition at line 66 of file ProductGraph.h.
Member Typedef Documentation
◆ EdgeIter
|
protected |
Definition at line 236 of file ProductGraph.h.
◆ GraphType
|
protected |
Definition at line 232 of file ProductGraph.h.
◆ Vertex
|
protected |
Definition at line 233 of file ProductGraph.h.
◆ VertexIndexMap
|
protected |
Definition at line 235 of file ProductGraph.h.
◆ VertexIter
|
protected |
Definition at line 234 of file ProductGraph.h.
Constructor & Destructor Documentation
◆ ProductGraph() [1/2]
ompl::control::ProductGraph::ProductGraph | ( | PropositionalDecompositionPtr | decomp, |
AutomatonPtr | cosafetyAut, | ||
AutomatonPtr | safetyAut ) |
Initializes a ProductGraph with a given PropositionalDecomposition, co-safe Automaton, and safe Automaton.
Definition at line 104 of file ProductGraph.cpp.
◆ ProductGraph() [2/2]
ompl::control::ProductGraph::ProductGraph | ( | const PropositionalDecompositionPtr & | decomp, |
AutomatonPtr | cosafetyAut ) |
Initializes an abstraction with a given propositional decomposition and cosafety automaton. The safety automaton is set to be one that always accepts.
Definition at line 110 of file ProductGraph.cpp.
◆ ~ProductGraph()
ompl::control::ProductGraph::~ProductGraph | ( | ) |
Definition at line 115 of file ProductGraph.cpp.
Member Function Documentation
◆ buildGraph()
void ompl::control::ProductGraph::buildGraph | ( | State * | start, |
const std::function< void(State *)> & | initialize = [](State *){} ) |
Constructs this ProductGraph beginning with a given initial State, using a breadth-first search. Accepts an optional initialization method, which will be called exactly once on each State (including the given initial State) that is added to the ProductGraph. The default argument for the initialization method is a no-op method.
Definition at line 201 of file ProductGraph.cpp.
◆ clear()
void ompl::control::ProductGraph::clear | ( | ) |
Clears all memory belonging to this ProductGraph.
Definition at line 190 of file ProductGraph.cpp.
◆ computeLead()
std::vector< ompl::control::ProductGraph::State * > ompl::control::ProductGraph::computeLead | ( | State * | start, |
const std::function< double(State *, State *)> & | edgeWeight ) |
Returns a shortest-path sequence of ProductGraph states, beginning with a given initial State and ending with a State for which the corresponding safety Automaton state is accepting, and the corresponding co-safety Automaton state is as close as possible to an accepting state given the adjacency properties of the PropositionalDecomposition. Dijkstra's shortest-path algorithm is used to compute the path with the given edge-weight function.
Definition at line 135 of file ProductGraph.cpp.
◆ getCosafeAutDistance()
int ompl::control::ProductGraph::getCosafeAutDistance | ( | const State * | s | ) | const |
Helper method to return the distance from a given State's co-safety state to an accepting state in the co-safety Automaton.
Definition at line 290 of file ProductGraph.cpp.
◆ getCosafetyAutom()
const ompl::control::AutomatonPtr & ompl::control::ProductGraph::getCosafetyAutom | ( | ) | const |
Returns the co-safe Automaton contained within this ProductGraph.
Definition at line 125 of file ProductGraph.cpp.
◆ getDecomp()
const ompl::control::PropositionalDecompositionPtr & ompl::control::ProductGraph::getDecomp | ( | ) | const |
Returns the PropositionalDecomposition contained within this ProductGraph.
Definition at line 120 of file ProductGraph.cpp.
◆ getRegionVolume()
double ompl::control::ProductGraph::getRegionVolume | ( | const State * | s | ) |
Helper method to return the volume of the PropositionalDecomposition region corresponding to the given ProductGraph State.
Definition at line 285 of file ProductGraph.cpp.
◆ getSafeAutDistance()
int ompl::control::ProductGraph::getSafeAutDistance | ( | const State * | s | ) | const |
Helper method to return the distance from a given State's safety state to an accepting state in the safety Automaton.
Definition at line 295 of file ProductGraph.cpp.
◆ getSafetyAutom()
const ompl::control::AutomatonPtr & ompl::control::ProductGraph::getSafetyAutom | ( | ) | const |
Returns the safe Automaton contained within this ProductGraph.
Definition at line 130 of file ProductGraph.cpp.
◆ getStartState()
ompl::control::ProductGraph::State * ompl::control::ProductGraph::getStartState | ( | ) | const |
Returns the initial State of this ProductGraph.
Definition at line 280 of file ProductGraph.cpp.
◆ getState() [1/5]
ompl::control::ProductGraph::State * ompl::control::ProductGraph::getState | ( | const base::State * | cs | ) | const |
Returns a ProductGraph State with initial co-safety and safety Automaton states, and the PropositionalDecomposition region that contains a given base::State.
Definition at line 300 of file ProductGraph.cpp.
◆ getState() [2/5]
ompl::control::ProductGraph::State * ompl::control::ProductGraph::getState | ( | const base::State * | cs, |
int | cosafe, | ||
int | safe ) const |
Returns a ProductGraph State with given co-safety and safety Automaton states, and the PropositionalDecomposition region that contains a given base::State.
Definition at line 305 of file ProductGraph.cpp.
◆ getState() [3/5]
ompl::control::ProductGraph::State * ompl::control::ProductGraph::getState | ( | const State * | parent, |
const base::State * | cs ) const |
Returns a ProductGraph state with the PropositionalDecomposition region that contains a given base::State. The co-safety and safety Automaton states are calculated using a given parent ProductGraph State and the decomposition region.
Definition at line 331 of file ProductGraph.cpp.
◆ getState() [4/5]
ompl::control::ProductGraph::State * ompl::control::ProductGraph::getState | ( | const State * | parent, |
int | nextRegion ) const |
Returns a ProductGraph State with a given PropositionalDecomposition region. The co-safety and safety Automaton states are calculated using a given parent ProductGraph State and the decomposition region.
Definition at line 318 of file ProductGraph.cpp.
◆ getState() [5/5]
|
inline |
Returns the ProductGraph state corresponding to the given region, co-safety state, and safety state.
Definition at line 214 of file ProductGraph.h.
◆ isSolution()
bool ompl::control::ProductGraph::isSolution | ( | const State * | s | ) | const |
Returns whether the given State is an accepting State in this ProductGraph. We call a State accepting if its safety Automaton state component is accepting, and its co-safety Automaton state component is as close as possible to an accepting state in the co-safety Automaton given the adjacency properties of the PropositionalDecomposition.
Definition at line 275 of file ProductGraph.cpp.
Member Data Documentation
◆ cosafety_
|
protected |
Definition at line 239 of file ProductGraph.h.
◆ decomp_
|
protected |
Definition at line 238 of file ProductGraph.h.
◆ graph_
|
protected |
Definition at line 241 of file ProductGraph.h.
◆ safety_
|
protected |
Definition at line 240 of file ProductGraph.h.
◆ solutionStates_
|
protected |
Definition at line 243 of file ProductGraph.h.
◆ startState_
|
protected |
Definition at line 242 of file ProductGraph.h.
◆ stateToIndex_
|
protected |
Definition at line 254 of file ProductGraph.h.
◆ stateToPtr_
|
mutableprotected |
Definition at line 250 of file ProductGraph.h.
The documentation for this class was generated from the following files:
- ompl/control/planners/ltl/ProductGraph.h
- ompl/control/planners/ltl/src/ProductGraph.cpp