#include "MPProblem/Environment/Environment.h"
#include "Utilities/PMPLExceptions.h"
#include "Utilities/RuntimeUtils.h"
#include <containers/sequential/graph/graph.h>
#include <containers/sequential/graph/graph_util.h>
#include <containers/sequential/graph/vertex_iterator_adaptor.h>
#include <containers/sequential/graph/algorithms/connected_components.h>
#include <containers/sequential/graph/algorithms/graph_input_output.h>
#include "Utilities/CCTracker.h"
#include <fstream>
#include <functional>
#include <iostream>
#include <string>
#include <unordered_map>
#include <unordered_set>
#include <vector>
Go to the source code of this file.
|
#define | INVALID_VID (std::numeric_limits<size_t>::max()) |
|
#define | INVALID_EID (std::numeric_limits<size_t>::max()) |
|
|
template<typename GenericStateGraph > |
void | Read (GenericStateGraph *_g, const std::string &_filename) |
|
template<typename GenericStateGraph > |
void | ReadMessage (GenericStateGraph *_g, const std::string &_msg) |
|
std::unordered_set< size_t > | VertexSetIntersection (const std::unordered_set< size_t > &_a, const std::unordered_set< size_t > &_b) |
|
bool | HaveCommonVertex (const std::unordered_set< size_t > &_a, const std::unordered_set< size_t > &_b) |
|
std::unordered_set< size_t > & | VertexSetUnionInPlace (std::unordered_set< size_t > &_receiver, const std::unordered_set< size_t > &_source) |
|
template<typename T , typename... Rest> |
const T & | RandomElement (const std::unordered_set< T, Rest... > &_set) noexcept |
|
◆ INVALID_EID
#define INVALID_EID (std::numeric_limits<size_t>::max()) |
◆ INVALID_VID
#define INVALID_VID (std::numeric_limits<size_t>::max()) |
◆ HaveCommonVertex()
bool HaveCommonVertex |
( |
const std::unordered_set< size_t > & |
_a, |
|
|
const std::unordered_set< size_t > & |
_b |
|
) |
| |
|
inline |
Check if two vertex sets have any members in common.
- Parameters
-
_a | The first set. |
_b | The second set. |
- Returns
- True if there are any vertices in both _a and _b.
◆ RandomElement()
template<typename T , typename... Rest>
const T& RandomElement |
( |
const std::unordered_set< T, Rest... > & |
_set | ) |
|
|
inlinenoexcept |
Select a random element from a vertex set (or other unordered set).
- Parameters
-
- Returns
- A random element from within.
- Note
- This is a two-stage random process that is far more efficient than simply std::advancing the begin iterator, which costs linear time. The solution here is to randomly select a bucket and then choose a random element within. This is linear in the bucket size (much smaller than the whole container).
◆ Read()
template<typename GenericStateGraph >
Read in a roadmap (.map) file.
- Parameters
-
_g | The graph to populate from the map file. |
_filename | The name of the map file to read. |
- Note
- This is a non-member to avoid problems with explicit instantiation of this function for robot groups. It should be returned to a member function when we have an elegant means for implementing group roadmap input.
@TODO this is a bad way to handle the fact that it's necessary to know the robot type (non/holonomic) when reading and writing.
◆ ReadMessage()
template<typename GenericStateGraph >
Read in a message.
- Parameters
-
_g | The graph to populate from the message. |
_msg | The message containing the graph. |
- Note
- This is a non-member to avoid problems with explicit instantiation of this function for robot groups. It should be returned to a member function when we have an elegant means for implementing group roadmap input.
@TODO this is a bad way to handle the fact that it's necessary to know the robot type (non/holonomic) when reading and writing.
◆ VertexSetIntersection()
std::unordered_set<size_t> VertexSetIntersection |
( |
const std::unordered_set< size_t > & |
_a, |
|
|
const std::unordered_set< size_t > & |
_b |
|
) |
| |
|
inline |
Find the intersection of two vertex sets.
- Parameters
-
_a | The first set. |
_b | The second set. |
- Returns
- The intersection of _a and _b.
◆ VertexSetUnionInPlace()
std::unordered_set<size_t>& VertexSetUnionInPlace |
( |
std::unordered_set< size_t > & |
_receiver, |
|
|
const std::unordered_set< size_t > & |
_source |
|
) |
| |
|
inline |
Merge one vertex set into another.
- Parameters
-
_receiver | The vertex set receiving new VIDs. |
_source | The source of the new VIDs. |
- Returns
- A reference to _receiver.