pub struct TreeFront<C, const N: usize> { /* private fields */ }Expand description
A Pareto frontier of N-objective cost vectors in a balanced tree.
Holds the same points as Front and answers the same
queries, but with sublinear typical cost for many objectives; see the
module documentation. Prefer Front for one to three
objectives, where its sorted Vec is faster.
§Examples
use multiobjective_search::TreeFront;
let mut front = TreeFront::new();
assert!(front.insert([1_u32, 2, 3, 4]));
assert!(front.insert([4, 3, 2, 1]));
assert!(!front.insert([4, 4, 4, 4])); // dominated by both
assert!(front.insert([1, 2, 3, 3])); // replaces [1, 2, 3, 4]
assert_eq!(front.to_vec(), [[1, 2, 3, 3], [4, 3, 2, 1]]);
assert!(front.weakly_dominates(&[5, 5, 5, 5]));Implementations§
Source§impl<C: Cost, const N: usize> TreeFront<C, N>
impl<C: Cost, const N: usize> TreeFront<C, N>
Sourcepub fn weakly_dominates(&self, point: &[C; N]) -> bool
pub fn weakly_dominates(&self, point: &[C; N]) -> bool
Returns true if some point on the frontier is no worse than point
in every objective, equality included.
Trait Implementations§
impl<C: Cost, const N: usize> Eq for TreeFront<C, N>
Auto Trait Implementations§
impl<C, const N: usize> Forget for TreeFront<C, N>
impl<C, const N: usize> Freeze for TreeFront<C, N>
impl<C, const N: usize> Move for TreeFront<C, N>
impl<C, const N: usize> RefUnwindSafe for TreeFront<C, N>where
Vec<TreeNode<C, N>>: RefUnwindSafe,
impl<C, const N: usize> Send for TreeFront<C, N>
impl<C, const N: usize> Sync for TreeFront<C, N>
impl<C, const N: usize> Unpin for TreeFront<C, N>
impl<C, const N: usize> UnsafeUnpin for TreeFront<C, N>where
Vec<TreeNode<C, N>>: UnsafeUnpin,
impl<C, const N: usize> UnwindSafe for TreeFront<C, N>where
Vec<TreeNode<C, 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