PPL API Reference
Overview Core Algorithm Abstractions Utilities Parallel Methods
Modules Class Hierarchy Classes Functions
Todo List Bug List Dead Code
List of all members
MPProblem Class Reference

Public Member Functions

Construction
 MPProblem ()
 Instantiate an empty MPProblem.
 
 MPProblem (const std::string &_filename)
 
 MPProblem (const MPProblem &_other)
 Copy.
 
 MPProblem (MPProblem &&_other)=delete
 
virtual ~MPProblem ()
 
Assignment
MPProblemoperator= (const MPProblem &_other)
 Copy.
 
MPProblemoperator= (MPProblem &&_other)=delete
 
XML File Parsing
const std::string & GetXMLFilename () const
 Get the XML filename from which this object was parsed.
 
void ReadXMLFile (const std::string &_filename)
 
Environment Accessors
EnvironmentGetEnvironment ()
 Get the environment object.
 
void SetEnvironment (std::unique_ptr< Environment > &&_e)
 
Robot Accessors
size_t NumRobots () const noexcept
 Get the number of robots in our problem.
 
RobotGetRobot (const size_t _index) const noexcept
 
RobotGetRobot (const std::string &_label) const noexcept
 
const std::vector< std::unique_ptr< Robot > > & GetRobots () const noexcept
 Get all robots in this problem.
 
const std::vector< Robot * > GetRobotsOfType (std::string _type) const noexcept
 
size_t NumRobotGroups () const noexcept
 
RobotGroupGetRobotGroup (const size_t _index) const noexcept
 
RobotGroupGetRobotGroup (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
MPTaskGetTask (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.
 
Dynamic Obstacle Accessors
const std::vector< DynamicObstacle > & GetDynamicObstacles () const noexcept
 Get all of the dynamic obstacles in this problem.
 
void AddDynamicObstacle (DynamicObstacle &&_obstacle)
 
void ClearDynamicObstacles ()
 Remove all of the dynamic obstacles in this problem.
 
Debugging
virtual void Print (std::ostream &_os) const
 
File Path Accessors
const std::string & GetBaseFilename () const
 Get the base filename for output files.
 
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.
 

Protected Attributes

Core Properties
std::unique_ptr< Environmentm_environment
 The planning environment.
 
std::vector< std::unique_ptr< Robot > > m_robots
 The robots in our problem.
 
std::vector< std::unique_ptr< RobotGroup > > m_robotGroups
 Robot groups.
 
std::unique_ptr< Robotm_pointRobot
 A pseudo point-robot.
 
std::unordered_map< std::string, std::vector< Robot * > > m_robotCapabilityMap
 Map of robot type to set of robots.
 
std::unordered_map< Robot *, Cfgm_initialCfgs
 Map of robot initial locations.
 
std::vector< DynamicObstaclem_dynamicObstacles
 The dynamic obstacles in our problem.
 
std::vector< std::unique_ptr< InteractionInformation > > m_interactionInformations
 All handoff templates for a problem.
 
std::unordered_map< Robot *, std::list< std::shared_ptr< MPTask > > > m_taskMap
 Map the tasks assigned to each robot.
 
std::unordered_map< RobotGroup *, std::list< std::shared_ptr< GroupTask > > > m_groupTaskMap
 Map the group tasks assigned to each robot group.
 
std::unordered_map< std::string, MPTask * > m_taskLabelMap
 Map task labels to tasks.
 
std::unordered_map< Robot *, std::vector< std::unique_ptr< Decomposition > > > m_taskDecompositions
 Map robots to task decompositions.
 
Files
std::string m_xmlFilename
 The XML file name.
 
std::string m_baseFilename
 The base name for output files.
 
std::string m_filePath
 The relative path for the problem XML.
 

Detailed Description

Representation of a motion planning problem, including an environment, tasks, and robots.

Constructor & Destructor Documentation

◆ MPProblem()

MPProblem::MPProblem ( const std::string &  _filename)
explicit

Instantiate an MPProblem from an XML file.

Parameters
_filenameThe name of the XML file.

Member Function Documentation

◆ ReadXMLFile()

void MPProblem::ReadXMLFile ( const std::string &  _filename)

Read an XML file.

Parameters
_filenameThe XML file name.

◆ SetEnvironment()

void MPProblem::SetEnvironment ( std::unique_ptr< Environment > &&  _e)

Set the environment object.

Parameters
_eEnvironment to set to

◆ GetRobot() [1/2]

Robot * MPProblem::GetRobot ( const size_t  _index) const
noexcept

Get a specific robot by index.

Parameters
_indexIndex of robot to get

◆ GetRobot() [2/2]

Robot * MPProblem::GetRobot ( const std::string &  _label) const
noexcept

Get a specific robot by label.

Parameters
_labelLabel of robot to get

◆ GetRobotsOfType()

const std::vector< Robot * > MPProblem::GetRobotsOfType ( std::string  _type) const
noexcept

Get all robots of a specified type.

Parameters
_typeType of robots to retrieve
Returns
List of robots of type _type

◆ NumRobotGroups()

size_t MPProblem::NumRobotGroups ( ) const
noexcept

Group versions: Get the number of robot groups in our problem.

◆ GetRobotGroup() [1/2]

RobotGroup * MPProblem::GetRobotGroup ( const size_t  _index) const
noexcept

Get a specific robot group by index.

Parameters
_indexIndex of robot group to retrieve

◆ GetRobotGroup() [2/2]

RobotGroup * MPProblem::GetRobotGroup ( const std::string &  _label) const
noexcept

Get a specific robot group by group's label.

Parameters
_labelLabel of robot group to retrieve

◆ GetRobotGroups()

const std::vector< std::unique_ptr< RobotGroup > > & MPProblem::GetRobotGroups ( ) const
noexcept

Get all robot groups in this problem.

Returns
List of robot groups

◆ GetInitialCfg()

Cfg MPProblem::GetInitialCfg ( Robot _r)

Get initial configuration of a robot

Parameters
_rRobot whose configuration to retrieve

◆ SetInitialCfg()

void MPProblem::SetInitialCfg ( Robot _r,
Cfg  _cfg 
)

Get initial configuration of a robot

Parameters
_rRobot whose configuration to retrieve
_cfgConfiguration to set for _r

◆ GetTask()

MPTask * MPProblem::GetTask ( std::string  _label)

Get task by label

Parameters
_labelLabel of task to retrieve

◆ GetTasks() [1/2]

std::vector< std::shared_ptr< MPTask > > MPProblem::GetTasks ( Robot *const  _robot) const
noexcept

Get the unfinished tasks currently assigned to a given robot.

Parameters
_robotThe robot to retrieve tasks for.
Returns
The set of tasks currently assigned to _robot.

◆ GetTasks() [2/2]

std::vector< std::shared_ptr< GroupTask > > MPProblem::GetTasks ( RobotGroup *const  _group) const
noexcept

Group overload Get the unfinished tasks currently assigned to a group of robots.

Parameters
_groupThe robot group to retrieve tasks for.
Returns
The set of group tasks currently assigned to _group.

◆ AddTask()

void MPProblem::AddTask ( std::unique_ptr< MPTask > &&  _task)

Add a task to the problem. The assigned robot will be taken from the task object.

Parameters
_taskThe new task.

◆ ReassignTask()

void MPProblem::ReassignTask ( MPTask *const  _task,
Robot *const  _newOwner 
)

Reassign a task to another robot.

Parameters
_taskThe task to reassign.
_newOwnerThe new robot assigned to _task.

◆ AddDecomposition()

void MPProblem::AddDecomposition ( Robot _coordinator,
std::unique_ptr< Decomposition > &&  _decomp 
)

Assign task decomposition to a robot

Parameters
_coordinatorRobot to assign task to
_decompThe decomposition task to assign

◆ GetDecompositions()

const std::vector< std::unique_ptr< Decomposition > > & MPProblem::GetDecompositions ( Robot _coordinator)

Get set of decomposition tasks for given robot

Parameters
_coordinatorRobot to return task decompositions for

◆ AddDynamicObstacle()

void MPProblem::AddDynamicObstacle ( DynamicObstacle &&  _obstacle)

Add dynamic obstacle to this problem

Parameters
Dynamicobstacle to add

◆ Print()

void MPProblem::Print ( std::ostream &  _os) const
virtual

Print the environment, robot, and task information.

Parameters
_osStream to print to

◆ SetBaseFilename()

void MPProblem::SetBaseFilename ( const std::string &  _s)

Set the base filename for output files.

Parameters
_sNew base filename

◆ GetPath()

string MPProblem::GetPath ( const std::string &  _filename = "")

Get the base path for input files to a file name.

Parameters
_filenameThe filename to modify.
Returns
The base path + filename, or just the path if no name is given.

◆ SetPath()

void MPProblem::SetPath ( const std::string &  _filename)

Set the base path for input files.

Parameters
_fileNameFile path to set

◆ GetInteractionInformations()

std::vector< std::unique_ptr< InteractionInformation > > & MPProblem::GetInteractionInformations ( )

Return the list of handoff templates defined in the problem

Returns
vector of handoff templates

◆ ParseChild()

void MPProblem::ParseChild ( XMLNode _node)
protected

Helper for parsing XML nodes of various types.

Parameters
_nodeThe child node to be parsed.

The documentation for this class was generated from the following files: