Class SimpleNegotiator::Options

Nested Relationships

This class is a nested type of Class SimpleNegotiator.

Class Documentation

class Options

A class to specify user-defined options for the Negotiator.

Public Types

using ApprovalCallback = std::function<Responder::UpdateVersion(rmf_traffic::agv::Plan)>

Public Functions

Options(ApprovalCallback approval_cb = nullptr, std::shared_ptr<const bool> interrupt_flag = nullptr, std::optional<double> maximum_cost_leeway = DefaultMaxCostLeeway, std::optional<std::size_t> maximum_alts = std::nullopt, Duration min_hold_time = Planner::Options::DefaultMinHoldingTime)

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.

Options &interrupt_flag(std::shared_ptr<const bool> flag)

Set the interrupt flag.

const std::shared_ptr<const bool> &interrupt_flag() const

Get the interrupt flag.

Options &maximum_cost_leeway(std::optional<double> leeway)

Set the maximum cost leeway.

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.

Options &maximum_alternatives(rmf_utils::optional<std::size_t> num)
std::optional<std::size_t> maximum_alternatives() const
Options &minimum_holding_time(Duration holding_time)

Set the minimum amount of time to spend waiting at holding points.

Duration minimum_holding_time() const

Get the minimum amount of time to spend waiting at holding points.

Public Static Attributes

static constexpr double DefaultMaxCostLeeway = 1.5
static constexpr double DefaultMinCostThreshold = 30.0