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>
impl<Sp, Sa, C, St> Rrt<Sp, Sa, C, St>
Sourcepub fn new(
problem: Problem<Sp, Sa, C, St>,
config: RrtConfig,
) -> Result<Self, Error>
pub fn new( problem: Problem<Sp, Sa, C, St>, config: RrtConfig, ) -> Result<Self, Error>
Creates a planner with a LinearScan nearest-neighbor index.
§Errors
Error::InvalidStartif the start state is not valid.Error::GoalBiasOutOfRangeif the goal bias is not in[0, 1].
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>,
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>,
Sourcepub fn with_nearest_neighbors(
problem: Problem<Sp, Sa, C, St>,
config: RrtConfig,
nn: N,
) -> Result<Self, Error>
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
Error::InvalidStartif the start state is not valid.Error::GoalBiasOutOfRangeif the goal bias is not in[0, 1].
Sourcepub fn step<R: Rng + ?Sized>(&mut self, rng: &mut R) -> bool
pub fn step<R: Rng + ?Sized>(&mut self, rng: &mut R) -> bool
Runs one iteration. Returns whether a node was added.
Sourcepub fn run<R: Rng + ?Sized>(&mut self, iterations: usize, rng: &mut R)
pub fn run<R: Rng + ?Sized>(&mut self, iterations: usize, rng: &mut R)
Runs iterations iterations.
Sourcepub fn solve<R: Rng + ?Sized>(
&mut self,
max_iterations: usize,
rng: &mut R,
) -> Option<Path<Sp::State>>
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.
Sourcepub fn best_path(&self) -> Option<Path<Sp::State>>
pub fn best_path(&self) -> Option<Path<Sp::State>>
The cheapest path found so far, or None if the goal was not reached yet.
Sourcepub fn node_count(&self) -> usize
pub fn node_count(&self) -> usize
The number of tree nodes, including the root.
Trait Implementations§
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> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more