pub struct TraversalEngine {
pub num_nodes: usize,
pub root: usize,
pub graph: RelationshipGraph,
pub budget: Budget,
pub visited: Vec<Marker>,
pub accepted: Accumulator<usize>,
pub queue: Buffer<usize>,
}Expand description
Budgeted traversal assembled from reusable structures and connective owners.
Fields§
§num_nodes: usizeNumber of nodes in the fixed universe.
root: usizeRoot node admitted into the initial frontier.
graph: RelationshipGraphRelationship owner.
budget: BudgetTraversal-cost owner.
visited: Vec<Marker>Per-node visited markers.
accepted: Accumulator<usize>Owner of accepted traversal results.
queue: Buffer<usize>Frontier owner.
Implementations§
Source§impl TraversalEngine
impl TraversalEngine
Sourcepub fn new(num_nodes: usize, root: usize, max_budget: u64) -> TraversalEngine
pub fn new(num_nodes: usize, root: usize, max_budget: u64) -> TraversalEngine
Load the target graph through RelationshipGraph, then initialize the connective owners.
Sourcepub fn budget_remaining(&self) -> u64
pub fn budget_remaining(&self) -> u64
Remaining capacity projected from the Budget owner.
Sourcepub fn queue_contains(&self, node: usize) -> bool
pub fn queue_contains(&self, node: usize) -> bool
Whether the frontier currently retains node.
Sourcepub fn visited_contains(&self, node: usize) -> bool
pub fn visited_contains(&self, node: usize) -> bool
Whether node has been visited.
Sourcepub fn accepted_contains(&self, node: usize) -> bool
pub fn accepted_contains(&self, node: usize) -> bool
Whether node was accepted into the result.
Sourcepub fn can_terminate(&self) -> bool
pub fn can_terminate(&self) -> bool
Whether terminal stuttering is enabled.
Sourcepub fn visited_count(&self) -> usize
pub fn visited_count(&self) -> usize
Number of set visited markers, derived without a duplicate counter.
Sourcepub fn visit_node(&mut self, node: usize)
pub fn visit_node(&mut self, node: usize)
Visit one queued node and atomically couple acceptance to Budget allocation.
Auto Trait Implementations§
impl Freeze for TraversalEngine
impl RefUnwindSafe for TraversalEngine
impl Send for TraversalEngine
impl Sync for TraversalEngine
impl Unpin for TraversalEngine
impl UnsafeUnpin for TraversalEngine
impl UnwindSafe for TraversalEngine
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