mod catalog

module catalog

Event catalogue keyed by local topology. Event catalogue keyed by local topology, after k-ART.

An event is a landing produced from a local key. The first time a key is seen it is unsaturated. Each later visit is allowed 1 + floor(log2 n) searches in total, so extras arrive when n crosses the next power of two. That is the k-ART log n schedule without a search-count knob.

Recycle: a (from, to) pair already in the catalogue is not a new event.

Structs and Unions

struct Catalog

Catalogue of local-topology events.

Implementations

impl Catalog

Functions

fn due_key(&self) -> Option<u64>

A visited key that still owes a search.

fn event_count(&self) -> usize

Distinct events stored.

fn get(&self, key: u64) -> Option<&TopologyRecord>

Borrow the record for key.

fn key_count(&self) -> usize

Distinct local keys visited.

fn keys_due(&self) -> Vec<u64>

Every visited key that still owes a search.

fn known(&self, from: u64, to: u64) -> bool

Whether (from, to) is already a known event.

fn new() -> Self

Empty catalogue.

fn observe_bag(&mut self, keys: &[u64])

Record a visit for every key in a bag.

fn observe_visit(&mut self, key: u64)

Record that key appears on the current structure.

Pay one search from from. landing is None when the search failed to leave. Returns whether a new event was stored.

fn total_searches(&self) -> u64

Residual searches paid across all keys.

fn unsaturated(&self, key: u64) -> bool

Whether key still owes a search.

fn unsaturated_in(&self, keys: &[u64]) -> Option<u64>

A local key in keys that still owes a search, if any.

struct Event

One recorded exit from a local topology.

from: u64

Local key the search started from.

to: u64

Local key of the same atom (or the bag) after the landing.

dest_energy: f64

Quenched energy of the landing, when known.

struct TopologyRecord

What the catalogue knows about one local key.

seen: u64

Times this key has been seen on a structure the search stood on.

searches: u64

Fresh searches paid for this key.

events: Vec<Event>

Distinct landings.

Implementations

impl TopologyRecord

Functions

fn due(&self) -> u64

Searches still owed.

fn search_entitlement(seen: u64) -> u64

Searches this key is entitled to after seen visits.

fn unsaturated(&self) -> bool

Whether a residual search should still be paid.