Qontrol
Qontrol::Task::TaskSet< output > Class Template Reference

Handle all the tasks added to the problem. More...

#include <TaskSet.hpp>

Public Member Functions

 TaskSet (std::shared_ptr< Model::GenericModel > model_library)
 
std::shared_ptr< Task::GenericTaskadd (std::string task_name, int task_dimension, double task_weight=1.0)
 Add a custom task to the task set. More...
 
template<template< Qontrol::ControlOutput output2 > class ControlInput>
std::shared_ptr< ControlInput< output > > add (std::string task_name, double task_weight=1.0)
 Add an implemented task in the task set. More...
 
bool exist (std::string task_name)
 Check if a task exists in the task set. More...
 
void getNames ()
 Get the names of all the tasks ordered in their declaration order. More...
 
void update (double dt)
 Call the update function of all the tasks in the task set. More...
 
std::vector< std::shared_ptr< Task::GenericTask > > getTasks ()
 Get all the tasks. More...
 
std::vector< double > getTasksWeight ()
 Get the relative weight of all the tasks in the task set ordered in their declaration order. More...
 
int getTaskIndex (std::string task_name)
 Get the index of a task in the task set. More...
 
void remove (std::shared_ptr< Task::GenericTask > task_ptr)
 Remove a task from the task set. More...
 
void remove (std::string task_name)
 Remove a task from the task set. More...
 
bool setTaskWeight (std::shared_ptr< Task::GenericTask > task, double task_weight)
 Set a task weight relatively to all the tasks in the task set. More...
 
bool setTaskWeight (std::string task_name, double task_weight)
 Set a task weight relatively to all the tasks in the task set. More...
 

Protected Attributes

std::shared_ptr< Model::GenericModelmodel_ptr_
 
std::vector< std::string > tasks_names_
 

Detailed Description

template<Qontrol::ControlOutput output>
class Qontrol::Task::TaskSet< output >

Handle all the tasks added to the problem.

Template Parameters
outputThe tasks control output

Member Function Documentation

◆ add() [1/2]

template<Qontrol::ControlOutput output>
template<template< Qontrol::ControlOutput output2 > class ControlInput>
std::shared_ptr<ControlInput<output> > Qontrol::Task::TaskSet< output >::add ( std::string  task_name,
double  task_weight = 1.0 
)
inline

Add an implemented task in the task set.

Template Parameters
ControlInputThe input type of the task
Parameters
task_nameThe name of the task
task_weightThe relative weight of the task
Returns
std::shared_ptr<ControlInput<output>> The pointer to the task

◆ add() [2/2]

template<Qontrol::ControlOutput output>
std::shared_ptr<Task::GenericTask> Qontrol::Task::TaskSet< output >::add ( std::string  task_name,
int  task_dimension,
double  task_weight = 1.0 
)
inline

Add a custom task to the task set.

Parameters
task_nameThe name of the task
task_dimensionThe dimension of the task
task_weightThe relative weight of the task
Returns
std::shared_ptr<Task::GenericTask> The pointer to the task

◆ exist()

template<Qontrol::ControlOutput output>
bool Qontrol::Task::TaskSet< output >::exist ( std::string  task_name)
inline

Check if a task exists in the task set.

Parameters
task_name

◆ getNames()

template<Qontrol::ControlOutput output>
void Qontrol::Task::TaskSet< output >::getNames ( )
inline

Get the names of all the tasks ordered in their declaration order.

◆ getTaskIndex()

template<Qontrol::ControlOutput output>
int Qontrol::Task::TaskSet< output >::getTaskIndex ( std::string  task_name)
inline

Get the index of a task in the task set.

Parameters
task_name
Returns
int

◆ getTasks()

template<Qontrol::ControlOutput output>
std::vector<std::shared_ptr<Task::GenericTask> > Qontrol::Task::TaskSet< output >::getTasks ( )
inline

Get all the tasks.

Returns
std::vector<std::shared_ptr<Task::GenericTask>>

◆ getTasksWeight()

template<Qontrol::ControlOutput output>
std::vector<double> Qontrol::Task::TaskSet< output >::getTasksWeight ( )
inline

Get the relative weight of all the tasks in the task set ordered in their declaration order.

Returns
std::vector<double>

◆ remove() [1/2]

template<Qontrol::ControlOutput output>
void Qontrol::Task::TaskSet< output >::remove ( std::shared_ptr< Task::GenericTask task_ptr)
inline

Remove a task from the task set.

Parameters
task_ptr

◆ remove() [2/2]

template<Qontrol::ControlOutput output>
void Qontrol::Task::TaskSet< output >::remove ( std::string  task_name)
inline

Remove a task from the task set.

Parameters
task_ptr

◆ setTaskWeight() [1/2]

template<Qontrol::ControlOutput output>
bool Qontrol::Task::TaskSet< output >::setTaskWeight ( std::shared_ptr< Task::GenericTask task,
double  task_weight 
)
inline

Set a task weight relatively to all the tasks in the task set.

Parameters
taskthe considered task
task_weightthe weight of the task

◆ setTaskWeight() [2/2]

template<Qontrol::ControlOutput output>
bool Qontrol::Task::TaskSet< output >::setTaskWeight ( std::string  task_name,
double  task_weight 
)
inline

Set a task weight relatively to all the tasks in the task set.

Parameters
taskthe considered task name
task_weightthe weight of the task

◆ update()

template<Qontrol::ControlOutput output>
void Qontrol::Task::TaskSet< output >::update ( double  dt)
inline

Call the update function of all the tasks in the task set.


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