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 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:
assign_id – [in] The ID assignment tool for the participant
start – [in] The desired start for the plan.
goal – [in] The desired goal for the plan.
planner_configuration – [in] The configuration that will be used by the planner underlying this Negotiator.
options – [in] 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:
assign_id – [in] The ID assignment tool for the participant
start – [in] A set of starts that can be used.
goal – [in] The desired goal for the plan.
planner_configuration – [in] The configuration that will be used by the planner underlying this Negotiator.
options – [in] Additional options that will be used by the Negotiator.
Constructor
- Parameters:
assign_id – [in] The ID assignment tool for the participant
starts – [in] A set of starts that can be used.
goal – [in] The desired goal for the plan.
planner – [in] The planner to use
options – [in] 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:
table – [in] The Negotiation::Table that is being used for the negotiation.
responder – [in] The Responder instance that the negotiator should use when a response is ready.
interrupt_flag – [in] 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 &enable_debug_print(SimpleNegotiator &negotiator)
-
class Options
A class to specify user-defined options for the Negotiator.
Public Types
Public Functions
Constructor
- Parameters:
approval_cb – [in] The callback that will be triggered if the proposal is approved.
maximum_cost_leeway – [in] 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.
maximum_alts – [in] The maximum number of alternatives to produce when rejecting a proposal from another negotiator.
min_hold_time – [in] 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
-
SimpleNegotiator(schedule::Participant::AssignIDPtr assign_id, Planner::Start start, Planner::Goal goal, Planner::Configuration planner_configuration, Options options = Options())