diff --git a/daisi/src/cpps/logical/CMakeLists.txt b/daisi/src/cpps/logical/CMakeLists.txt index 87a1fc4e..f32828f8 100644 --- a/daisi/src/cpps/logical/CMakeLists.txt +++ b/daisi/src/cpps/logical/CMakeLists.txt @@ -2,7 +2,7 @@ add_subdirectory(algorithms) add_subdirectory(amr) add_subdirectory(material_flow) add_subdirectory(message) -add_subdirectory(order_management) +add_subdirectory(task_management) add_library(daisi_cpps_logical_logical_agent STATIC) target_sources(daisi_cpps_logical_logical_agent diff --git a/daisi/src/cpps/logical/algorithms/assignment/CMakeLists.txt b/daisi/src/cpps/logical/algorithms/assignment/CMakeLists.txt index 13359f41..6f7e5efe 100644 --- a/daisi/src/cpps/logical/algorithms/assignment/CMakeLists.txt +++ b/daisi/src/cpps/logical/algorithms/assignment/CMakeLists.txt @@ -48,7 +48,7 @@ target_sources(daisi_cpps_logical_algorithms_assignment_iterated_auction_assignm target_link_libraries(daisi_cpps_logical_algorithms_assignment_iterated_auction_assignment_participant PUBLIC daisi_cpps_logical_algorithms_assignment_assignment_participant - daisi_cpps_logical_order_management_auction_based_order_management + daisi_cpps_logical_task_management_auction_based_task_management daisi_cpps_logical_algorithms_assignment_auction_participant_state daisi_cpps_common_cpps_communicator ) @@ -88,7 +88,7 @@ target_sources(daisi_cpps_logical_algorithms_assignment_auction_participant_stat target_link_libraries(daisi_cpps_logical_algorithms_assignment_auction_participant_state PUBLIC daisi_material_flow_model_material_flow - daisi_cpps_logical_order_management_auction_based_order_management + daisi_cpps_logical_task_management_auction_based_task_management ) add_library(daisi_cpps_logical_algorithms_assignment_centralized_initiator STATIC) diff --git a/daisi/src/cpps/logical/algorithms/assignment/auction_participant_state.h b/daisi/src/cpps/logical/algorithms/assignment/auction_participant_state.h index aaeb5ced..11a1e4c2 100644 --- a/daisi/src/cpps/logical/algorithms/assignment/auction_participant_state.h +++ b/daisi/src/cpps/logical/algorithms/assignment/auction_participant_state.h @@ -22,7 +22,7 @@ #include "cpps/logical/message/auction_based/bid_submission.h" #include "cpps/logical/message/auction_based/winner_response.h" -#include "cpps/logical/order_management/auction_based_order_management.h" +#include "cpps/logical/task_management/auction_based_task_management.h" #include "material_flow/model/task.h" namespace daisi::cpps::logical { diff --git a/daisi/src/cpps/logical/algorithms/assignment/centralized_participant.cpp b/daisi/src/cpps/logical/algorithms/assignment/centralized_participant.cpp index 5e053628..137770a2 100644 --- a/daisi/src/cpps/logical/algorithms/assignment/centralized_participant.cpp +++ b/daisi/src/cpps/logical/algorithms/assignment/centralized_participant.cpp @@ -20,20 +20,20 @@ namespace daisi::cpps::logical { CentralizedParticipant::CentralizedParticipant( daisi::cpps::common::CppsCommunicatorPtr communicator, - std::shared_ptr order_management) - : AssignmentParticipant(communicator), order_management_(std::move((order_management))){}; + std::shared_ptr task_management) + : AssignmentParticipant(communicator), task_management_(std::move((task_management))){}; bool CentralizedParticipant::process(const AssignmentNotification &assignment_notification) { const material_flow::Task assigned_task = assignment_notification.getTask(); - if (order_management_->canAddTask(assigned_task)) { - order_management_->addTask(assigned_task); + if (task_management_->canAddTask(assigned_task)) { + task_management_->addTask(assigned_task); } else { - throw std::runtime_error("The order management should always accept the assigned task."); + throw std::runtime_error("The task management should always accept the assigned task."); } // Respond to the central allocator. Send the acception / rejection as well as the current status. - AssignmentResponse response(assigned_task.getUuid(), true, order_management_->getFinalMetrics(), - order_management_->getExpectedEndPosition(), + AssignmentResponse response(assigned_task.getUuid(), true, task_management_->getFinalMetrics(), + task_management_->getExpectedEndPosition(), communicator_->network.getConnectionString()); std::string initiator_connection = assignment_notification.getInitiatorConnection(); @@ -43,8 +43,8 @@ bool CentralizedParticipant::process(const AssignmentNotification &assignment_no bool CentralizedParticipant::process(const StatusUpdateRequest &status_request) { StatusUpdate update(communicator_->network.getConnectionString(), - order_management_->getFinalMetrics(), - order_management_->getExpectedEndPosition()); + task_management_->getFinalMetrics(), + task_management_->getExpectedEndPosition()); std::string initiator_connection = status_request.getInitiatorConnection(); communicator_->network.send({initiator_connection, serialize(update)}); diff --git a/daisi/src/cpps/logical/algorithms/assignment/centralized_participant.h b/daisi/src/cpps/logical/algorithms/assignment/centralized_participant.h index 321052bf..0e23d05b 100644 --- a/daisi/src/cpps/logical/algorithms/assignment/centralized_participant.h +++ b/daisi/src/cpps/logical/algorithms/assignment/centralized_participant.h @@ -19,7 +19,7 @@ #include "assignment_participant.h" #include "cpps/common/cpps_communicator.h" -#include "cpps/logical/order_management/simple_order_management.h" +#include "cpps/logical/task_management/simple_task_management.h" namespace daisi::cpps::logical { @@ -28,7 +28,7 @@ namespace daisi::cpps::logical { class CentralizedParticipant : public AssignmentParticipant { public: CentralizedParticipant(daisi::cpps::common::CppsCommunicatorPtr communicator, - std::shared_ptr order_management); + std::shared_ptr task_management); ~CentralizedParticipant() override = default; /// @brief React on new task assignment and respond to it. @@ -38,8 +38,8 @@ class CentralizedParticipant : public AssignmentParticipant { REGISTER_IMPLEMENTATION(StatusUpdateRequest) private: - /// @brief the AMR's order management. Simply accepts a new task assignment. - std::shared_ptr order_management_; + /// @brief the AMR's task management. Simply accepts a new task assignment. + std::shared_ptr task_management_; }; } // namespace daisi::cpps::logical diff --git a/daisi/src/cpps/logical/algorithms/assignment/iterated_auction_assignment_participant.cpp b/daisi/src/cpps/logical/algorithms/assignment/iterated_auction_assignment_participant.cpp index 33e2b173..53af4b58 100644 --- a/daisi/src/cpps/logical/algorithms/assignment/iterated_auction_assignment_participant.cpp +++ b/daisi/src/cpps/logical/algorithms/assignment/iterated_auction_assignment_participant.cpp @@ -23,9 +23,9 @@ namespace daisi::cpps::logical { IteratedAuctionAssignmentParticipant::IteratedAuctionAssignmentParticipant( daisi::cpps::common::CppsCommunicatorPtr communicator, - std::shared_ptr order_management, AmrDescription description) + std::shared_ptr task_management, AmrDescription description) : AssignmentParticipant(communicator), - order_management_(std::move(order_management)), + task_management_(std::move(task_management)), description_(std::move(description)) { auto topic = AmrFleet::get().getTopicForAbility(description_.getLoadHandling().getAbility()); communicator_->sola.subscribeTopic(topic); @@ -94,8 +94,8 @@ bool IteratedAuctionAssignmentParticipant::process(const WinnerNotification &win bool accept = false; if (task_state.isValid() && - order_management_->canAddTask(task_state.getTask(), task_state.getInsertionPoint())) { - auto result = order_management_->getLatestCalculatedInsertionInfo(); + task_management_->canAddTask(task_state.getTask(), task_state.getInsertionPoint())) { + auto result = task_management_->getLatestCalculatedInsertionInfo(); auto metrics_comp = result.first; if (metrics_comp == task_state.getMetricsComposition()) { @@ -105,7 +105,7 @@ bool IteratedAuctionAssignmentParticipant::process(const WinnerNotification &win std::string participant_connection = communicator_->network.getConnectionString(); if (accept) { - bool success = order_management_->addTask(task_state.getTask(), task_state.getInsertionPoint()); + bool success = task_management_->addTask(task_state.getTask(), task_state.getInsertionPoint()); if (!success) { throw std::runtime_error("Winner accepts, but cannot add the task."); @@ -134,9 +134,9 @@ void IteratedAuctionAssignmentParticipant::calculateBids(AuctionParticipantState for (auto &pair : state.task_state_mapping) { // Iterating through each task state of this auction process - if (order_management_->canAddTask(pair.second.getTask(), nullptr)) { + if (task_management_->canAddTask(pair.second.getTask(), nullptr)) { // Setting new calculated information if we can add the task - auto result = order_management_->getLatestCalculatedInsertionInfo(); + auto result = task_management_->getLatestCalculatedInsertionInfo(); pair.second.setInformation(result.first, result.second); } else { // Setting previous information to invalid because we cannot accept anymore diff --git a/daisi/src/cpps/logical/algorithms/assignment/iterated_auction_assignment_participant.h b/daisi/src/cpps/logical/algorithms/assignment/iterated_auction_assignment_participant.h index d6b352ef..163691c8 100644 --- a/daisi/src/cpps/logical/algorithms/assignment/iterated_auction_assignment_participant.h +++ b/daisi/src/cpps/logical/algorithms/assignment/iterated_auction_assignment_participant.h @@ -23,7 +23,7 @@ #include "assignment_participant.h" #include "auction_participant_state.h" #include "cpps/common/cpps_communicator.h" -#include "cpps/logical/order_management/auction_based_order_management.h" +#include "cpps/logical/task_management/auction_based_task_management.h" namespace daisi::cpps::logical { @@ -38,7 +38,7 @@ class IteratedAuctionAssignmentParticipant : public AssignmentParticipant { public: explicit IteratedAuctionAssignmentParticipant( daisi::cpps::common::CppsCommunicatorPtr communicator, - std::shared_ptr order_management, AmrDescription description); + std::shared_ptr task_management, AmrDescription description); ~IteratedAuctionAssignmentParticipant() override = default; @@ -53,7 +53,7 @@ class IteratedAuctionAssignmentParticipant : public AssignmentParticipant { REGISTER_IMPLEMENTATION(IterationNotification) /// @brief A WinnerNotification means that a task was assigned to us. First, we need to check - /// whether we can still accept the task. If yes, we add the task to the order management and send + /// whether we can still accept the task. If yes, we add the task to the task management and send /// an acceptance WinnerResponse back to the initiator. Otherwise, we must reject. REGISTER_IMPLEMENTATION(WinnerNotification) @@ -63,9 +63,9 @@ class IteratedAuctionAssignmentParticipant : public AssignmentParticipant { /// tasks for each auction process, as well as previously calculated bids and insertion infos. std::unordered_map initiator_auction_state_mapping_; - /// @brief Pointer to the order management of the corresponding AmrLogicalAgent. + /// @brief Pointer to the task management of the corresponding AmrLogicalAgent. /// We need access to calculate bids and add tasks after receiving WinnerNotifications. - std::shared_ptr order_management_; + std::shared_ptr task_management_; /// @brief Calculating bids for each open task in a state. /// @param state Relevant auction state. diff --git a/daisi/src/cpps/logical/amr/CMakeLists.txt b/daisi/src/cpps/logical/amr/CMakeLists.txt index 884be7de..ee0d6c7b 100644 --- a/daisi/src/cpps/logical/amr/CMakeLists.txt +++ b/daisi/src/cpps/logical/amr/CMakeLists.txt @@ -13,9 +13,9 @@ target_link_libraries(daisi_cpps_logical_amr_amr_logical_agent daisi_cpps_amr_message_serializer ns3::libcore daisi_cpps_amr_physical_material_flow_functionality_mapping - daisi_cpps_logical_order_management_order_management - daisi_cpps_logical_order_management_stn_order_management - daisi_cpps_logical_order_management_simple_order_management + daisi_cpps_logical_task_management_task_management + daisi_cpps_logical_task_management_stn_task_management + daisi_cpps_logical_task_management_simple_task_management daisi_utils NetworkUDPMessage PRIVATE diff --git a/daisi/src/cpps/logical/amr/amr_logical_agent.cpp b/daisi/src/cpps/logical/amr/amr_logical_agent.cpp index 5204e1c1..400ac529 100644 --- a/daisi/src/cpps/logical/amr/amr_logical_agent.cpp +++ b/daisi/src/cpps/logical/amr/amr_logical_agent.cpp @@ -20,8 +20,8 @@ #include "cpps/logical/algorithms/assignment/centralized_participant.h" #include "cpps/logical/algorithms/assignment/iterated_auction_assignment_participant.h" #include "cpps/logical/message/material_flow_update.h" -#include "cpps/logical/order_management/simple_order_management.h" -#include "cpps/logical/order_management/stn_order_management.h" +#include "cpps/logical/task_management/simple_task_management.h" +#include "cpps/logical/task_management/stn_task_management.h" #include "cpps/packet.h" #include "logging/logger_manager.h" #include "solanet/uuid_generator.h" @@ -54,28 +54,26 @@ void AmrLogicalAgent::initAlgorithms() { for (const auto &algo_type : algorithm_config_.algorithm_types) { switch (algo_type) { case AlgorithmType::kIteratedAuctionAssignmentParticipant: { - auto stn_order_management = std::make_shared( + auto stn_task_management = std::make_shared( description_, topology_, daisi::util::Pose{execution_state_.getPosition()}); - order_management_ = stn_order_management; + task_management_ = stn_task_management; algorithms_.push_back(std::make_unique( - communicator_, stn_order_management, description_)); + communicator_, stn_task_management, description_)); - order_management_->addNotifyTaskAssignmentCallback( - [this]() { this->notifyTaskAssigned(); }); + task_management_->addNotifyTaskAssignmentCallback([this]() { this->notifyTaskAssigned(); }); break; } case AlgorithmType::kRoundRobinParticipant: { - auto simple_order_management = std::make_shared( + auto simple_task_management = std::make_shared( description_, topology_, daisi::util::Pose{execution_state_.getPosition()}); - order_management_ = simple_order_management; + task_management_ = simple_task_management; algorithms_.push_back( - std::make_unique(communicator_, simple_order_management)); + std::make_unique(communicator_, simple_task_management)); - order_management_->addNotifyTaskAssignmentCallback( - [this]() { this->notifyTaskAssigned(); }); + task_management_->addNotifyTaskAssignmentCallback([this]() { this->notifyTaskAssigned(); }); break; } @@ -144,9 +142,9 @@ void AmrLogicalAgent::processMessageAmrOrderUpdate(const AmrOrderUpdate &order_u } void AmrLogicalAgent::sendTaskToPhysical() { - order_management_->setNextTask(); - if (order_management_->hasTasks()) { - material_flow::Task task = order_management_->getCurrentTask(); + task_management_->setNextTask(); + if (task_management_->hasTasks()) { + material_flow::Task task = task_management_->getCurrentTask(); execution_state_.setNextTask(task); AmrOrderInfo amr_order_info( @@ -160,7 +158,7 @@ void AmrLogicalAgent::sendTaskToPhysical() { void AmrLogicalAgent::checkSendingNextTaskToPhysical() { if (execution_state_.shouldSendNextTaskToPhysical()) { - if (order_management_) { + if (task_management_) { sendTaskToPhysical(); } } diff --git a/daisi/src/cpps/logical/amr/amr_logical_agent.h b/daisi/src/cpps/logical/amr/amr_logical_agent.h index c37216c2..34d58573 100644 --- a/daisi/src/cpps/logical/amr/amr_logical_agent.h +++ b/daisi/src/cpps/logical/amr/amr_logical_agent.h @@ -26,7 +26,7 @@ #include "cpps/amr/message/amr_state.h" #include "cpps/amr/message/serializer.h" #include "cpps/logical/logical_agent.h" -#include "cpps/logical/order_management/order_management.h" +#include "cpps/logical/task_management/task_management.h" #include "ns3/socket.h" #include "solanet/network_udp/message.h" #include "utils/structure_helpers.h" @@ -110,7 +110,7 @@ class AmrLogicalAgent : public LogicalAgent { /// @brief The address of the AmrPhysicalAsset after it connected to AmrLogicalAgent. ns3::Address physical_address_; - std::shared_ptr order_management_; + std::shared_ptr task_management_; }; } // namespace daisi::cpps::logical diff --git a/daisi/src/cpps/logical/message/auction_based/bid_submission.h b/daisi/src/cpps/logical/message/auction_based/bid_submission.h index 15199015..2229ff8f 100644 --- a/daisi/src/cpps/logical/message/auction_based/bid_submission.h +++ b/daisi/src/cpps/logical/message/auction_based/bid_submission.h @@ -18,7 +18,7 @@ #define DAISI_CPPS_LOGICAL_MESSAGE_AUCTION_BASED_BID_SUBMISSION_H_ #include "cpps/amr/model/amr_static_ability.h" -#include "cpps/logical/order_management/metrics_composition.h" +#include "cpps/logical/task_management/metrics_composition.h" #include "solanet/serializer/serialize.h" namespace daisi::cpps::logical { diff --git a/daisi/src/cpps/logical/message/central_allocation/CMakeLists.txt b/daisi/src/cpps/logical/message/central_allocation/CMakeLists.txt index 9477fe3d..b57787d0 100644 --- a/daisi/src/cpps/logical/message/central_allocation/CMakeLists.txt +++ b/daisi/src/cpps/logical/message/central_allocation/CMakeLists.txt @@ -17,7 +17,7 @@ target_sources(daisi_cpps_logical_message_central_allocation_assignment_response target_link_libraries(daisi_cpps_logical_message_central_allocation_assignment_response INTERFACE solanet_serializer - daisi_cpps_logical_order_management_metrics_composition + daisi_cpps_logical_task_management_metrics_composition daisi_structure_helpers ) @@ -39,6 +39,6 @@ target_sources(daisi_cpps_logical_message_central_allocation_status_update target_link_libraries(daisi_cpps_logical_message_central_allocation_status_update INTERFACE solanet_serializer - daisi_cpps_logical_order_management_metrics_composition + daisi_cpps_logical_task_management_metrics_composition daisi_structure_helpers ) diff --git a/daisi/src/cpps/logical/message/central_allocation/assignment_response.h b/daisi/src/cpps/logical/message/central_allocation/assignment_response.h index d227975e..37ac0077 100644 --- a/daisi/src/cpps/logical/message/central_allocation/assignment_response.h +++ b/daisi/src/cpps/logical/message/central_allocation/assignment_response.h @@ -18,7 +18,7 @@ #define DAISI_CPPS_LOGICAL_MESSAGE_CENTRAL_ALLOCATION_ASSIGNMENT_RESPONSE_H_ #include "cpps/amr/model/amr_static_ability.h" -#include "cpps/logical/order_management/metrics_composition.h" +#include "cpps/logical/task_management/metrics_composition.h" #include "solanet/serializer/serialize.h" namespace daisi::cpps::logical { diff --git a/daisi/src/cpps/logical/message/central_allocation/status_update.h b/daisi/src/cpps/logical/message/central_allocation/status_update.h index 82a46ab1..6bdf1a28 100644 --- a/daisi/src/cpps/logical/message/central_allocation/status_update.h +++ b/daisi/src/cpps/logical/message/central_allocation/status_update.h @@ -18,7 +18,7 @@ #define DAISI_CPPS_LOGICAL_MESSAGE_CENTRAL_ALLOCATION_STATUS_UPDATE_H_ #include "cpps/amr/model/amr_static_ability.h" -#include "cpps/logical/order_management/metrics_composition.h" +#include "cpps/logical/task_management/metrics_composition.h" #include "solanet/serializer/serialize.h" #include "utils/structure_helpers.h" diff --git a/daisi/src/cpps/logical/order_management/CMakeLists.txt b/daisi/src/cpps/logical/order_management/CMakeLists.txt deleted file mode 100644 index f5005cf9..00000000 --- a/daisi/src/cpps/logical/order_management/CMakeLists.txt +++ /dev/null @@ -1,78 +0,0 @@ -add_library(daisi_cpps_logical_order_management_order_management_helper STATIC) -target_sources(daisi_cpps_logical_order_management_order_management_helper - PRIVATE - order_management_helper.h - order_management_helper.cpp -) -target_link_libraries(daisi_cpps_logical_order_management_order_management_helper - daisi_material_flow_model_task -) - -add_library(daisi_cpps_logical_order_management_order_management INTERFACE) -target_sources(daisi_cpps_logical_order_management_order_management - INTERFACE - order_management.h -) -target_link_libraries(daisi_cpps_logical_order_management_order_management - INTERFACE - daisi_material_flow_model_task - daisi_cpps_amr_amr_description - daisi_cpps_logical_order_management_order_management_helper -) - -add_library(daisi_cpps_logical_order_management_metrics_composition STATIC) -target_sources(daisi_cpps_logical_order_management_metrics_composition - PRIVATE - metrics.h - metrics.cpp - metrics_composition.h -) -target_link_libraries(daisi_cpps_logical_order_management_metrics_composition - PUBLIC - daisi_structure_helpers - solanet_serialize -) - -add_library(daisi_cpps_logical_order_management_auction_based_order_management INTERFACE) -target_sources(daisi_cpps_logical_order_management_auction_based_order_management - INTERFACE - order_management.h -) -target_link_libraries(daisi_cpps_logical_order_management_auction_based_order_management - INTERFACE - daisi_cpps_logical_order_management_order_management - daisi_cpps_logical_order_management_metrics_composition -) - -add_library(daisi_cpps_logical_order_management_stn_order_management STATIC) -target_sources(daisi_cpps_logical_order_management_stn_order_management - PRIVATE - stn_order_management.h - stn_order_management.cpp - stn_order_management_components.h - stn_order_management_components.cpp -) -target_link_libraries(daisi_cpps_logical_order_management_stn_order_management - PUBLIC - daisi_cpps_logical_order_management_auction_based_order_management - daisi_datastructure_simple_temporal_network - daisi_cpps_amr_amr_mobility_helper -) -add_library(daisi_cpps_logical_order_management_simple_order_management STATIC) -target_sources(daisi_cpps_logical_order_management_simple_order_management - PRIVATE - simple_order_management.h - simple_order_management.cpp -) -target_link_libraries(daisi_cpps_logical_order_management_simple_order_management - PUBLIC - daisi_cpps_logical_order_management_order_management - daisi_cpps_logical_order_management_metrics_composition - daisi_cpps_amr_amr_mobility_helper - ns3::libcore - solanet_serialize -) -target_include_directories(daisi_cpps_logical_order_management_simple_order_management - PUBLIC - ${DAISI_SOURCE_DIR}/src -) diff --git a/daisi/src/cpps/logical/task_management/CMakeLists.txt b/daisi/src/cpps/logical/task_management/CMakeLists.txt new file mode 100644 index 00000000..e5b634c6 --- /dev/null +++ b/daisi/src/cpps/logical/task_management/CMakeLists.txt @@ -0,0 +1,78 @@ +add_library(daisi_cpps_logical_task_management_task_management_helper STATIC) +target_sources(daisi_cpps_logical_task_management_task_management_helper + PRIVATE + task_management_helper.h + task_management_helper.cpp +) +target_link_libraries(daisi_cpps_logical_task_management_task_management_helper + daisi_material_flow_model_task +) + +add_library(daisi_cpps_logical_task_management_task_management INTERFACE) +target_sources(daisi_cpps_logical_task_management_task_management + INTERFACE + task_management.h +) +target_link_libraries(daisi_cpps_logical_task_management_task_management + INTERFACE + daisi_material_flow_model_task + daisi_cpps_amr_amr_description + daisi_cpps_logical_task_management_task_management_helper +) + +add_library(daisi_cpps_logical_task_management_metrics_composition STATIC) +target_sources(daisi_cpps_logical_task_management_metrics_composition + PRIVATE + metrics.h + metrics.cpp + metrics_composition.h +) +target_link_libraries(daisi_cpps_logical_task_management_metrics_composition + PUBLIC + daisi_structure_helpers + solanet_serialize +) + +add_library(daisi_cpps_logical_task_management_auction_based_task_management INTERFACE) +target_sources(daisi_cpps_logical_task_management_auction_based_task_management + INTERFACE + task_management.h +) +target_link_libraries(daisi_cpps_logical_task_management_auction_based_task_management + INTERFACE + daisi_cpps_logical_task_management_task_management + daisi_cpps_logical_task_management_metrics_composition +) + +add_library(daisi_cpps_logical_task_management_stn_task_management STATIC) +target_sources(daisi_cpps_logical_task_management_stn_task_management + PRIVATE + stn_task_management.h + stn_task_management.cpp + stn_task_management_components.h + stn_task_management_components.cpp +) +target_link_libraries(daisi_cpps_logical_task_management_stn_task_management + PUBLIC + daisi_cpps_logical_task_management_auction_based_task_management + daisi_datastructure_simple_temporal_network + daisi_cpps_amr_amr_mobility_helper +) +add_library(daisi_cpps_logical_task_management_simple_task_management STATIC) +target_sources(daisi_cpps_logical_task_management_simple_task_management + PRIVATE + simple_task_management.h + simple_task_management.cpp +) +target_link_libraries(daisi_cpps_logical_task_management_simple_task_management + PUBLIC + daisi_cpps_logical_task_management_task_management + daisi_cpps_logical_task_management_metrics_composition + daisi_cpps_amr_amr_mobility_helper + ns3::libcore + solanet_serialize +) +target_include_directories(daisi_cpps_logical_task_management_simple_task_management + PUBLIC + ${DAISI_SOURCE_DIR}/src +) diff --git a/daisi/src/cpps/logical/order_management/auction_based_order_management.h b/daisi/src/cpps/logical/task_management/auction_based_task_management.h similarity index 90% rename from daisi/src/cpps/logical/order_management/auction_based_order_management.h rename to daisi/src/cpps/logical/task_management/auction_based_task_management.h index 3c975d65..8ac453a9 100644 --- a/daisi/src/cpps/logical/order_management/auction_based_order_management.h +++ b/daisi/src/cpps/logical/task_management/auction_based_task_management.h @@ -14,11 +14,11 @@ // // SPDX-License-Identifier: GPL-2.0-only -#ifndef DAISI_CPPS_LOGICAL_ORDER_MANAGEMENT_AUCTION_BASED_ORDER_MANAGEMENT_H_ -#define DAISI_CPPS_LOGICAL_ORDER_MANAGEMENT_AUCTION_BASED_ORDER_MANAGEMENT_H_ +#ifndef DAISI_CPPS_LOGICAL_TASK_MANAGEMENT_AUCTION_BASED_TASK_MANAGEMENT_H_ +#define DAISI_CPPS_LOGICAL_TASK_MANAGEMENT_AUCTION_BASED_TASK_MANAGEMENT_H_ #include "metrics_composition.h" -#include "order_management.h" +#include "task_management.h" namespace daisi::cpps::logical { diff --git a/daisi/src/cpps/logical/order_management/metrics.cpp b/daisi/src/cpps/logical/task_management/metrics.cpp similarity index 100% rename from daisi/src/cpps/logical/order_management/metrics.cpp rename to daisi/src/cpps/logical/task_management/metrics.cpp diff --git a/daisi/src/cpps/logical/order_management/metrics.h b/daisi/src/cpps/logical/task_management/metrics.h similarity index 96% rename from daisi/src/cpps/logical/order_management/metrics.h rename to daisi/src/cpps/logical/task_management/metrics.h index 62fd352b..18c60ddd 100644 --- a/daisi/src/cpps/logical/order_management/metrics.h +++ b/daisi/src/cpps/logical/task_management/metrics.h @@ -14,8 +14,8 @@ // // SPDX-License-Identifier: GPL-2.0-only -#ifndef DAISI_CPPS_LOGICAL_ORDER_MANAGEMENT_METRICS_H_ -#define DAISI_CPPS_LOGICAL_ORDER_MANAGEMENT_METRICS_H_ +#ifndef DAISI_CPPS_LOGICAL_TASK_MANAGEMENT_METRICS_H_ +#define DAISI_CPPS_LOGICAL_TASK_MANAGEMENT_METRICS_H_ #include #include diff --git a/daisi/src/cpps/logical/order_management/metrics_composition.h b/daisi/src/cpps/logical/task_management/metrics_composition.h similarity index 96% rename from daisi/src/cpps/logical/order_management/metrics_composition.h rename to daisi/src/cpps/logical/task_management/metrics_composition.h index 9a10d658..a2c646ff 100644 --- a/daisi/src/cpps/logical/order_management/metrics_composition.h +++ b/daisi/src/cpps/logical/task_management/metrics_composition.h @@ -14,8 +14,8 @@ // // SPDX-License-Identifier: GPL-2.0-only -#ifndef DAISI_CPPS_LOGICAL_ORDER_MANAGEMENT_METRICS_COMPOSITION_H_ -#define DAISI_CPPS_LOGICAL_ORDER_MANAGEMENT_METRICS_COMPOSITION_H_ +#ifndef DAISI_CPPS_LOGICAL_TASK_MANAGEMENT_METRICS_COMPOSITION_H_ +#define DAISI_CPPS_LOGICAL_TASK_MANAGEMENT_METRICS_COMPOSITION_H_ #include "metrics.h" #include "solanet/serializer/serialize.h" diff --git a/daisi/src/cpps/logical/order_management/simple_order_management.cpp b/daisi/src/cpps/logical/task_management/simple_task_management.cpp similarity index 99% rename from daisi/src/cpps/logical/order_management/simple_order_management.cpp rename to daisi/src/cpps/logical/task_management/simple_task_management.cpp index 37bbd2ed..2553d490 100644 --- a/daisi/src/cpps/logical/order_management/simple_order_management.cpp +++ b/daisi/src/cpps/logical/task_management/simple_task_management.cpp @@ -14,7 +14,7 @@ // // SPDX-License-Identifier: GPL-2.0-only -#include "simple_order_management.h" +#include "simple_task_management.h" using namespace daisi::material_flow; namespace daisi::cpps::logical { diff --git a/daisi/src/cpps/logical/order_management/simple_order_management.h b/daisi/src/cpps/logical/task_management/simple_task_management.h similarity index 93% rename from daisi/src/cpps/logical/order_management/simple_order_management.h rename to daisi/src/cpps/logical/task_management/simple_task_management.h index 4aac8b7a..3fa3a00a 100644 --- a/daisi/src/cpps/logical/order_management/simple_order_management.h +++ b/daisi/src/cpps/logical/task_management/simple_task_management.h @@ -14,12 +14,12 @@ // // SPDX-License-Identifier: GPL-2.0-only -#ifndef DAISI_CPPS_LOGICAL_ORDER_MANAGEMENT_SIMPLE_ORDER_MANAGEMENT_H_ -#define DAISI_CPPS_LOGICAL_ORDER_MANAGEMENT_SIMPLE_ORDER_MANAGEMENT_H_ +#ifndef DAISI_CPPS_LOGICAL_TASK_MANAGEMENT_SIMPLE_TASK_MANAGEMENT_H_ +#define DAISI_CPPS_LOGICAL_TASK_MANAGEMENT_SIMPLE_TASK_MANAGEMENT_H_ #include "cpps/amr/amr_mobility_helper.h" #include "cpps/amr/physical/material_flow_functionality_mapping.h" -#include "order_management.h" +#include "task_management.h" namespace daisi::cpps::logical { class SimpleOrderManagement : public OrderManagement { @@ -36,7 +36,7 @@ class SimpleOrderManagement : public OrderManagement { /// @brief return the end position after executing the final task in the queue daisi::util::Position getExpectedEndPosition() const; - /// @brief check wether the order management has a current task assigned + /// @brief check wether the task management has a current task assigned bool hasTasks() const override; /// @brief get the current task diff --git a/daisi/src/cpps/logical/order_management/stn_order_management.cpp b/daisi/src/cpps/logical/task_management/stn_task_management.cpp similarity index 99% rename from daisi/src/cpps/logical/order_management/stn_order_management.cpp rename to daisi/src/cpps/logical/task_management/stn_task_management.cpp index 1d498a4d..0355fa44 100644 --- a/daisi/src/cpps/logical/order_management/stn_order_management.cpp +++ b/daisi/src/cpps/logical/task_management/stn_task_management.cpp @@ -14,7 +14,7 @@ // // SPDX-License-Identifier: GPL-2.0-only -#include "stn_order_management.h" +#include "stn_task_management.h" #include #include diff --git a/daisi/src/cpps/logical/order_management/stn_order_management.h b/daisi/src/cpps/logical/task_management/stn_task_management.h similarity index 95% rename from daisi/src/cpps/logical/order_management/stn_order_management.h rename to daisi/src/cpps/logical/task_management/stn_task_management.h index af6d4387..3c937365 100644 --- a/daisi/src/cpps/logical/order_management/stn_order_management.h +++ b/daisi/src/cpps/logical/task_management/stn_task_management.h @@ -14,16 +14,16 @@ // // SPDX-License-Identifier: GPL-2.0-only -#ifndef DAISI_CPPS_LOGICAL_ORDER_MANAGEMENT_STN_ORDER_MANAGEMENT_H_ -#define DAISI_CPPS_LOGICAL_ORDER_MANAGEMENT_STN_ORDER_MANAGEMENT_H_ +#ifndef DAISI_CPPS_LOGICAL_TASK_MANAGEMENT_STN_TASK_MANAGEMENT_H_ +#define DAISI_CPPS_LOGICAL_TASK_MANAGEMENT_STN_TASK_MANAGEMENT_H_ #include -#include "auction_based_order_management.h" +#include "auction_based_task_management.h" #include "cpps/amr/amr_mobility_helper.h" #include "cpps/amr/physical/material_flow_functionality_mapping.h" #include "datastructure/simple_temporal_network.tpp" -#include "stn_order_management_components.h" +#include "stn_task_management_components.h" namespace daisi::cpps::logical { @@ -43,7 +43,7 @@ class StnOrderManagement ~StnOrderManagement() override = default; - /// @brief check wether the order management has a current task assigned + /// @brief check wether the task management has a current task assigned bool hasTasks() const override; /// @brief get the current task diff --git a/daisi/src/cpps/logical/order_management/stn_order_management_components.cpp b/daisi/src/cpps/logical/task_management/stn_task_management_components.cpp similarity index 98% rename from daisi/src/cpps/logical/order_management/stn_order_management_components.cpp rename to daisi/src/cpps/logical/task_management/stn_task_management_components.cpp index 681c7fa5..e2bf6af0 100644 --- a/daisi/src/cpps/logical/order_management/stn_order_management_components.cpp +++ b/daisi/src/cpps/logical/task_management/stn_task_management_components.cpp @@ -14,7 +14,7 @@ // // SPDX-License-Identifier: GPL-2.0-only -#include "stn_order_management_components.h" +#include "stn_task_management_components.h" using namespace daisi::material_flow; diff --git a/daisi/src/cpps/logical/order_management/stn_order_management_components.h b/daisi/src/cpps/logical/task_management/stn_task_management_components.h similarity index 95% rename from daisi/src/cpps/logical/order_management/stn_order_management_components.h rename to daisi/src/cpps/logical/task_management/stn_task_management_components.h index 78163564..2fc2c230 100644 --- a/daisi/src/cpps/logical/order_management/stn_order_management_components.h +++ b/daisi/src/cpps/logical/task_management/stn_task_management_components.h @@ -14,8 +14,8 @@ // // SPDX-License-Identifier: GPL-2.0-only -#ifndef DAISI_CPPS_LOGICAL_ORDER_MANAGEMENT_STN_ORDER_MANAGEMENT_COMPONENTS_H_ -#define DAISI_CPPS_LOGICAL_ORDER_MANAGEMENT_STN_ORDER_MANAGEMENT_COMPONENTS_H_ +#ifndef DAISI_CPPS_LOGICAL_TASK_MANAGEMENT_STN_TASK_MANAGEMENT_COMPONENTS_H_ +#define DAISI_CPPS_LOGICAL_TASK_MANAGEMENT_STN_TASK_MANAGEMENT_COMPONENTS_H_ #include #include diff --git a/daisi/src/cpps/logical/order_management/order_management.h b/daisi/src/cpps/logical/task_management/task_management.h similarity index 90% rename from daisi/src/cpps/logical/order_management/order_management.h rename to daisi/src/cpps/logical/task_management/task_management.h index d101641b..2193d0a4 100644 --- a/daisi/src/cpps/logical/order_management/order_management.h +++ b/daisi/src/cpps/logical/task_management/task_management.h @@ -14,8 +14,8 @@ // // SPDX-License-Identifier: GPL-2.0-only -#ifndef DAISI_CPPS_LOGICAL_ORDER_MANAGEMENT_ORDER_MANAGEMENT_H_ -#define DAISI_CPPS_LOGICAL_ORDER_MANAGEMENT_ORDER_MANAGEMENT_H_ +#ifndef DAISI_CPPS_LOGICAL_TASK_MANAGEMENT_TASK_MANAGEMENT_H_ +#define DAISI_CPPS_LOGICAL_TASK_MANAGEMENT_TASK_MANAGEMENT_H_ #include #include @@ -27,7 +27,7 @@ #include "cpps/amr/amr_topology.h" #include "material_flow/model/task.h" #include "metrics_composition.h" -#include "order_management_helper.h" +#include "task_management_helper.h" #include "utils/structure_helpers.h" namespace daisi::cpps::logical { @@ -42,7 +42,7 @@ class OrderManagement { virtual ~OrderManagement() = default; - /// @brief check wether the order management has a current task assigned + /// @brief check wether the task management has a current task assigned virtual bool hasTasks() const = 0; /// @brief get the current task diff --git a/daisi/src/cpps/logical/order_management/order_management_helper.cpp b/daisi/src/cpps/logical/task_management/task_management_helper.cpp similarity index 97% rename from daisi/src/cpps/logical/order_management/order_management_helper.cpp rename to daisi/src/cpps/logical/task_management/task_management_helper.cpp index 74f39d9f..e251de57 100644 --- a/daisi/src/cpps/logical/order_management/order_management_helper.cpp +++ b/daisi/src/cpps/logical/task_management/task_management_helper.cpp @@ -14,7 +14,7 @@ // // SPDX-License-Identifier: GPL-2.0-only -#include "order_management_helper.h" +#include "task_management_helper.h" using namespace daisi::material_flow; namespace daisi::cpps::logical { diff --git a/daisi/src/cpps/logical/order_management/order_management_helper.h b/daisi/src/cpps/logical/task_management/task_management_helper.h similarity index 89% rename from daisi/src/cpps/logical/order_management/order_management_helper.h rename to daisi/src/cpps/logical/task_management/task_management_helper.h index 14104d79..3375232b 100644 --- a/daisi/src/cpps/logical/order_management/order_management_helper.h +++ b/daisi/src/cpps/logical/task_management/task_management_helper.h @@ -14,8 +14,8 @@ // // SPDX-License-Identifier: GPL-2.0-only -#ifndef DAISI_CPPS_LOGICAL_ORDER_MANAGEMENT_ORDER_MANAGEMENT_HELPER_H_ -#define DAISI_CPPS_LOGICAL_ORDER_MANAGEMENT_ORDER_MANAGEMENT_HELPER_H_ +#ifndef DAISI_CPPS_LOGICAL_TASK_MANAGEMENT_TASK_MANAGEMENT_HELPER_H_ +#define DAISI_CPPS_LOGICAL_TASK_MANAGEMENT_TASK_MANAGEMENT_HELPER_H_ #include diff --git a/daisi/tests/unittests/CMakeLists.txt b/daisi/tests/unittests/CMakeLists.txt index 72bff7b7..2b36762c 100644 --- a/daisi/tests/unittests/CMakeLists.txt +++ b/daisi/tests/unittests/CMakeLists.txt @@ -52,26 +52,26 @@ target_link_libraries(DaisiDatastructureSimpleTemporalNetworkTest add_executable(DaisiCppsOrderManagementStnOrderManagement "") target_sources(DaisiCppsOrderManagementStnOrderManagement PRIVATE - cpps/order_management/stn_order_management_test.cpp + cpps/task_management/stn_task_management_test.cpp ) target_link_libraries(DaisiCppsOrderManagementStnOrderManagement PRIVATE Catch2::Catch2WithMain ns3::libcore - daisi_cpps_logical_order_management_stn_order_management + daisi_cpps_logical_task_management_stn_task_management daisi_cpps_amr_physical_material_flow_functionality_mapping ) add_executable(DaisiCppsOrderManagementSimpleOrderManagement "") target_sources(DaisiCppsOrderManagementSimpleOrderManagement PRIVATE - cpps/order_management/simple_order_management_test.cpp + cpps/task_management/simple_task_management_test.cpp ) target_link_libraries(DaisiCppsOrderManagementSimpleOrderManagement PRIVATE Catch2::Catch2WithMain ns3::libcore - daisi_cpps_logical_order_management_simple_order_management + daisi_cpps_logical_task_management_simple_task_management daisi_cpps_amr_physical_material_flow_functionality_mapping ) diff --git a/daisi/tests/unittests/cpps/logical/auction_participant_state_test.cpp b/daisi/tests/unittests/cpps/logical/auction_participant_state_test.cpp index 9c45e76a..5a016210 100644 --- a/daisi/tests/unittests/cpps/logical/auction_participant_state_test.cpp +++ b/daisi/tests/unittests/cpps/logical/auction_participant_state_test.cpp @@ -19,7 +19,7 @@ #include #include -#include "cpps/logical/order_management/stn_order_management.h" +#include "cpps/logical/task_management/stn_task_management.h" #include "material_flow/model/task.h" using namespace daisi; diff --git a/daisi/tests/unittests/cpps/order_management/simple_order_management_test.cpp b/daisi/tests/unittests/cpps/task_management/simple_task_management_test.cpp similarity index 99% rename from daisi/tests/unittests/cpps/order_management/simple_order_management_test.cpp rename to daisi/tests/unittests/cpps/task_management/simple_task_management_test.cpp index 6910e76c..d18a95e0 100644 --- a/daisi/tests/unittests/cpps/order_management/simple_order_management_test.cpp +++ b/daisi/tests/unittests/cpps/task_management/simple_task_management_test.cpp @@ -14,7 +14,7 @@ // // SPDX-License-Identifier: GPL-2.0-only -#include "cpps/logical/order_management/simple_order_management.h" +#include "cpps/logical/task_management/simple_task_management.h" #include #include @@ -399,7 +399,7 @@ TEST_CASE("SimpleOrderManagement One Transport, Move, and Action Order in one Ta REQUIRE(add_metrics.getMakespan() >= add_metrics.getTime() + 41); } -TEST_CASE("Simple Order Management Three Simple Transport Orders with time delay", +TEST_CASE("Simple Task Management Three Simple Transport Orders with time delay", "[adding and removing vertices]") { // arrange auto current_pose = daisi::util::Pose(p0); diff --git a/daisi/tests/unittests/cpps/order_management/stn_order_management_test.cpp b/daisi/tests/unittests/cpps/task_management/stn_task_management_test.cpp similarity index 99% rename from daisi/tests/unittests/cpps/order_management/stn_order_management_test.cpp rename to daisi/tests/unittests/cpps/task_management/stn_task_management_test.cpp index 2a150262..090d630c 100644 --- a/daisi/tests/unittests/cpps/order_management/stn_order_management_test.cpp +++ b/daisi/tests/unittests/cpps/task_management/stn_task_management_test.cpp @@ -14,7 +14,7 @@ // // SPDX-License-Identifier: GPL-2.0-only -#include "cpps/logical/order_management/stn_order_management.h" +#include "cpps/logical/task_management/stn_task_management.h" #include #include diff --git a/docs/optimaflow/participants/amr.md b/docs/optimaflow/participants/amr.md index e1cbe579..3fb94120 100644 --- a/docs/optimaflow/participants/amr.md +++ b/docs/optimaflow/participants/amr.md @@ -29,14 +29,14 @@ And all received messages are forwarded to the Algorithms component. The Algorithms component handles Task aquisition or assignment from [Material Flow Logical Agents (MFLA)](./material_flow.md). Those Tasks are assigned to AMRs using [centralized](../task_assignment/round_robin.md) or [decentralized](../task_assignment/decentralized.md) Task Assignment Algorithms. -Some Task Assignment Algorithms require cost calculations that are delegated to the Order Management. +Some Task Assignment Algorithms require cost calculations that are delegated to the Task Management. -When a Task is assigned to an AMR Logical Agent the Algorithms component will forward it to the Order Management. +When a Task is assigned to an AMR Logical Agent the Algorithms component will forward it to the Task Management. -### Order Management +### Task Management -The Order Management holds assigned Tasks in a queue. -Whenever a Task is queued and the AMR is ready to execute it, the Order Management's next Order will be sent to the AMR Physical Asset using the TCP Connection and also send it to the AMR Logical Execution State to manage the Order execution. +The Task Management holds assigned Tasks in a queue. +Whenever a Task is queued and the AMR is ready to execute it, the Task Management's next Order will be sent to the AMR Physical Asset using the TCP Connection and also send it to the AMR Logical Execution State to manage the Order execution. It also does cost calculations required by the Algorithms component using the [AMR Mobility Helper](#amr-mobility-helper). diff --git a/docs/optimaflow/task_assignment/decentralized.md b/docs/optimaflow/task_assignment/decentralized.md index 26962911..3b912c13 100644 --- a/docs/optimaflow/task_assignment/decentralized.md +++ b/docs/optimaflow/task_assignment/decentralized.md @@ -30,7 +30,7 @@ Meanwhile, the primary goal of the TePSSI algorithm is to optimize task assignme ### Task Storage -Once tasks are assigned to an AMR, the AMR Logical Agent stores the tasks in a Simple Temporal Network (STN) [[3]](#references) as an Order Management. +Once tasks are assigned to an AMR, the AMR Logical Agent stores the tasks in a Simple Temporal Network (STN) [[3]](#references) as an Task Management. The STN enables efficient representation and management of the temporal constraints associated with task execution. ### TePSSI in the Material Flow Logical Agent diff --git a/docs/optimaflow/task_assignment/round_robin.md b/docs/optimaflow/task_assignment/round_robin.md index 4684d664..fc2a3a3e 100644 --- a/docs/optimaflow/task_assignment/round_robin.md +++ b/docs/optimaflow/task_assignment/round_robin.md @@ -53,7 +53,7 @@ In the ambigous case that more than one candidate has the fewest task assignment As for each centralized approach in this section, the task assignment starts immediately after the optimizer receives a new Material Flow. Each of the tasks is assigned sequentially as described above by respecting the valid abilities per tasks as well as the total number of assigned tasks per ability. -The selected participant receives the task and tries to add it to it's local Order Management. +The selected participant receives the task and tries to add it to it's local Task Management. The result of this additon (successful or not), followed by the (updated) status is sent back to the optimizer. Since it is a simplified strategy, a task should always be accepted. However, if the selected participant's answer is not received after a fixed time, the corresponding task is rescheduled.