[−][src]Struct phreak_engine::core::Phreak
The Phreak class embeds the matching network
This structure embeds the data for the phreak algorithm and provides the public API for the network. The public API is quite simple and belies the complexity that lies behind.
Once we have an empty Phreak network, we can add production rules. Now we have a meaningful network, and we can add facts. When a combination of facts is found that matches a rule, the callback for that production is activated.
Facts can be removed again, possibly activating or deactivating a production rule. Every activation or deactivation is returned through a callback.
Rules can also be removed again. Rule additions and removals can also trigger activations and deactivations.
let phreak = Phreak::new(); println!("{:?}", phreak);
Methods
impl Phreak
[src]
pub fn new() -> Self
[src]
Create a new phreak network for matching rules
pub fn add_production()
[src]
Add a new matching rule to the engine
pub fn remove_production()
[src]
Remove a matching rule from the engine
pub fn add_facts(&self, facts_array: &[Facts])
[src]
Insert new facts into the network
Returns the AlphaNodeId's for nodes that are affected
pub fn remove_facts(&self, facts_array: &[Facts])
[src]
Remove existing facts from the network
impl Phreak
[src]
pub fn dump_structure(&self)
[src]
Dumps the content of the phreak network betanetwork for debugging
pub fn dump_segment_structure(&self)
[src]
Dumps the content of the phreak network betanetwork for debugging
Trait Implementations
Auto Trait Implementations
impl !RefUnwindSafe for Phreak
impl !Send for Phreak
impl !Sync for Phreak
impl Unpin for Phreak
impl !UnwindSafe for Phreak
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,