Class Planner::Result

Nested Relationships

This class is a nested type of Class Planner.

Class Documentation

class Result

Public Functions

bool success() const

True if a plan was found and this Result can be dereferenced to obtain a plan.

bool disconnected() const

True if there is no feasible path that connects the start to the goal. In this case, a plan will never be found.

operator bool() const

Implicitly cast the result to a boolean. It will return true if a plan was found, otherwise it will return false.

const Plan *operator->() const

If the Result was successful, drill into the plan.

const Plan &operator*() const &

If the Result was successful, get a reference to the plan.

Plan &&operator*() &&

If the Result was successful, move the plan.

const Plan &&operator*() const &&

If the Result was successful, get a reference to the plan.

Result replan(const Start &new_start) const

Replan to the same goal from a new start location using the same options as before.

Parameters:

new_start[in] The starting conditions that should be used for replanning.

Result replan(const Start &new_start, Options new_options) const

Replan to the same goal from a new start location using a new set of options.

Parameters:
  • new_start[in] The starting conditions that should be used for replanning.

  • new_options[in] The options that should be used for replanning.

Result replan(const StartSet &new_starts) const

Replan to the same goal from a new set of start locations using the same options.

Parameters:

new_starts[in] The set of starting conditions that should be used for replanning.

Result replan(const StartSet &new_starts, Options new_options) const

Replan to the same goal from a new set of start locations using a new set of options.

Parameters:
  • new_starts[in] The set of starting conditions that should be used for replanning.

  • new_options[in] The options that should be used for replanning.

Result setup(const Start &new_start) const

Set up a new planning job to the same goal, but do not start iterating.

See also

replan(const Start&)

Result setup(const Start &new_start, Options new_options) const

Set up a new planning job to the same goal, but do not start iterating.

See also

replan(const Start&, Options)

Result setup(const StartSet &new_starts) const

Set up a new planning job to the same goal, but do not start iterating.

See also

replan(const StartSet&)

Result setup(const StartSet &new_starts, Options new_options) const

Set up a new planning job to the same goal, but do not start iterating.

See also

replan(const StartSet&, Options)

bool resume()

Resume planning if the planner was paused.

Returns:

true if a plan has been found, false otherwise.

bool resume(std::shared_ptr<const std::atomic_bool> interrupt_flag)

Resume planning if the planner was paused.

Parameters:

interrupt_flag[in] A new interrupt flag to listen to while planning.

Returns:

true if a plan has been found, false otherwise.

Options &options()

Get a mutable reference to the options that will be used by this planning task.

const Options &options() const

Get the options that will be used by this planning task.

Result &options(Options new_options)

Change the options to be used by this planning task.

std::optional<double> cost_estimate() const

Get the best cost estimate of the current state of this planner result. This is the value of the lowest f(n)=g(n)+h(n) in the planner’s queue. If the node queue of this planner result is empty, this will return a nullopt.

double initial_cost_estimate() const

Get the cost estimate that was initially computed for this plan. If no valid starts were provided, then this will return infinity.

std::optional<double> ideal_cost() const

Get the cost that this plan would have if there is no traffic. If the plan is impossible (e.g. the starts are disconnected from the goal) this will return a nullopt.

const std::vector<Start> &get_starts() const

Get the start conditions that were given for this planning task.

const Goal &get_goal() const

Get the goal for this planning task.

const Configuration &get_configuration() const

If this Plan is valid, this will return the Planner::Configuration that was used to produce it.

If replan() is called, this Planner::Configuration will be used to produce the new Plan.

bool interrupted() const

This will return true if the planning failed because it was interrupted. Otherwise it will return false.

bool saturated() const

This will return true if the planner has reached its saturation limit.

std::vector<schedule::ParticipantId> blockers() const

This is a list of schedule Participants who blocked the planning effort. Blockers do not necessarily prevent a solution from being found, but they do prevent the optimal solution from being available.