pub struct MotionPlanner<'a, T = usize>{ /* private fields */ }Expand description
The MotionPlanner is a pathfinding algorithm implementation for finding the chain of
transformations between two triads along the surface of the hyper-tonnetz.
Implementations§
Source§impl<'a, T> MotionPlanner<'a, T>
impl<'a, T> MotionPlanner<'a, T>
Sourcepub fn new(tonnetz: &'a HyperTonnetz<[T; 3], Triads, T>) -> MotionPlanner<'a, T>
pub fn new(tonnetz: &'a HyperTonnetz<[T; 3], Triads, T>) -> MotionPlanner<'a, T>
Create a new motion planner for the given tonnetz
Sourcepub const fn cache_mut(&mut self) -> &mut PathCache<T>
pub const fn cache_mut(&mut self) -> &mut PathCache<T>
returns a mutable reference to the cache
Sourcepub const fn config(&self) -> &MotionPlannerConfig
pub const fn config(&self) -> &MotionPlannerConfig
returns an immutable reference to the configuration of the planner
Sourcepub const fn config_mut(&mut self) -> &mut MotionPlannerConfig
pub const fn config_mut(&mut self) -> &mut MotionPlannerConfig
returns a mutable reference to the configuration of the planner
Sourcepub const fn tonnetz(&self) -> &HyperTonnetz<[T; 3], Triads, T>
pub const fn tonnetz(&self) -> &HyperTonnetz<[T; 3], Triads, T>
returns an immutable reference to the tonnetz
Sourcepub fn set_config(
&mut self,
config: MotionPlannerConfig,
) -> &mut MotionPlanner<'a, T>
pub fn set_config( &mut self, config: MotionPlannerConfig, ) -> &mut MotionPlanner<'a, T>
updates the current configuration and returns a mutable reference to the instance.
Sourcepub fn set_max_depth(&mut self, depth: usize) -> &mut MotionPlanner<'a, T>
pub fn set_max_depth(&mut self, depth: usize) -> &mut MotionPlanner<'a, T>
set the maximum depth for pathfinding
Sourcepub fn set_max_paths(&mut self, paths: usize) -> &mut MotionPlanner<'a, T>
pub fn set_max_paths(&mut self, paths: usize) -> &mut MotionPlanner<'a, T>
set the maximum number of paths to find
Sourcepub fn with_max_depth(self, depth: usize) -> MotionPlanner<'a, T>
pub fn with_max_depth(self, depth: usize) -> MotionPlanner<'a, T>
consumes the current instance to create another with the given maximum depth
Sourcepub fn with_max_paths(self, paths: usize) -> MotionPlanner<'a, T>
pub fn with_max_paths(self, paths: usize) -> MotionPlanner<'a, T>
consumes the current instance to create another with the given maximum number of paths
Source§impl<'a, T> MotionPlanner<'a, T>
impl<'a, T> MotionPlanner<'a, T>
Sourcepub fn find_paths_to_pitch(
&mut self,
start_edge: IndexBase<usize, EdgeIndex>,
target_pitch: T,
) -> Vec<Path<T>>
pub fn find_paths_to_pitch( &mut self, start_edge: IndexBase<usize, EdgeIndex>, target_pitch: T, ) -> Vec<Path<T>>
find a set of paths from one triad to one that contains the target pitch
Sourcepub fn find_paths_between_edges(
&mut self,
start_edge: IndexBase<usize, EdgeIndex>,
goal_edge: IndexBase<usize, EdgeIndex>,
) -> Vec<Path<T>>
pub fn find_paths_between_edges( &mut self, start_edge: IndexBase<usize, EdgeIndex>, goal_edge: IndexBase<usize, EdgeIndex>, ) -> Vec<Path<T>>
Search for paths between two specific edges in the tonnetz
Sourcepub fn search_from(
&self,
start_triad: TriadBase<[T; 3], Triads, T>,
target_pitch: T,
transforms: Vec<LPR>,
triads: Vec<TriadBase<[T; 3], Triads, T>>,
edge_ids: Vec<Option<IndexBase<usize, EdgeIndex>>>,
max_paths: usize,
remaining_depth: usize,
) -> Vec<Path<T>>
pub fn search_from( &self, start_triad: TriadBase<[T; 3], Triads, T>, target_pitch: T, transforms: Vec<LPR>, triads: Vec<TriadBase<[T; 3], Triads, T>>, edge_ids: Vec<Option<IndexBase<usize, EdgeIndex>>>, max_paths: usize, remaining_depth: usize, ) -> Vec<Path<T>>
Find paths from a specified edge by continuing search from a given state Used for parallel search implementations
Auto Trait Implementations§
impl<'a, T> Freeze for MotionPlanner<'a, T>
impl<'a, T> RefUnwindSafe for MotionPlanner<'a, T>where
T: RefUnwindSafe,
impl<'a, T> Send for MotionPlanner<'a, T>
impl<'a, T> Sync for MotionPlanner<'a, T>where
T: Sync,
impl<'a, T> Unpin for MotionPlanner<'a, T>where
T: Unpin,
impl<'a, T> UnwindSafe for MotionPlanner<'a, T>where
T: UnwindSafe + RefUnwindSafe,
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
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more