MotionPlanner

Struct MotionPlanner 

Source
pub struct MotionPlanner<'a> { /* private fields */ }
Expand description

Motion planning algorithm for finding optimal paths in the Tonnetz

Implementations§

Source§

impl<'a> MotionPlanner<'a>

Source

pub fn new(tonnetz: &'a Tonnetz) -> Self

Create a new motion planner for the given tonnetz

Source

pub fn set_max_depth(&mut self, depth: usize)

Set the maximum search depth

Source

pub fn set_max_paths(&mut self, paths: usize)

Set the maximum number of paths to find

Source

pub fn with_max_depth(self, depth: usize) -> Self

consumes the current instance to create another with the given maximum depth

Source

pub fn with_max_paths(self, paths: usize) -> Self

consumes the current instance to create another with the given maximum number of paths

Source

pub const fn cache(&self) -> &PathCache

returns an immutable reference to the cache

Source

pub fn cache_mut(&mut self) -> &mut PathCache

returns a mutable reference to the cache

Source

pub fn find_paths_to_pitch( &mut self, start_edge: EdgeId, target_pitch: usize, ) -> Vec<Path>

find a set of paths from one triad to one that contains the target pitch

Source

pub fn find_paths_between_edges( &mut self, start_edge: EdgeId, goal_edge: EdgeId, ) -> Vec<Path>

Search for paths between two specific edges in the tonnetz

Source

pub fn search_from( &self, start_triad: Triad, target_pitch: usize, transforms: Vec<LPR>, triads: Vec<Triad>, edge_ids: Vec<Option<EdgeId>>, max_paths: usize, remaining_depth: usize, ) -> Vec<Path>

Find paths from a specified edge by continuing search from a given state Used for parallel search implementations

Auto Trait Implementations§

§

impl<'a> Freeze for MotionPlanner<'a>

§

impl<'a> RefUnwindSafe for MotionPlanner<'a>

§

impl<'a> Send for MotionPlanner<'a>

§

impl<'a> Sync for MotionPlanner<'a>

§

impl<'a> Unpin for MotionPlanner<'a>

§

impl<'a> UnwindSafe for MotionPlanner<'a>

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> 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> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts 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
Source§

impl<Idx, T> IntoIndex<Idx> for T
where T: Into<Index<Idx>>,

Source§

fn into_index(self) -> Index<Idx>

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.