.. _program_listing_file__tmp_ws_src_rmf_task_rmf_task_include_rmf_task_TaskPlanner.hpp: Program Listing for File TaskPlanner.hpp ======================================== |exhale_lsh| :ref:`Return to documentation for file ` (``/tmp/ws/src/rmf_task/rmf_task/include/rmf_task/TaskPlanner.hpp``) .. |exhale_lsh| unicode:: U+021B0 .. UPWARDS ARROW WITH TIP LEFTWARDS .. code-block:: cpp /* * Copyright (C) 2020 Open Source Robotics Foundation * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ #ifndef RMF_TASK__AGV__TASKPLANNER_HPP #define RMF_TASK__AGV__TASKPLANNER_HPP #include #include #include #include #include #include #include #include #include #include #include namespace rmf_task { //============================================================================== class TaskPlanner { public: class Configuration { public: Configuration( Parameters parameters, Constraints constraints, ConstCostCalculatorPtr cost_calculator); const Parameters& parameters() const; Configuration& parameters(Parameters parameters); const Constraints& constraints() const; Configuration& constraints(Constraints constraints); const ConstCostCalculatorPtr& cost_calculator() const; Configuration& cost_calculator(ConstCostCalculatorPtr cost_calculator); class Implementation; private: rmf_utils::impl_ptr _pimpl; }; class Options { public: Options( bool greedy, std::function interrupter = nullptr, ConstRequestFactoryPtr finishing_request = nullptr); Options& greedy(bool value); bool greedy() const; Options& interrupter(std::function interrupter); const std::function& interrupter() const; Options& finishing_request(ConstRequestFactoryPtr finishing_request); ConstRequestFactoryPtr finishing_request() const; class Implementation; private: rmf_utils::impl_ptr _pimpl; }; class Assignment { public: Assignment( rmf_task::ConstRequestPtr request, State finish_state, rmf_traffic::Time deployment_time); // Get the request of this task const rmf_task::ConstRequestPtr& request() const; // Get a const reference to the predicted state at the end of the assignment const State& finish_state() const; // Get the time when the robot begins executing // this assignment const rmf_traffic::Time deployment_time() const; class Implementation; private: rmf_utils::impl_ptr _pimpl; }; enum class TaskPlannerError { low_battery, limited_capacity }; using Assignments = std::vector>; using Result = std::variant; TaskPlanner( Configuration configuration, Options default_options); TaskPlanner( const std::string& planner_id, Configuration configuration, Options default_options); const Configuration& configuration() const; const Options& default_options() const; Options& default_options(); Result plan( rmf_traffic::Time time_now, std::vector agents, std::vector requests); Result plan( rmf_traffic::Time time_now, std::vector agents, std::vector requests, Options options); double compute_cost(const Assignments& assignments) const; class Implementation; private: rmf_utils::impl_ptr _pimpl; }; } // namespace rmf_task #endif // RMF_TASK__AGV__TASKPLANNER_HPP