pub struct TeloidGraph { /* private fields */ }Expand description
A graph structure representing the relationships between Teloids (norms).
This struct wraps UltraGraphWeighted, storing only TeloidIDs in the nodes
for memory efficiency. The edges are weighted with TeloidRelation to represent
inheritance or defeasance between norms.
For more details, see section 5 (Causality as EPP) and 8 (Teleology) in The EPP reference paper: https://github.com/deepcausality-rs/papers/blob/main/effect_propagation_process/epp.pdf
Implementations§
Source§impl TeloidGraph
impl TeloidGraph
pub fn number_nodes(&self) -> usize
pub fn number_edges(&self) -> usize
pub fn contains_edge(&self, a: usize, b: usize) -> bool
pub fn is_empty(&self) -> bool
pub fn clear(&mut self) -> Result<(), DeonticError>
Source§impl TeloidGraph
impl TeloidGraph
Source§impl TeloidGraph
impl TeloidGraph
Sourcepub fn with_capacity(capacity: usize) -> Self
pub fn with_capacity(capacity: usize) -> Self
Creates a new TeloidGraph with a pre-allocated capacity for its internal graph.
This can be useful for performance optimization when the approximate number of nodes (Teloids) is known in advance, reducing the need for reallocations.
§Arguments
capacity- The initial capacity for the internal graph’s storage.
§Returns
A new TeloidGraph instance with the specified capacity.
Trait Implementations§
Source§impl Clone for TeloidGraph
impl Clone for TeloidGraph
Source§fn clone(&self) -> TeloidGraph
fn clone(&self) -> TeloidGraph
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for TeloidGraph
impl Debug for TeloidGraph
Source§impl Default for TeloidGraph
impl Default for TeloidGraph
Source§fn default() -> TeloidGraph
fn default() -> TeloidGraph
Returns the “default value” for a type. Read more
Source§impl Teloidable for TeloidGraph
impl Teloidable for TeloidGraph
Source§fn add_teloid(&mut self, id: TeloidID) -> Result<usize, DeonticError>
fn add_teloid(&mut self, id: TeloidID) -> Result<usize, DeonticError>
Source§fn contains_teloid(&self, index: usize) -> bool
fn contains_teloid(&self, index: usize) -> bool
Source§fn add_inheritance_edge(
&mut self,
parent_idx: usize,
child_idx: usize,
) -> Result<(), DeonticError>
fn add_inheritance_edge( &mut self, parent_idx: usize, child_idx: usize, ) -> Result<(), DeonticError>
Source§fn add_defeasance_edge(
&mut self,
defeater_idx: usize,
defeated_idx: usize,
) -> Result<(), DeonticError>
fn add_defeasance_edge( &mut self, defeater_idx: usize, defeated_idx: usize, ) -> Result<(), DeonticError>
Auto Trait Implementations§
impl Freeze for TeloidGraph
impl RefUnwindSafe for TeloidGraph
impl Send for TeloidGraph
impl Sync for TeloidGraph
impl Unpin for TeloidGraph
impl UnwindSafe for TeloidGraph
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