Class MultiOptimizationObjective

Nested Relationships

Nested Types

Inheritance Relationships

Base Type

Class Documentation

class MultiOptimizationObjective : public ompl::base::OptimizationObjective

This class allows for the definition of multiobjective optimal planning problems. Objectives are added to this compound object, and motion costs are computed by taking a weighted sum of the individual objective costs.

Public Functions

MultiOptimizationObjective(const SpaceInformationPtr &si)
void addObjective(const OptimizationObjectivePtr &objective, double weight)

Adds a new objective for this multiobjective. A weight must also be specified for specifying importance of this objective in planning.

std::size_t getObjectiveCount() const

Returns the number of objectives that make up this multiobjective.

const OptimizationObjectivePtr &getObjective(unsigned int idx) const

Returns a specific objective from this multiobjective, where the individual objectives are in order of addition to the multiobjective, and idx is the zero-based index into this ordering.

double getObjectiveWeight(unsigned int idx) const

Returns the weighing factor of a specific objective.

void setObjectiveWeight(unsigned int idx, double weight)

Sets the weighing factor of a specific objective.

void lock()

This method “freezes” this multiobjective so that no more objectives can be added to it.

bool isLocked() const

Returns whether this multiobjective has been locked from adding further objectives.

virtual Cost stateCost(const State *s) const override

The default implementation of this method is to use addition to add up all the individual objectives’ state cost values, where each individual value is scaled by its weight

virtual Cost motionCost(const State *s1, const State *s2) const override

The default implementation of this method is to use addition to add up all the individual objectives’ motion cost values, where each individual value is scaled by its weight

Protected Attributes

std::vector<Component> components_

List of objective/weight pairs.

bool locked_

Whether this multiobjective is locked from further additions.

Friends

friend OptimizationObjectivePtr operator+(const OptimizationObjectivePtr &a, const OptimizationObjectivePtr &b)

Given two optimization objectives, returns a MultiOptimizationObjective that combines the two objectives with both weights equal to 1.0.

friend OptimizationObjectivePtr operator*(double weight, const OptimizationObjectivePtr &a)

Given a weighing factor and an optimization objective, returns a MultiOptimizationObjective containing only this objective weighted by the given weight.

friend OptimizationObjectivePtr operator*(const OptimizationObjectivePtr &a, double weight)

Given a weighing factor and an optimization objective, returns a MultiOptimizationObjective containing only this objective weighted by the given weight.

struct Component

Defines a pairing of an objective and its weight.

Public Functions

Component(OptimizationObjectivePtr obj, double weight)

Public Members

OptimizationObjectivePtr objective
double weight