![]() |
Parasol Planning Library (PPL)
|
#include <MPProblem.h>
Public Member Functions | |
Construction | |
MPProblem () | |
Instantiate an empty MPProblem. More... | |
MPProblem (const std::string &_filename) | |
MPProblem (XMLNode _mpNode, XMLNode _input) | |
MPProblem (const MPProblem &_other) | |
Copy. More... | |
MPProblem (MPProblem &&_other)=delete | |
virtual | ~MPProblem () |
Assignment | |
MPProblem & | operator= (const MPProblem &_other) |
Copy. More... | |
MPProblem & | operator= (MPProblem &&_other)=delete |
XML File Parsing | |
const std::string & | GetXMLFilename () const |
Get the XML filename from which this object was parsed. More... | |
void | ReadXMLFile (const std::string &_filename) |
void | ProcessXML (XMLNode mpNode, XMLNode input) |
Environment Accessors | |
Environment * | GetEnvironment () |
Get the environment object. More... | |
void | SetEnvironment (std::unique_ptr< Environment > &&_e) |
Robot Accessors | |
size_t | NumRobots () const noexcept |
Get the number of robots in our problem. More... | |
Robot * | GetRobot (const size_t _index) const noexcept |
Robot * | GetRobot (const std::string &_label) const noexcept |
const std::vector< std::unique_ptr< Robot > > & | GetRobots () const noexcept |
Get all robots in this problem. More... | |
const std::vector< Robot * > | GetRobotsOfType (std::string _type) const noexcept |
size_t | NumRobotGroups () const noexcept |
RobotGroup * | GetRobotGroup (const size_t _index) const noexcept |
RobotGroup * | GetRobotGroup (const std::string &_label) const noexcept |
const std::vector< std::unique_ptr< RobotGroup > > & | GetRobotGroups () const noexcept |
Cfg | GetInitialCfg (Robot *_r) |
void | SetInitialCfg (Robot *_r, Cfg _cfg) |
Task Accessors | |
MPTask * | GetTask (std::string _label) |
std::vector< std::shared_ptr< MPTask > > | GetTasks (Robot *const _robot) const noexcept |
std::vector< std::shared_ptr< GroupTask > > | GetTasks (RobotGroup *const _group) const noexcept |
void | AddTask (std::unique_ptr< MPTask > &&_task) |
void | ReassignTask (MPTask *const _task, Robot *const _newOwner) |
void | AddDecomposition (Robot *_coordinator, std::unique_ptr< Decomposition > &&_decomp) |
const std::vector< std::unique_ptr< Decomposition > > & | GetDecompositions (Robot *_coordinator) |
const std::unordered_map< Robot *, std::vector< std::unique_ptr< Decomposition > > > & | GetDecompositions () |
Get map of robots to decompositions. More... | |
Dynamic Obstacle Accessors | |
const std::vector< DynamicObstacle > & | GetDynamicObstacles () const noexcept |
Get all of the dynamic obstacles in this problem. More... | |
void | AddDynamicObstacle (DynamicObstacle &&_obstacle) |
void | ClearDynamicObstacles () |
Remove all of the dynamic obstacles in this problem. More... | |
Debugging | |
virtual void | Print (std::ostream &_os) const |
File Path Accessors | |
const std::string & | GetBaseFilename () const |
Get the base filename for output files. More... | |
void | SetBaseFilename (const std::string &_s) |
std::string | GetPath (const std::string &_filename="") |
void | SetPath (const std::string &_filename) |
Handoff Template Accessors | |
std::vector< std::unique_ptr< InteractionInformation > > & | GetInteractionInformations () |
Protected Member Functions | |
Construction Helpers | |
void | ParseChild (XMLNode &_node) |
void | MakePointRobot () |
Create a pseudo-point robot. More... | |
Protected Attributes | |
Core Properties | |
std::unique_ptr< Environment > | m_environment |
The planning environment. More... | |
std::vector< std::unique_ptr< Robot > > | m_robots |
The robots in our problem. More... | |
std::vector< std::unique_ptr< RobotGroup > > | m_robotGroups |
Robot groups. More... | |
std::unique_ptr< Robot > | m_pointRobot |
A pseudo point-robot. More... | |
std::unordered_map< std::string, std::vector< Robot * > > | m_robotCapabilityMap |
Map of robot type to set of robots. More... | |
std::unordered_map< Robot *, Cfg > | m_initialCfgs |
Map of robot initial locations. More... | |
std::vector< DynamicObstacle > | m_dynamicObstacles |
The dynamic obstacles in our problem. More... | |
std::vector< std::unique_ptr< InteractionInformation > > | m_interactionInformations |
All handoff templates for a problem. More... | |
std::unordered_map< Robot *, std::list< std::shared_ptr< MPTask > > > | m_taskMap |
Map the tasks assigned to each robot. More... | |
std::unordered_map< RobotGroup *, std::list< std::shared_ptr< GroupTask > > > | m_groupTaskMap |
Map the group tasks assigned to each robot group. More... | |
std::unordered_map< std::string, MPTask * > | m_taskLabelMap |
Map task labels to tasks. More... | |
std::unordered_map< Robot *, std::vector< std::unique_ptr< Decomposition > > > | m_taskDecompositions |
Map robots to task decompositions. More... | |
Files | |
std::string | m_xmlFilename |
The XML file name. More... | |
std::string | m_baseFilename |
The base name for output files. More... | |
std::string | m_filePath |
The relative path for the problem XML. More... | |
Representation of a motion planning problem, including an environment, tasks, and robots.
|
default |
Instantiate an empty MPProblem.
|
explicit |
Instantiate an MPProblem from an XML file.
_filename | The name of the XML file. |
Instantiate an MPProblem from an XML strings.
_mpNode,_input | Strings containing the XML to be parsed. |
MPProblem::MPProblem | ( | const MPProblem & | _other | ) |
Copy.
|
delete |
|
virtualdefault |
void MPProblem::AddDecomposition | ( | Robot * | _coordinator, |
std::unique_ptr< Decomposition > && | _decomp | ||
) |
Assign task decomposition to a robot
_coordinator | Robot to assign task to |
_decomp | The decomposition task to assign |
void MPProblem::AddDynamicObstacle | ( | DynamicObstacle && | _obstacle | ) |
Add dynamic obstacle to this problem
Dynamic | obstacle to add |
void MPProblem::AddTask | ( | std::unique_ptr< MPTask > && | _task | ) |
Add a task to the problem. The assigned robot will be taken from the task object.
_task | The new task. |
void MPProblem::ClearDynamicObstacles | ( | ) |
Remove all of the dynamic obstacles in this problem.
const std::string & MPProblem::GetBaseFilename | ( | ) | const |
Get the base filename for output files.
const std::unordered_map< Robot *, std::vector< std::unique_ptr< Decomposition > > > & MPProblem::GetDecompositions | ( | ) |
Get map of robots to decompositions.
const std::vector< std::unique_ptr< Decomposition > > & MPProblem::GetDecompositions | ( | Robot * | _coordinator | ) |
Get set of decomposition tasks for given robot
_coordinator | Robot to return task decompositions for |
|
noexcept |
Get all of the dynamic obstacles in this problem.
Environment * MPProblem::GetEnvironment | ( | ) |
Get the environment object.
Get initial configuration of a robot
_r | Robot whose configuration to retrieve |
std::vector< std::unique_ptr< InteractionInformation > > & MPProblem::GetInteractionInformations | ( | ) |
Return the list of handoff templates defined in the problem
string MPProblem::GetPath | ( | const std::string & | _filename = "" | ) |
Get the base path for input files to a file name.
_filename | The filename to modify. |
|
noexcept |
Get a specific robot by index.
_index | Index of robot to get |
|
noexcept |
Get a specific robot by label.
_label | Label of robot to get |
|
noexcept |
Get a specific robot group by index.
_index | Index of robot group to retrieve |
|
noexcept |
Get a specific robot group by group's label.
_label | Label of robot group to retrieve |
|
noexcept |
Get all robot groups in this problem.
|
noexcept |
Get all robots in this problem.
|
noexcept |
Get all robots of a specified type.
_type | Type of robots to retrieve |
MPTask * MPProblem::GetTask | ( | std::string | _label | ) |
Get task by label
_label | Label of task to retrieve |
Get the unfinished tasks currently assigned to a given robot.
_robot | The robot to retrieve tasks for. |
|
noexcept |
Group overload Get the unfinished tasks currently assigned to a group of robots.
_group | The robot group to retrieve tasks for. |
const std::string & MPProblem::GetXMLFilename | ( | ) | const |
Get the XML filename from which this object was parsed.
|
protected |
Create a pseudo-point robot.
|
noexcept |
Group versions: Get the number of robot groups in our problem.
|
noexcept |
Get the number of robots in our problem.
|
protected |
|
virtual |
Print the environment, robot, and task information.
_os | Stream to print to |
Initialize MPProblem based on XMLNodes.
_filename | The XML file name. |
void MPProblem::ReadXMLFile | ( | const std::string & | _filename | ) |
Read an XML file.
_filename | The XML file name. |
Reassign a task to another robot.
_task | The task to reassign. |
_newOwner | The new robot assigned to _task. |
void MPProblem::SetBaseFilename | ( | const std::string & | _s | ) |
Set the base filename for output files.
_s | New base filename |
void MPProblem::SetEnvironment | ( | std::unique_ptr< Environment > && | _e | ) |
Set the environment object.
_e | Environment to set to |
Get initial configuration of a robot
_r | Robot whose configuration to retrieve |
_cfg | Configuration to set for _r |
void MPProblem::SetPath | ( | const std::string & | _filename | ) |
Set the base path for input files.
_fileName | File path to set |
|
protected |
The base name for output files.
|
protected |
The dynamic obstacles in our problem.
|
protected |
The planning environment.
|
protected |
The relative path for the problem XML.
|
protected |
Map the group tasks assigned to each robot group.
|
protected |
All handoff templates for a problem.
|
protected |
A pseudo point-robot.
|
protected |
Map of robot type to set of robots.
|
protected |
Robot groups.
|
protected |
The robots in our problem.
|
protected |
Map robots to task decompositions.
|
protected |
Map task labels to tasks.
Map the tasks assigned to each robot.
|
protected |
The XML file name.