SOLA
Loading...
Searching...
No Matches
Classes | Public Types | Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
daisi::cpps::logical::StnTaskManagement Class Reference
Inheritance diagram for daisi::cpps::logical::StnTaskManagement:
daisi::cpps::logical::AuctionBasedTaskManagement daisi::datastructure::SimpleTemporalNetwork< StnTaskManagementVertex, StnTaskManagementEdge > daisi::cpps::logical::TaskManagement

Classes

struct  StnInsertionPoint
 
struct  TaskInsertInfo
 contains a task, the end locations, and metrics compositions for the single orders More...
 

Public Types

using VertexIterator = std::vector< StnTaskManagementVertex >::iterator
 

Public Member Functions

 StnTaskManagement (const AmrDescription &amr_description, const Topology &topology, const daisi::util::Pose &pose)
 
bool hasTasks () const override
 check wether the task management has a current task assigned
 
daisi::material_flow::Task getCurrentTask () const override
 get the current task
 
bool setNextTask () override
 set the current task to the first task that is currently queued
 
bool canAddTask (const daisi::material_flow::Task &task, std::shared_ptr< InsertionPoint > insertion_point=nullptr) override
 check wether a new task can be assigned to the management
 
bool addTask (const daisi::material_flow::Task &task, std::shared_ptr< InsertionPoint > insertion_point=nullptr) override
 assign a new task to the management
 
std::pair< MetricsComposition, std::shared_ptr< InsertionPoint > > getLatestCalculatedInsertionInfo () const override
 get infos about the latest task insertion (also includes the check wether a task can be inserted)
 
void setCurrentTime (const daisi::util::Duration &now)
 set the management's current time
 
- Public Member Functions inherited from daisi::cpps::logical::AuctionBasedTaskManagement
 AuctionBasedTaskManagement (const AmrDescription &amr_description, const Topology &topology, const daisi::util::Pose &pose)
 
bool addTask (const daisi::material_flow::Task &task) final
 insert a task into the management's queue.
 
bool canAddTask (const daisi::material_flow::Task &task) final
 check wether a new task can be added to the management's queue
 
- Public Member Functions inherited from daisi::cpps::logical::TaskManagement
 TaskManagement (AmrDescription amr_description, Topology topology, const daisi::util::Pose &pose)
 
void addNotifyTaskAssignmentCallback (std::function< void(void)> callback)
 
void clearNotifyTaskAssignmentCallback ()
 

Protected Member Functions

bool solve () override
 
void addPrecedenceConstraintBetweenTask (const StnTaskManagementVertex &start_vertex, const std::string &precedence_task_name)
 
void addDurationConstraints (const StnTaskManagementVertex &start_vertex, const StnTaskManagementVertex &finish_vertex, const daisi::material_flow::Order &order, const TaskInsertInfo &task_insert_info)
 
void updateGetToStartDurationConstraint (int task_index_to_update)
 
util::Duration calcGetToStartDuration (int task_index_to_update)
 
void addOrderingConstraintBetweenTasks (StnInsertionPoint insertion_point, TaskInsertInfo &task_insert_info)
 
std::optional< std::pair< MetricsComposition, std::shared_ptr< StnInsertionPoint > > > addBestOrdering (StnTaskManagement::TaskInsertInfo &task_insert_info)
 
std::vector< StnInsertionPointcalcInsertionPoints ()
 
void updateCurrentOrdering ()
 update the metrics compositions of all currently queued tasks as well as the total metrics. sort the current ordering by start time. method is called after inserting a new task.
 
daisi::util::Position getLastPositionBefore (int task_index)
 
daisi::util::Duration calcOrderDurationForInsert (const daisi::material_flow::Order &order, const TaskInsertInfo &task_insert_info) const
 
void insertOrderPropertiesIntoMetrics (const daisi::material_flow::Order &order, Metrics &metrics, const TaskInsertInfo &task_insert_info, int task_ordering_index)
 calculate the metrics for the given order of the given task and insert them into the given metrics.
 
VertexIterator getVertexIteratorOfOrder (const daisi::material_flow::Order &order, bool start)
 
int getVertexIndexOfOrder (const daisi::material_flow::Order &order, bool start)
 
const StnTaskManagementVertexgetVertexOfOrder (const daisi::material_flow::Order &order, bool start)
 

Protected Attributes

std::optional< daisi::material_flow::Taskcurrent_task_
 
std::optional< daisi::material_flow::Locationcurrent_task_end_location_
 
daisi::util::Duration current_task_expected_finish_time_ = 0.0
 
std::vector< TaskInsertInfocurrent_ordering_
 
Metrics current_total_metrics_
 
std::vector< TaskInsertInfo >::iterator newest_task_insert_info_
 
daisi::util::Duration time_now_ = 0
 
std::optional< std::pair< MetricsComposition, std::shared_ptr< InsertionPoint > > > latest_calculated_insertion_info_
 
- Protected Attributes inherited from daisi::cpps::logical::TaskManagement
std::vector< std::function< void(void)> > task_assignment_callbacks_
 
AmrDescription amr_description_
 
Topology topology_
 
daisi::util::Pose current_pose_
 

Member Function Documentation

◆ addTask()

bool daisi::cpps::logical::StnTaskManagement::addTask ( const daisi::material_flow::Task task,
std::shared_ptr< InsertionPoint insertion_point = nullptr 
)
overridevirtual

assign a new task to the management

Parameters
taskthe task to be assigned
insertion_pointthe position in the managements queue where the task should be inserted
Returns
true if the insertion was successful

Implements daisi::cpps::logical::AuctionBasedTaskManagement.

◆ canAddTask()

bool daisi::cpps::logical::StnTaskManagement::canAddTask ( const daisi::material_flow::Task task,
std::shared_ptr< InsertionPoint insertion_point = nullptr 
)
overridevirtual

check wether a new task can be assigned to the management

Parameters
taskthe task to be assigned
insertion_pointthe position in the managements queue where the task should be inserted
Returns
true if the assignment can be made

Implements daisi::cpps::logical::AuctionBasedTaskManagement.

◆ getCurrentTask()

Task daisi::cpps::logical::StnTaskManagement::getCurrentTask ( ) const
overridevirtual

get the current task

Implements daisi::cpps::logical::TaskManagement.

◆ getLatestCalculatedInsertionInfo()

std::pair< MetricsComposition, std::shared_ptr< AuctionBasedTaskManagement::InsertionPoint > > daisi::cpps::logical::StnTaskManagement::getLatestCalculatedInsertionInfo ( ) const
overridevirtual

get infos about the latest task insertion (also includes the check wether a task can be inserted)

Returns
the MetricsComposition and InsertionPoint of the latest task insertion

Implements daisi::cpps::logical::AuctionBasedTaskManagement.

◆ hasTasks()

bool daisi::cpps::logical::StnTaskManagement::hasTasks ( ) const
overridevirtual

check wether the task management has a current task assigned

Implements daisi::cpps::logical::TaskManagement.

◆ insertOrderPropertiesIntoMetrics()

void daisi::cpps::logical::StnTaskManagement::insertOrderPropertiesIntoMetrics ( const daisi::material_flow::Order &  order,
Metrics metrics,
const TaskInsertInfo task_insert_info,
int  task_ordering_index 
)
protected

calculate the metrics for the given order of the given task and insert them into the given metrics.

Parameters
orderthe order the metrics should be calculated for
metricsthe container to insert the metrics
task_insert_infothe TaskInsertInfo for the passed order
task_ordering_indexthe current ordering index for the task
absolute_start_timethe absolute start time of the order

◆ setCurrentTime()

void daisi::cpps::logical::StnTaskManagement::setCurrentTime ( const daisi::util::Duration &  now)

set the management's current time

Parameters
now

◆ setNextTask()

bool daisi::cpps::logical::StnTaskManagement::setNextTask ( )
overridevirtual

set the current task to the first task that is currently queued

Returns
true if the assignment was successful

Implements daisi::cpps::logical::TaskManagement.

◆ solve()

bool daisi::cpps::logical::StnTaskManagement::solve ( )
overrideprotectedvirtual

Member Data Documentation

◆ current_task_

std::optional<daisi::material_flow::Task> daisi::cpps::logical::StnTaskManagement::current_task_
protected

the current task was previously at the first position of the current ordering however to not get confused with insertion, the current task is kept separate from the ordering vector


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