Class SimpleNegotiator¶
Defined in File SimpleNegotiator.hpp
Nested Relationships¶
Nested Types¶
Inheritance Relationships¶
Base Type¶
public rmf_traffic::schedule::Negotiator
(Class Negotiator)
Class Documentation¶
-
class
rmf_traffic::agv
::
SimpleNegotiator
: public rmf_traffic::schedule::Negotiator¶ A simple implementation of the schedule::Negotiator class. It uses an agv::Planner to try to find a solution that fits on the negotiation table.
Public Functions
-
SimpleNegotiator
(schedule::Participant::AssignIDPtr assign_id, Planner::Start start, Planner::Goal goal, Planner::Configuration planner_configuration, Options options = Options())¶ Constructor
- Parameters
[in] assign_id
: The ID assignment tool for the participant[in] start
: The desired start for the plan.[in] goal
: The desired goal for the plan.[in] planner_configuration
: The configuration that will be used by the planner underlying this Negotiator.[in] options
: Additional options that will be used by the Negotiator.
-
SimpleNegotiator
(schedule::Participant::AssignIDPtr assign_id, std::vector<Planner::Start> starts, Planner::Goal goal, Planner::Configuration planner_configuration, Options options = Options())¶ Constructor
- Parameters
[in] assign_id
: The ID assignment tool for the participant[in] start
: A set of starts that can be used.[in] goal
: The desired goal for the plan.[in] planner_configuration
: The configuration that will be used by the planner underlying this Negotiator.[in] options
: Additional options that will be used by the Negotiator.
Constructor
- Parameters
[in] assign_id
: The ID assignment tool for the participant[in] starts
: A set of starts that can be used.[in] goal
: The desired goal for the plan.[in] planner
: The planner to use[in] options
: Additional options that will be used by the negotiator
-
virtual void
respond
(const schedule::Negotiation::Table::ViewerPtr &table_viewer, const ResponderPtr &responder) final¶ Have the Negotiator respond to an attempt to negotiate.
- Parameters
[in] table
: The Negotiation::Table that is being used for the negotiation.[in] responder
: The Responder instance that the negotiator should use when a response is ready.[in] interrupt_flag
: A pointer to a flag that can be used to interrupt the negotiator if it has been running for too long. If the planner should run indefinitely, then pass a nullptr.
-
class
Debug
¶ Public Static Functions
-
static SimpleNegotiator &
enable_debug_print
(SimpleNegotiator &negotiator)¶
-
static SimpleNegotiator &
-
class
Options
¶ A class to specify user-defined options for the Negotiator.
Public Types
Public Functions
Constructor
- Parameters
[in] approval_cb
: The callback that will be triggered if the proposal is approved.[in] maximum_cost_leeway
: The initial cost estimate for each planning attempt will be multiplied by this factor to determine the maximum cost estimate that will be allowed for a plan before giving up.[in] maximum_alts
: The maximum number of alternatives to produce when rejecting a proposal from another negotiator.[in] min_hold_time
: The minimum amount of time that the planner should spend waiting at holding points. See Planner::Options for more information.
-
Options &
approval_callback
(ApprovalCallback cb)¶ Set the approval callback.
Set the interrupt flag.
-
const std::shared_ptr<const bool> &
interrupt_flag
() const¶ Get the interrupt flag.
-
std::optional<double>
maximum_cost_leeway
() const¶ Get the maximum cost leeway.
-
Options &
minimum_cost_threshold
(std::optional<double> cost)¶ Set the minimum cost threshold. When this and maximum_cost_leeway are both set, the maximum cost estimate will be chosen by std::max( minimum_cost_threshold, initial_cost_estimate * maximum_cost_leeway )
By default, this is DefaultMinCostThreshold.
-
std::optional<double>
minimum_cost_threshold
() const¶ Get the minimum cost threshold.
-
Options &
maximum_cost_threshold
(std::optional<double> cost)¶ Set the maximum cost threshold. When this is set, the cost will not be allowed to exceed it, even if the maximum cost leeway would allow it. By default, this is nullopt.
-
std::optional<double>
maximum_cost_threshold
() const¶ Get the maximum cost threshold.
-
std::optional<std::size_t>
maximum_alternatives
() const¶
-