pub struct AdvancedTipSelection { /* private fields */ }Expand description
Advanced tip selection implementation with MCMC and weighted selection
Implementations§
Source§impl AdvancedTipSelection
impl AdvancedTipSelection
Sourcepub fn new(
config: TipSelectionConfig,
algorithm: ParentSelectionAlgorithm,
) -> Self
pub fn new( config: TipSelectionConfig, algorithm: ParentSelectionAlgorithm, ) -> Self
Create a new advanced tip selection instance
Sourcepub fn add_vertex(&mut self, vertex: &Vertex) -> Result<(), TipSelectionError>
pub fn add_vertex(&mut self, vertex: &Vertex) -> Result<(), TipSelectionError>
Add a vertex to the DAG structure
Trait Implementations§
Source§impl TipSelection for AdvancedTipSelection
impl TipSelection for AdvancedTipSelection
Source§fn init(config: TipSelectionConfig) -> Result<(), TipSelectionError>
fn init(config: TipSelectionConfig) -> Result<(), TipSelectionError>
Initialize tip selection with configuration.
Source§fn select_tips(&self) -> Result<Vec<VertexId>, TipSelectionError>
fn select_tips(&self) -> Result<Vec<VertexId>, TipSelectionError>
Select tips for a new vertex.
Source§fn is_valid_tip(&self, vertex: &Vertex) -> bool
fn is_valid_tip(&self, vertex: &Vertex) -> bool
Check if a vertex is eligible as a tip.
Source§fn calculate_confidence(&self, tip: &VertexId) -> f64
fn calculate_confidence(&self, tip: &VertexId) -> f64
Calculate confidence score for a tip.
Source§fn update_tips(&mut self, vertex: &Vertex) -> Result<(), TipSelectionError>
fn update_tips(&mut self, vertex: &Vertex) -> Result<(), TipSelectionError>
Update tip pool with new vertex.
Auto Trait Implementations§
impl Freeze for AdvancedTipSelection
impl RefUnwindSafe for AdvancedTipSelection
impl Send for AdvancedTipSelection
impl Sync for AdvancedTipSelection
impl Unpin for AdvancedTipSelection
impl UnwindSafe for AdvancedTipSelection
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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>
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 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>
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