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>
impl<Sp, Sa, C, St> RrtStar<Sp, Sa, C, St>
Sourcepub fn new(
problem: Problem<Sp, Sa, C, St>,
config: RrtStarConfig,
) -> Result<Self, Error>
pub fn new( problem: Problem<Sp, Sa, C, St>, config: RrtStarConfig, ) -> 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].Error::InvalidGammaifgammais not positive and finite while no k-nearest constant is set, or the k-nearest constant is not positive and finite.Error::InvalidMaxRadiusifmax_radiusis not positive.
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>,
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>,
Sourcepub fn with_nearest_neighbors(
problem: Problem<Sp, Sa, C, St>,
config: RrtStarConfig,
nn: N,
) -> Result<Self, Error>
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
Error::InvalidStartif the start state is not valid.Error::GoalBiasOutOfRangeif the goal bias is not in[0, 1].Error::InvalidGammaifgammais not positive and finite while no k-nearest constant is set, or the k-nearest constant is not positive and finite.Error::InvalidMaxRadiusifmax_radiusis not positive.
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 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 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> 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