.. _program_listing_file__tmp_ws_src_rmf_traffic_rmf_traffic_include_rmf_traffic_agv_CentralizedNegotiation.hpp: Program Listing for File CentralizedNegotiation.hpp =================================================== |exhale_lsh| :ref:`Return to documentation for file ` (``/tmp/ws/src/rmf_traffic/rmf_traffic/include/rmf_traffic/agv/CentralizedNegotiation.hpp``) .. |exhale_lsh| unicode:: U+021B0 .. UPWARDS ARROW WITH TIP LEFTWARDS .. code-block:: cpp /* * Copyright (C) 2022 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_TRAFFIC__AGV__CENTRALIZEDNEGOTIATION_HPP #define RMF_TRAFFIC__AGV__CENTRALIZEDNEGOTIATION_HPP #include #include namespace rmf_traffic { namespace agv { //============================================================================== class CentralizedNegotiation { public: class Agent { public: Agent( schedule::ParticipantId id, Plan::Start start, Plan::Goal goal, std::shared_ptr planner, std::optional options = std::nullopt); Agent( schedule::ParticipantId id, std::vector starts, Plan::Goal goal, std::shared_ptr planner, std::optional options = std::nullopt); schedule::ParticipantId id() const; Agent& id(schedule::ParticipantId value); const std::vector& starts() const; Agent& starts(std::vector values); const Plan::Goal& goal() const; Agent& goal(Plan::Goal value); const std::shared_ptr& planner() const; Agent& planner(std::shared_ptr value); const std::optional& options() const; Agent& options(std::optional value); class Implementation; private: rmf_utils::impl_ptr _pimpl; }; using Proposal = std::unordered_map; class Result { public: const std::optional& proposal() const; const std::unordered_set& blockers() const; const std::vector& log() const; class Implementation; private: rmf_utils::impl_ptr _pimpl; }; CentralizedNegotiation(std::shared_ptr viewer); const std::shared_ptr& viewer() const; CentralizedNegotiation& viewer(std::shared_ptr v); CentralizedNegotiation& optimal(bool on = true); CentralizedNegotiation& log(bool on = true); CentralizedNegotiation& print(bool on = true); Result solve(const std::vector& agents) const; class Implementation; private: rmf_utils::impl_ptr _pimpl; }; } // namespace agv } // namespace rmf_traffic #endif // RMF_TRAFFIC__AGV__CENTRALIZEDNEGOTIATION_HPP