Skip to main content

MoCbsConfig

Struct MoCbsConfig 

Source
pub struct MoCbsConfig {
    pub tree_by_tree: bool,
    pub low_level: LowLevel,
    pub feasibility_check: bool,
    pub prioritize_conflicts: bool,
    pub bypass: bool,
    pub splitting: Splitting,
}
Expand description

How mo_cbs_with orders the high-level search, which low level it uses and which improvements it applies.

Every configuration returns the same front; they differ in effort. The default is MoCbsConfig::improved, what mo_cbs uses.

use mapf_search::{Agent, Grid, Instance, Limits, MoCbsConfig, ParetoOutcome, mo_cbs_with};

// Two agents swap the ends of a corridor: no plan exists.
let grid = Grid::new(3, 1);
let agents = vec![Agent { start: 0, goal: 2 }, Agent { start: 2, goal: 0 }];
let instance = Instance::new(grid, agents)?;
let costs = |_: usize, _: usize| [1, 1];

// The paper's MO-CBS only stops at its budget; the feasibility check proves it.
let plain = mo_cbs_with(&instance, &costs, MoCbsConfig::plain(), Limits::expansions(100));
let improved = mo_cbs_with(&instance, &costs, MoCbsConfig::improved(), Limits::NONE);

assert_eq!(plain.outcome, ParetoOutcome::LimitReached);
assert_eq!(improved.outcome, ParetoOutcome::Unsolvable);

Fields§

§tree_by_tree: bool

Tree-by-tree expansion (MO-CBS-t): generate one root at a time and exhaust its tree before the next. Plain MO-CBS generates every root up front, which is the product of the agents’ Pareto set sizes, and expands across all trees.

§low_level: LowLevel

The single-agent multi-objective planner.

§feasibility_check: bool

Before the search, prove infeasible instances ParetoOutcome::Unsolvable (paper, Sec. VII-B): feasibility does not depend on the costs, so recursive M* with unit costs decides it, under the same budget with M*’s counters. If that budget runs out, the search goes on without the proof.

§prioritize_conflicts: bool

Split cardinal conflicts first, then semi-cardinal ones, then the rest (earliest first within a class). A conflict is cardinal for an agent if every path of the agent’s current Pareto set takes part in it.

§bypass: bool

Bypass: when a child’s replanned agents each have a path of the parent’s cost that leaves fewer conflicts, take those paths over instead of splitting.

§splitting: Splitting

How a conflict is split into children. Splitting::Disjoint constrains the agent for which the conflict is cardinal if only one is, else the conflict’s first agent.

Implementations§

Source§

impl MoCbsConfig

Source

pub const fn plain() -> Self

Plain MO-CBS, Alg. 1 of the paper: all roots up front, BOA* for two objectives, no improvements.

Source

pub const fn tree_by_tree() -> Self

MO-CBS-t, as in the paper: one tree at a time, BOA* for two objectives, no improvements.

Source

pub const fn improved() -> Self

MO-CBS-t with the feasibility check, conflict prioritization, bypass and disjoint splitting. What mo_cbs uses.

Trait Implementations§

Source§

impl Clone for MoCbsConfig

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for MoCbsConfig

Source§

impl Debug for MoCbsConfig

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for MoCbsConfig

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl Eq for MoCbsConfig

Source§

impl Hash for MoCbsConfig

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl PartialEq for MoCbsConfig

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for MoCbsConfig

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.