Skip to main content

RrtStar

Struct RrtStar 

Source
pub struct RrtStar<Sp: StateSpace, Sa, C, St, N = LinearScan<<Sp as StateSpace>::State>> { /* private fields */ }
Expand description

RRT*: like Rrt, but each new node picks the cheapest valid parent among its neighbors and then rewires neighbors through itself when that is cheaper.

Costs only ever decrease, so the cost of RrtStar::best_path never increases as iterations run, and it converges to the optimum as the number of iterations grows.

Implementations§

Source§

impl<Sp, Sa, C, St> RrtStar<Sp, Sa, C, St>
where Sp: StateSpace, Sa: Sampler<Sp::State>, C: ValidityChecker<Sp>, St: Steering<Sp>,

Source

pub fn new( problem: Problem<Sp, Sa, C, St>, config: RrtStarConfig, ) -> Result<Self, Error>

Creates a planner with a LinearScan nearest-neighbor index.

§Errors
Source§

impl<Sp, Sa, C, St, N> RrtStar<Sp, Sa, C, St, N>
where Sp: StateSpace, Sa: Sampler<Sp::State>, C: ValidityChecker<Sp>, St: Steering<Sp>, N: NearestNeighbors<Sp>,

Source

pub fn with_nearest_neighbors( problem: Problem<Sp, Sa, C, St>, config: RrtStarConfig, nn: N, ) -> Result<Self, Error>

Creates a planner with the given empty nearest-neighbor index.

§Errors
Source

pub fn step<R: Rng + ?Sized>(&mut self, rng: &mut R) -> bool

Runs one iteration. Returns whether a node was added.

Source

pub fn run<R: Rng + ?Sized>(&mut self, iterations: usize, rng: &mut R)

Runs iterations iterations.

Source

pub fn best_path(&self) -> Option<Path<Sp::State>>

The cheapest path found so far, or None if the goal was not reached yet.

Source

pub fn node_count(&self) -> usize

The number of tree nodes, including the root.

Trait Implementations§

Source§

impl<Sp: Clone + StateSpace, Sa: Clone, C: Clone, St: Clone, N: Clone> Clone for RrtStar<Sp, Sa, C, St, N>

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

Auto Trait Implementations§

§

impl<Sp, Sa, C, St, N> Forget for RrtStar<Sp, Sa, C, St, N>

§

impl<Sp, Sa, C, St, N> Freeze for RrtStar<Sp, Sa, C, St, N>
where Growth<Sp, Sa, C, St, N>: Freeze,

§

impl<Sp, Sa, C, St, N> Move for RrtStar<Sp, Sa, C, St, N>

§

impl<Sp, Sa, C, St, N> RefUnwindSafe for RrtStar<Sp, Sa, C, St, N>
where Growth<Sp, Sa, C, St, N>: RefUnwindSafe,

§

impl<Sp, Sa, C, St, N> Send for RrtStar<Sp, Sa, C, St, N>
where Growth<Sp, Sa, C, St, N>: Send,

§

impl<Sp, Sa, C, St, N> Sync for RrtStar<Sp, Sa, C, St, N>
where Growth<Sp, Sa, C, St, N>: Sync,

§

impl<Sp, Sa, C, St, N> Unpin for RrtStar<Sp, Sa, C, St, N>
where Growth<Sp, Sa, C, St, N>: Unpin,

§

impl<Sp, Sa, C, St, N> UnsafeUnpin for RrtStar<Sp, Sa, C, St, N>
where Growth<Sp, Sa, C, St, N>: UnsafeUnpin,

§

impl<Sp, Sa, C, St, N> UnwindSafe for RrtStar<Sp, Sa, C, St, N>
where Growth<Sp, Sa, C, St, N>: UnwindSafe,

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<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.