Skip to main content

Rrt

Struct Rrt 

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

The rapidly-exploring random tree: grows toward random samples, finds a feasible path fast, but does not improve it.

Each iteration extends the nearest node toward a goal-biased sample by one steering step and keeps the new node if the motion is Validity::Valid.

Implementations§

Source§

impl<Sp, Sa, C, St> Rrt<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: RrtConfig, ) -> Result<Self, Error>

Creates a planner with a LinearScan nearest-neighbor index.

§Errors
Source§

impl<Sp, Sa, C, St, N> Rrt<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: RrtConfig, 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 solve<R: Rng + ?Sized>( &mut self, max_iterations: usize, rng: &mut R, ) -> Option<Path<Sp::State>>

Runs until the first solution or at most max_iterations iterations.

Returns the solution, or None if none was found within the budget.

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 Rrt<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 Rrt<Sp, Sa, C, St, N>

§

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

§

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

§

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

§

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

§

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

§

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

§

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

§

impl<Sp, Sa, C, St, N> UnwindSafe for Rrt<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.