Skip to main content

TraversalEngine

Struct TraversalEngine 

Source
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: usize

Number of nodes in the fixed universe.

§root: usize

Root node admitted into the initial frontier.

§graph: RelationshipGraph

Relationship owner.

§budget: Budget

Traversal-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

Source

pub fn new(num_nodes: usize, root: usize, max_budget: u64) -> TraversalEngine

Load the target graph through RelationshipGraph, then initialize the connective owners.

Source

pub fn budget_remaining(&self) -> u64

Remaining capacity projected from the Budget owner.

Source

pub fn queue_contains(&self, node: usize) -> bool

Whether the frontier currently retains node.

Source

pub fn visited_contains(&self, node: usize) -> bool

Whether node has been visited.

Source

pub fn accepted_contains(&self, node: usize) -> bool

Whether node was accepted into the result.

Source

pub fn can_visit(&self, node: usize) -> bool

Whether visiting node is currently enabled.

Source

pub fn can_skip(&self, node: usize) -> bool

Whether skipping node is currently enabled.

Source

pub fn can_terminate(&self) -> bool

Whether terminal stuttering is enabled.

Source

pub fn visited_count(&self) -> usize

Number of set visited markers, derived without a duplicate counter.

Source

pub fn visit_node(&mut self, node: usize)

Visit one queued node and atomically couple acceptance to Budget allocation.

Source

pub fn skip(&mut self, node: usize)

Remove one queued node without visiting or charging it.

Source

pub fn terminate(&mut self)

Enabled-at-empty traversal termination is an exact stutter.

Auto Trait Implementations§

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, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

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.