pub struct HypothesisGraph {
pub nodes: BTreeMap<String, HypothesisNode>,
pub revisions: Vec<HypothesisRevision>,
pub subscribers: BTreeMap<String, Vec<String>>,
}Expand description
The hypothesis graph — multi-agent collaborative structure.
Fields§
§nodes: BTreeMap<String, HypothesisNode>§revisions: Vec<HypothesisRevision>§subscribers: BTreeMap<String, Vec<String>>Implementations§
Source§impl HypothesisGraph
impl HypothesisGraph
Sourcepub fn create(&mut self, node: HypothesisNode)
pub fn create(&mut self, node: HypothesisNode)
Inserts node into the graph keyed by its id.
Sourcepub fn add_to_graph(&mut self, node_id: &str, evaluation: Evaluation) -> bool
pub fn add_to_graph(&mut self, node_id: &str, evaluation: Evaluation) -> bool
Attaches evaluation to node node_id; false when unknown.
Sourcepub fn contribute_evaluation(
&mut self,
node_id: &str,
evaluation: Evaluation,
) -> bool
pub fn contribute_evaluation( &mut self, node_id: &str, evaluation: Evaluation, ) -> bool
Records a contributed evaluation on node node_id; false when unknown.
Sourcepub fn bridge_dark_link(&mut self, node_id: &str, dark_link_id: &str) -> bool
pub fn bridge_dark_link(&mut self, node_id: &str, dark_link_id: &str) -> bool
Links node node_id to a dark-link id; false when unknown.
Sourcepub fn reframe_hypothesis(
&mut self,
node_id: &str,
new_statement: &str,
agent_id: &str,
timestamp: &str,
) -> bool
pub fn reframe_hypothesis( &mut self, node_id: &str, new_statement: &str, agent_id: &str, timestamp: &str, ) -> bool
Rewrites the node statement, marks it Reframed, and appends a HypothesisRevision; false when unknown.
Sourcepub fn merge_hypotheses(
&mut self,
node1_id: &str,
node2_id: &str,
merged_statement: &str,
agent_id: &str,
timestamp: &str,
) -> bool
pub fn merge_hypotheses( &mut self, node1_id: &str, node2_id: &str, merged_statement: &str, agent_id: &str, timestamp: &str, ) -> bool
Merges two nodes: node1 takes merged_statement, both marked Merged, and a merge revision is appended; false when either id is unknown.
Sourcepub fn flag_gap(&mut self, node_id: &str, gap: &str) -> bool
pub fn flag_gap(&mut self, node_id: &str, gap: &str) -> bool
Appends gap to the node’s gap list; false when unknown.
Sourcepub fn close_gap(&mut self, node_id: &str, gap: &str) -> bool
pub fn close_gap(&mut self, node_id: &str, gap: &str) -> bool
Removes gap; marks node Closed when no gaps remain; false when node or gap unknown.
Sourcepub fn create_revision(
&mut self,
node_id: &str,
new_statement: &str,
agent_id: &str,
timestamp: &str,
) -> Option<String>
pub fn create_revision( &mut self, node_id: &str, new_statement: &str, agent_id: &str, timestamp: &str, ) -> Option<String>
Reframes the node and returns the new revision id; None when the node is unknown.
Sourcepub fn diff_revisions(
&self,
rev1_id: &str,
rev2_id: &str,
) -> Option<(&HypothesisRevision, &HypothesisRevision)>
pub fn diff_revisions( &self, rev1_id: &str, rev2_id: &str, ) -> Option<(&HypothesisRevision, &HypothesisRevision)>
Looks up two revisions by id, returning both for comparison; None when either is missing.
Sourcepub fn subscribe_updates(&mut self, node_id: &str, agent_id: &str)
pub fn subscribe_updates(&mut self, node_id: &str, agent_id: &str)
Subscribes agent_id to updates on node node_id.
Sourcepub fn node_count(&self) -> usize
pub fn node_count(&self) -> usize
Number of nodes in the graph.
Sourcepub fn revision_count(&self) -> usize
pub fn revision_count(&self) -> usize
Number of recorded revisions.
Trait Implementations§
Source§impl Clone for HypothesisGraph
impl Clone for HypothesisGraph
Source§impl Debug for HypothesisGraph
impl Debug for HypothesisGraph
Auto Trait Implementations§
impl Freeze for HypothesisGraph
impl RefUnwindSafe for HypothesisGraph
impl Send for HypothesisGraph
impl Sync for HypothesisGraph
impl Unpin for HypothesisGraph
impl UnsafeUnpin for HypothesisGraph
impl UnwindSafe for HypothesisGraph
Blanket Implementations§
§impl<S, A> Aggregate<Result<S, Error>> for Awhere
A: Aggregate<S>,
impl<S, A> Aggregate<Result<S, Error>> for Awhere
A: Aggregate<S>,
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> 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> ⓘ
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> ⓘ
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