Skip to main content

PropagationPass

Struct PropagationPass 

Source
pub struct PropagationPass { /* private fields */ }
Expand description

A snapshot-local bounded propagation pass.

§Examples

use automation_structures::PropagationPass;

let mut pass = PropagationPass::new(1, 9, vec![(0, 1)], vec![0, 1])?;
pass.start_round()?;
pass.update_node(0)?;
pass.update_node(1)?;
pass.end_round()?;
assert_eq!(pass.values(), &[0, 0]);

Implementations§

Source§

impl PropagationPass

Source

pub fn new( max_iterations: u64, max_value: u64, edges: Vec<(usize, usize)>, initial_values: Vec<u64>, ) -> Result<Self, PropagationBuildError>

Validate and construct a pass. The node universe is the initial value length.

§Errors

Returns PropagationBuildError when a value exceeds max_value or an edge endpoint is absent.

Examples found in repository?
examples/catalog.rs (line 57)
21fn main() -> Result<(), Box<dyn Error>> {
22    // Primitives.
23    let mut budget = Budget::new(8);
24    assert!(budget.try_reserve(3));
25    budget.commit_reservation(3)?;
26
27    let mut hierarchy = QualityHierarchy::new(2, 2);
28    hierarchy.set_node_properties(0, 2, 1)?;
29    hierarchy.set_node_properties(1, 1, 2)?;
30    hierarchy.add_child(0, 1)?;
31
32    let mut registry = ResourceRegistry::new();
33    registry.insert(1, 10);
34    assert_eq!(registry.get(1), Some(10));
35
36    let mut hard = CompetitiveSelectionHard::new(2)?;
37    hard.update_score(0, 2)?;
38    hard.update_score(1, 1)?;
39    assert_eq!(hard.evaluate(), 0);
40
41    let mut exclusive = CompetitiveSelectionHardExclusive::new(1, 2, 2)?;
42    exclusive.update_score(0, 0, 2)?;
43    exclusive.update_score(0, 1, 1)?;
44    assert_eq!(exclusive.evaluate(0)?, 0);
45
46    let mut soft = CompetitiveSelectionSoft::begin(vec![3, 1], 4, 3)?;
47    assert_eq!(soft.assign_next()?, 0);
48
49    let mut ranked = CompetitiveSelectionRanked::new(vec![2, 1], 1, 2)?;
50    ranked.select();
51    assert_eq!(ranked.is_selected(0), Some(true));
52
53    let mut actuation = ActuationPass::new(vec![Some(7)]);
54    actuation.actuate(0)?;
55    actuation.finish()?;
56
57    let mut propagation = PropagationPass::new(1, 2, vec![], vec![0])?;
58    propagation.start_round()?;
59    propagation.update_node(0)?;
60    propagation.end_round()?;
61
62    let mut convergence = ConvergenceGovernor::new(2, 6, 2, 10)?;
63    assert_eq!(convergence.update(1)?, 1);
64
65    let mut audit = AuditSink::new(1);
66    assert!(audit.try_record(7));
67    assert!(audit.validate());
68
69    let mut backtracking = BacktrackingTraversal::new(2, 1, 0)?;
70    backtracking.descend(1, 1)?;
71    backtracking.visit()?;
72
73    // Named compositions.
74    let mut snapshot = AllocationSnapshot::new(3, 1);
75    snapshot.accept(0, 3)?;
76
77    let mut federated = FederatedBudget::new(4, 1);
78    assert!(federated.try_delegate(0, 4));
79    assert!(federated.try_allocate(0, 2));
80
81    let mut bisection = Bisection::new(4, 2)?;
82    bisection.converge();
83    assert!(bisection.is_converged());
84
85    let mut classes = EquivalenceClass::new(2, 1);
86    assert!(classes.union(0, 1)?);
87
88    let mut rate_limit = RateLimit::new(1, 1, 1)?;
89    assert!(rate_limit.try_acquire());
90
91    let mut reduction = Reduction::new(vec![2, 3])?;
92    reduction.process_next()?;
93
94    let mut graph = RelationshipGraph::new(2, 1);
95    assert!(graph.add_edge(0, 1, 1)?);
96
97    let mut sampler = Sampler::new(vec![1, 1], 1);
98    sampler.sample(0)?;
99
100    let mut select_then_actuate = SelectThenActuate::new(1, 2)?;
101    select_then_actuate.update_score(0, 0, 1)?;
102    assert_eq!(select_then_actuate.evaluate(0)?, 0);
103    select_then_actuate.actuate(0)?;
104    select_then_actuate.finish()?;
105
106    let mut signal = Signal::new(0, 2, 1)?;
107    assert!(signal.set_value(1)?);
108    signal.notify(0)?;
109
110    let mut traversal = TraversalEngine::new(1, 0, 1)?;
111    traversal.visit(0)?;
112    traversal.terminate()?;
113
114    // Execution modalities.
115    let mut sequential = Sequential::new(1, 2, 0)?;
116    assert!(sequential.begin_step());
117    assert!(sequential.complete_step(1));
118
119    let mut fork_join = ForkJoin::new(1, 2, 0)?;
120    assert!(fork_join.start_worker(0));
121    assert!(fork_join.complete_worker(0, 1));
122    assert!(fork_join.barrier());
123    assert!(fork_join.produce_output());
124
125    let mut step_graph = StepGraph::new(1, vec![])?;
126    assert!(step_graph.start(0));
127    assert!(step_graph.complete(0));
128
129    let mut stream_graph = StreamGraph::new(3, 1, 1, 2)?;
130    assert!(stream_graph.ingest(1));
131    assert!(stream_graph.advance_first());
132    assert_eq!(stream_graph.consume(), Some(1));
133
134    // Connective roles.
135    let mut cursor = Cursor::new(0);
136    cursor.advance_to(1)?;
137
138    let mut accumulator = Accumulator::new(vec![1]);
139    assert_eq!(accumulator.advance(), Some(1));
140    assert_eq!(accumulator.accumulated(0), Some(1));
141
142    let mut marker = Marker::new(false);
143    assert!(marker.set());
144
145    let mut counter = Counter::new(0);
146    assert!(counter.try_increment());
147
148    let mut buffer = Buffer::new(1);
149    assert_eq!(buffer.push(1), Ok(()));
150    assert_eq!(buffer.pop(), Some(1));
151
152    assert!(projection_consistent(true, true));
153    assert!(strictly_before(0, 1));
154
155    assert_debuggable!(
156        budget,
157        hierarchy,
158        registry,
159        hard,
160        exclusive,
161        soft,
162        ranked,
163        actuation,
164        propagation,
165        convergence,
166        audit,
167        backtracking,
168        snapshot,
169        federated,
170        bisection,
171        classes,
172        rate_limit,
173        reduction,
174        graph,
175        sampler,
176        select_then_actuate,
177        signal,
178        traversal,
179        sequential,
180        fork_join,
181        step_graph,
182        stream_graph,
183        cursor,
184        accumulator,
185        marker,
186        counter,
187        buffer,
188    );
189
190    println!("all public automation structures constructed and exercised");
191    Ok(())
192}
Source

pub fn num_nodes(&self) -> usize

Number of admitted nodes.

Source

pub fn max_iterations(&self) -> u64

Maximum charged rounds.

Source

pub fn max_value(&self) -> u64

Largest admitted node value.

Source

pub fn iteration(&self) -> u64

Number of completed rounds.

Source

pub fn round(&self) -> PropagationRound

Current round phase.

Source

pub fn changed(&self) -> bool

Whether the previous completed round changed a value.

Source

pub fn value(&self, node: usize) -> Option<u64>

Read a current node value.

Source

pub fn snapshot_value(&self, node: usize) -> Option<u64>

Read the round-start value for a node.

Source

pub fn node_updated(&self, node: usize) -> Option<bool>

Whether a node has committed its update in the current round.

Source

pub fn start_round(&mut self) -> Result<(), PropagationError>

Begin a new snapshot round.

§Errors

Returns PropagationError when a round is active or the pass has terminated.

Examples found in repository?
examples/catalog.rs (line 58)
21fn main() -> Result<(), Box<dyn Error>> {
22    // Primitives.
23    let mut budget = Budget::new(8);
24    assert!(budget.try_reserve(3));
25    budget.commit_reservation(3)?;
26
27    let mut hierarchy = QualityHierarchy::new(2, 2);
28    hierarchy.set_node_properties(0, 2, 1)?;
29    hierarchy.set_node_properties(1, 1, 2)?;
30    hierarchy.add_child(0, 1)?;
31
32    let mut registry = ResourceRegistry::new();
33    registry.insert(1, 10);
34    assert_eq!(registry.get(1), Some(10));
35
36    let mut hard = CompetitiveSelectionHard::new(2)?;
37    hard.update_score(0, 2)?;
38    hard.update_score(1, 1)?;
39    assert_eq!(hard.evaluate(), 0);
40
41    let mut exclusive = CompetitiveSelectionHardExclusive::new(1, 2, 2)?;
42    exclusive.update_score(0, 0, 2)?;
43    exclusive.update_score(0, 1, 1)?;
44    assert_eq!(exclusive.evaluate(0)?, 0);
45
46    let mut soft = CompetitiveSelectionSoft::begin(vec![3, 1], 4, 3)?;
47    assert_eq!(soft.assign_next()?, 0);
48
49    let mut ranked = CompetitiveSelectionRanked::new(vec![2, 1], 1, 2)?;
50    ranked.select();
51    assert_eq!(ranked.is_selected(0), Some(true));
52
53    let mut actuation = ActuationPass::new(vec![Some(7)]);
54    actuation.actuate(0)?;
55    actuation.finish()?;
56
57    let mut propagation = PropagationPass::new(1, 2, vec![], vec![0])?;
58    propagation.start_round()?;
59    propagation.update_node(0)?;
60    propagation.end_round()?;
61
62    let mut convergence = ConvergenceGovernor::new(2, 6, 2, 10)?;
63    assert_eq!(convergence.update(1)?, 1);
64
65    let mut audit = AuditSink::new(1);
66    assert!(audit.try_record(7));
67    assert!(audit.validate());
68
69    let mut backtracking = BacktrackingTraversal::new(2, 1, 0)?;
70    backtracking.descend(1, 1)?;
71    backtracking.visit()?;
72
73    // Named compositions.
74    let mut snapshot = AllocationSnapshot::new(3, 1);
75    snapshot.accept(0, 3)?;
76
77    let mut federated = FederatedBudget::new(4, 1);
78    assert!(federated.try_delegate(0, 4));
79    assert!(federated.try_allocate(0, 2));
80
81    let mut bisection = Bisection::new(4, 2)?;
82    bisection.converge();
83    assert!(bisection.is_converged());
84
85    let mut classes = EquivalenceClass::new(2, 1);
86    assert!(classes.union(0, 1)?);
87
88    let mut rate_limit = RateLimit::new(1, 1, 1)?;
89    assert!(rate_limit.try_acquire());
90
91    let mut reduction = Reduction::new(vec![2, 3])?;
92    reduction.process_next()?;
93
94    let mut graph = RelationshipGraph::new(2, 1);
95    assert!(graph.add_edge(0, 1, 1)?);
96
97    let mut sampler = Sampler::new(vec![1, 1], 1);
98    sampler.sample(0)?;
99
100    let mut select_then_actuate = SelectThenActuate::new(1, 2)?;
101    select_then_actuate.update_score(0, 0, 1)?;
102    assert_eq!(select_then_actuate.evaluate(0)?, 0);
103    select_then_actuate.actuate(0)?;
104    select_then_actuate.finish()?;
105
106    let mut signal = Signal::new(0, 2, 1)?;
107    assert!(signal.set_value(1)?);
108    signal.notify(0)?;
109
110    let mut traversal = TraversalEngine::new(1, 0, 1)?;
111    traversal.visit(0)?;
112    traversal.terminate()?;
113
114    // Execution modalities.
115    let mut sequential = Sequential::new(1, 2, 0)?;
116    assert!(sequential.begin_step());
117    assert!(sequential.complete_step(1));
118
119    let mut fork_join = ForkJoin::new(1, 2, 0)?;
120    assert!(fork_join.start_worker(0));
121    assert!(fork_join.complete_worker(0, 1));
122    assert!(fork_join.barrier());
123    assert!(fork_join.produce_output());
124
125    let mut step_graph = StepGraph::new(1, vec![])?;
126    assert!(step_graph.start(0));
127    assert!(step_graph.complete(0));
128
129    let mut stream_graph = StreamGraph::new(3, 1, 1, 2)?;
130    assert!(stream_graph.ingest(1));
131    assert!(stream_graph.advance_first());
132    assert_eq!(stream_graph.consume(), Some(1));
133
134    // Connective roles.
135    let mut cursor = Cursor::new(0);
136    cursor.advance_to(1)?;
137
138    let mut accumulator = Accumulator::new(vec![1]);
139    assert_eq!(accumulator.advance(), Some(1));
140    assert_eq!(accumulator.accumulated(0), Some(1));
141
142    let mut marker = Marker::new(false);
143    assert!(marker.set());
144
145    let mut counter = Counter::new(0);
146    assert!(counter.try_increment());
147
148    let mut buffer = Buffer::new(1);
149    assert_eq!(buffer.push(1), Ok(()));
150    assert_eq!(buffer.pop(), Some(1));
151
152    assert!(projection_consistent(true, true));
153    assert!(strictly_before(0, 1));
154
155    assert_debuggable!(
156        budget,
157        hierarchy,
158        registry,
159        hard,
160        exclusive,
161        soft,
162        ranked,
163        actuation,
164        propagation,
165        convergence,
166        audit,
167        backtracking,
168        snapshot,
169        federated,
170        bisection,
171        classes,
172        rate_limit,
173        reduction,
174        graph,
175        sampler,
176        select_then_actuate,
177        signal,
178        traversal,
179        sequential,
180        fork_join,
181        step_graph,
182        stream_graph,
183        cursor,
184        accumulator,
185        marker,
186        counter,
187        buffer,
188    );
189
190    println!("all public automation structures constructed and exercised");
191    Ok(())
192}
Source

pub fn update_node(&mut self, node: usize) -> Result<(), PropagationError>

Commit one node’s snapshot-local update.

§Errors

Returns PropagationError for an invalid node, inactive pass, or duplicate node update.

Examples found in repository?
examples/catalog.rs (line 59)
21fn main() -> Result<(), Box<dyn Error>> {
22    // Primitives.
23    let mut budget = Budget::new(8);
24    assert!(budget.try_reserve(3));
25    budget.commit_reservation(3)?;
26
27    let mut hierarchy = QualityHierarchy::new(2, 2);
28    hierarchy.set_node_properties(0, 2, 1)?;
29    hierarchy.set_node_properties(1, 1, 2)?;
30    hierarchy.add_child(0, 1)?;
31
32    let mut registry = ResourceRegistry::new();
33    registry.insert(1, 10);
34    assert_eq!(registry.get(1), Some(10));
35
36    let mut hard = CompetitiveSelectionHard::new(2)?;
37    hard.update_score(0, 2)?;
38    hard.update_score(1, 1)?;
39    assert_eq!(hard.evaluate(), 0);
40
41    let mut exclusive = CompetitiveSelectionHardExclusive::new(1, 2, 2)?;
42    exclusive.update_score(0, 0, 2)?;
43    exclusive.update_score(0, 1, 1)?;
44    assert_eq!(exclusive.evaluate(0)?, 0);
45
46    let mut soft = CompetitiveSelectionSoft::begin(vec![3, 1], 4, 3)?;
47    assert_eq!(soft.assign_next()?, 0);
48
49    let mut ranked = CompetitiveSelectionRanked::new(vec![2, 1], 1, 2)?;
50    ranked.select();
51    assert_eq!(ranked.is_selected(0), Some(true));
52
53    let mut actuation = ActuationPass::new(vec![Some(7)]);
54    actuation.actuate(0)?;
55    actuation.finish()?;
56
57    let mut propagation = PropagationPass::new(1, 2, vec![], vec![0])?;
58    propagation.start_round()?;
59    propagation.update_node(0)?;
60    propagation.end_round()?;
61
62    let mut convergence = ConvergenceGovernor::new(2, 6, 2, 10)?;
63    assert_eq!(convergence.update(1)?, 1);
64
65    let mut audit = AuditSink::new(1);
66    assert!(audit.try_record(7));
67    assert!(audit.validate());
68
69    let mut backtracking = BacktrackingTraversal::new(2, 1, 0)?;
70    backtracking.descend(1, 1)?;
71    backtracking.visit()?;
72
73    // Named compositions.
74    let mut snapshot = AllocationSnapshot::new(3, 1);
75    snapshot.accept(0, 3)?;
76
77    let mut federated = FederatedBudget::new(4, 1);
78    assert!(federated.try_delegate(0, 4));
79    assert!(federated.try_allocate(0, 2));
80
81    let mut bisection = Bisection::new(4, 2)?;
82    bisection.converge();
83    assert!(bisection.is_converged());
84
85    let mut classes = EquivalenceClass::new(2, 1);
86    assert!(classes.union(0, 1)?);
87
88    let mut rate_limit = RateLimit::new(1, 1, 1)?;
89    assert!(rate_limit.try_acquire());
90
91    let mut reduction = Reduction::new(vec![2, 3])?;
92    reduction.process_next()?;
93
94    let mut graph = RelationshipGraph::new(2, 1);
95    assert!(graph.add_edge(0, 1, 1)?);
96
97    let mut sampler = Sampler::new(vec![1, 1], 1);
98    sampler.sample(0)?;
99
100    let mut select_then_actuate = SelectThenActuate::new(1, 2)?;
101    select_then_actuate.update_score(0, 0, 1)?;
102    assert_eq!(select_then_actuate.evaluate(0)?, 0);
103    select_then_actuate.actuate(0)?;
104    select_then_actuate.finish()?;
105
106    let mut signal = Signal::new(0, 2, 1)?;
107    assert!(signal.set_value(1)?);
108    signal.notify(0)?;
109
110    let mut traversal = TraversalEngine::new(1, 0, 1)?;
111    traversal.visit(0)?;
112    traversal.terminate()?;
113
114    // Execution modalities.
115    let mut sequential = Sequential::new(1, 2, 0)?;
116    assert!(sequential.begin_step());
117    assert!(sequential.complete_step(1));
118
119    let mut fork_join = ForkJoin::new(1, 2, 0)?;
120    assert!(fork_join.start_worker(0));
121    assert!(fork_join.complete_worker(0, 1));
122    assert!(fork_join.barrier());
123    assert!(fork_join.produce_output());
124
125    let mut step_graph = StepGraph::new(1, vec![])?;
126    assert!(step_graph.start(0));
127    assert!(step_graph.complete(0));
128
129    let mut stream_graph = StreamGraph::new(3, 1, 1, 2)?;
130    assert!(stream_graph.ingest(1));
131    assert!(stream_graph.advance_first());
132    assert_eq!(stream_graph.consume(), Some(1));
133
134    // Connective roles.
135    let mut cursor = Cursor::new(0);
136    cursor.advance_to(1)?;
137
138    let mut accumulator = Accumulator::new(vec![1]);
139    assert_eq!(accumulator.advance(), Some(1));
140    assert_eq!(accumulator.accumulated(0), Some(1));
141
142    let mut marker = Marker::new(false);
143    assert!(marker.set());
144
145    let mut counter = Counter::new(0);
146    assert!(counter.try_increment());
147
148    let mut buffer = Buffer::new(1);
149    assert_eq!(buffer.push(1), Ok(()));
150    assert_eq!(buffer.pop(), Some(1));
151
152    assert!(projection_consistent(true, true));
153    assert!(strictly_before(0, 1));
154
155    assert_debuggable!(
156        budget,
157        hierarchy,
158        registry,
159        hard,
160        exclusive,
161        soft,
162        ranked,
163        actuation,
164        propagation,
165        convergence,
166        audit,
167        backtracking,
168        snapshot,
169        federated,
170        bisection,
171        classes,
172        rate_limit,
173        reduction,
174        graph,
175        sampler,
176        select_then_actuate,
177        signal,
178        traversal,
179        sequential,
180        fork_join,
181        step_graph,
182        stream_graph,
183        cursor,
184        accumulator,
185        marker,
186        counter,
187        buffer,
188    );
189
190    println!("all public automation structures constructed and exercised");
191    Ok(())
192}
Source

pub fn end_round(&mut self) -> Result<(), PropagationError>

Finish a fully updated round and charge one iteration.

§Errors

Returns PropagationError unless every node was updated in the active round.

Examples found in repository?
examples/catalog.rs (line 60)
21fn main() -> Result<(), Box<dyn Error>> {
22    // Primitives.
23    let mut budget = Budget::new(8);
24    assert!(budget.try_reserve(3));
25    budget.commit_reservation(3)?;
26
27    let mut hierarchy = QualityHierarchy::new(2, 2);
28    hierarchy.set_node_properties(0, 2, 1)?;
29    hierarchy.set_node_properties(1, 1, 2)?;
30    hierarchy.add_child(0, 1)?;
31
32    let mut registry = ResourceRegistry::new();
33    registry.insert(1, 10);
34    assert_eq!(registry.get(1), Some(10));
35
36    let mut hard = CompetitiveSelectionHard::new(2)?;
37    hard.update_score(0, 2)?;
38    hard.update_score(1, 1)?;
39    assert_eq!(hard.evaluate(), 0);
40
41    let mut exclusive = CompetitiveSelectionHardExclusive::new(1, 2, 2)?;
42    exclusive.update_score(0, 0, 2)?;
43    exclusive.update_score(0, 1, 1)?;
44    assert_eq!(exclusive.evaluate(0)?, 0);
45
46    let mut soft = CompetitiveSelectionSoft::begin(vec![3, 1], 4, 3)?;
47    assert_eq!(soft.assign_next()?, 0);
48
49    let mut ranked = CompetitiveSelectionRanked::new(vec![2, 1], 1, 2)?;
50    ranked.select();
51    assert_eq!(ranked.is_selected(0), Some(true));
52
53    let mut actuation = ActuationPass::new(vec![Some(7)]);
54    actuation.actuate(0)?;
55    actuation.finish()?;
56
57    let mut propagation = PropagationPass::new(1, 2, vec![], vec![0])?;
58    propagation.start_round()?;
59    propagation.update_node(0)?;
60    propagation.end_round()?;
61
62    let mut convergence = ConvergenceGovernor::new(2, 6, 2, 10)?;
63    assert_eq!(convergence.update(1)?, 1);
64
65    let mut audit = AuditSink::new(1);
66    assert!(audit.try_record(7));
67    assert!(audit.validate());
68
69    let mut backtracking = BacktrackingTraversal::new(2, 1, 0)?;
70    backtracking.descend(1, 1)?;
71    backtracking.visit()?;
72
73    // Named compositions.
74    let mut snapshot = AllocationSnapshot::new(3, 1);
75    snapshot.accept(0, 3)?;
76
77    let mut federated = FederatedBudget::new(4, 1);
78    assert!(federated.try_delegate(0, 4));
79    assert!(federated.try_allocate(0, 2));
80
81    let mut bisection = Bisection::new(4, 2)?;
82    bisection.converge();
83    assert!(bisection.is_converged());
84
85    let mut classes = EquivalenceClass::new(2, 1);
86    assert!(classes.union(0, 1)?);
87
88    let mut rate_limit = RateLimit::new(1, 1, 1)?;
89    assert!(rate_limit.try_acquire());
90
91    let mut reduction = Reduction::new(vec![2, 3])?;
92    reduction.process_next()?;
93
94    let mut graph = RelationshipGraph::new(2, 1);
95    assert!(graph.add_edge(0, 1, 1)?);
96
97    let mut sampler = Sampler::new(vec![1, 1], 1);
98    sampler.sample(0)?;
99
100    let mut select_then_actuate = SelectThenActuate::new(1, 2)?;
101    select_then_actuate.update_score(0, 0, 1)?;
102    assert_eq!(select_then_actuate.evaluate(0)?, 0);
103    select_then_actuate.actuate(0)?;
104    select_then_actuate.finish()?;
105
106    let mut signal = Signal::new(0, 2, 1)?;
107    assert!(signal.set_value(1)?);
108    signal.notify(0)?;
109
110    let mut traversal = TraversalEngine::new(1, 0, 1)?;
111    traversal.visit(0)?;
112    traversal.terminate()?;
113
114    // Execution modalities.
115    let mut sequential = Sequential::new(1, 2, 0)?;
116    assert!(sequential.begin_step());
117    assert!(sequential.complete_step(1));
118
119    let mut fork_join = ForkJoin::new(1, 2, 0)?;
120    assert!(fork_join.start_worker(0));
121    assert!(fork_join.complete_worker(0, 1));
122    assert!(fork_join.barrier());
123    assert!(fork_join.produce_output());
124
125    let mut step_graph = StepGraph::new(1, vec![])?;
126    assert!(step_graph.start(0));
127    assert!(step_graph.complete(0));
128
129    let mut stream_graph = StreamGraph::new(3, 1, 1, 2)?;
130    assert!(stream_graph.ingest(1));
131    assert!(stream_graph.advance_first());
132    assert_eq!(stream_graph.consume(), Some(1));
133
134    // Connective roles.
135    let mut cursor = Cursor::new(0);
136    cursor.advance_to(1)?;
137
138    let mut accumulator = Accumulator::new(vec![1]);
139    assert_eq!(accumulator.advance(), Some(1));
140    assert_eq!(accumulator.accumulated(0), Some(1));
141
142    let mut marker = Marker::new(false);
143    assert!(marker.set());
144
145    let mut counter = Counter::new(0);
146    assert!(counter.try_increment());
147
148    let mut buffer = Buffer::new(1);
149    assert_eq!(buffer.push(1), Ok(()));
150    assert_eq!(buffer.pop(), Some(1));
151
152    assert!(projection_consistent(true, true));
153    assert!(strictly_before(0, 1));
154
155    assert_debuggable!(
156        budget,
157        hierarchy,
158        registry,
159        hard,
160        exclusive,
161        soft,
162        ranked,
163        actuation,
164        propagation,
165        convergence,
166        audit,
167        backtracking,
168        snapshot,
169        federated,
170        bisection,
171        classes,
172        rate_limit,
173        reduction,
174        graph,
175        sampler,
176        select_then_actuate,
177        signal,
178        traversal,
179        sequential,
180        fork_join,
181        step_graph,
182        stream_graph,
183        cursor,
184        accumulator,
185        marker,
186        counter,
187        buffer,
188    );
189
190    println!("all public automation structures constructed and exercised");
191    Ok(())
192}
Source

pub fn terminate(&mut self) -> Result<(), PropagationError>

Confirm the terminal self-loop at settlement or the iteration ceiling.

§Errors

Returns PropagationError while a round is active or the pass is not terminal.

Source§

impl PropagationPass

Source

pub fn edges(&self) -> &[(usize, usize)]

Borrow directed propagation edges in configured order.

Source

pub fn values(&self) -> &[u64]

Borrow the current node values.

Source

pub fn snapshot_values(&self) -> &[u64]

Borrow the snapshot captured for the current or latest round.

Source

pub fn updated_nodes(&self) -> &[bool]

Borrow the per-node update markers for the current or latest round.

Trait Implementations§

Source§

impl Debug for PropagationPass

Source§

fn fmt(&self, formatter: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

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.