pub struct Digester { /* private fields */ }Expand description
A text-digesting agent — the computational macrophage.
Implementations§
Source§impl Digester
impl Digester
pub fn new(position: Position) -> Digester
Sourcepub fn with_seed(position: Position, seed: u64) -> Digester
pub fn with_seed(position: Position, seed: u64) -> Digester
Create a digester with a deterministic ID (for testing).
Sourcepub fn with_max_idle(self, max_idle: u64) -> Digester
pub fn with_max_idle(self, max_idle: u64) -> Digester
Create a digester with custom idle threshold.
Sourcepub fn total_fragments(&self) -> usize
pub fn total_fragments(&self) -> usize
Total fragments produced in lifetime.
Sourcepub fn increment_idle(&mut self)
pub fn increment_idle(&mut self)
Simulate an idle tick (for testing/demo purposes).
Sourcepub fn idle_ticks(&self) -> u64
pub fn idle_ticks(&self) -> u64
Current idle tick count (for testing/inspection).
Sourcepub fn set_idle_ticks(&mut self, ticks: u64)
pub fn set_idle_ticks(&mut self, ticks: u64)
Set idle ticks directly (for testing).
Sourcepub fn digest_text(&mut self, text: String) -> Vec<String>
pub fn digest_text(&mut self, text: String) -> Vec<String>
Direct digestion: feed text and get fragments back immediately. This is a convenience for testing — in a colony, agents get input via SENSE + ENGULF from the substrate.
Sourcepub fn feed_document(&mut self, doc_id: DocumentId, content: String)
pub fn feed_document(&mut self, doc_id: DocumentId, content: String)
Feed document content to this agent (called by colony after EngulfDocument). Sets internal state so the next tick processes the content.
Trait Implementations§
Source§impl Agent for Digester
impl Agent for Digester
Source§fn set_position(&mut self, position: Position)
fn set_position(&mut self, position: Position)
Set the agent’s position.
Source§fn agent_type(&self) -> &str
fn agent_type(&self) -> &str
The agent’s type name (for display and logging).
Source§fn tick(&mut self, substrate: &dyn Substrate) -> AgentAction
fn tick(&mut self, substrate: &dyn Substrate) -> AgentAction
Execute one tick of the agent’s lifecycle. Read more
Source§fn export_vocabulary(&self) -> Option<Vec<u8>>
fn export_vocabulary(&self) -> Option<Vec<u8>>
Export this agent’s vocabulary as serialized bytes.
Returns None if the agent has no vocabulary to export.
Source§fn integrate_vocabulary(&mut self, data: &[u8]) -> bool
fn integrate_vocabulary(&mut self, data: &[u8]) -> bool
Integrate foreign vocabulary from serialized bytes.
Returns true if integration succeeded.
Source§fn profile(&self) -> AgentProfile
fn profile(&self) -> AgentProfile
Build a profile describing this agent’s capabilities.
Source§fn evaluate_symbiosis(&self, other: &AgentProfile) -> Option<SymbiosisEval>
fn evaluate_symbiosis(&self, other: &AgentProfile) -> Option<SymbiosisEval>
Evaluate whether to absorb another agent as a symbiont.
Source§fn absorb_symbiont(&mut self, profile: AgentProfile, data: Vec<u8>) -> bool
fn absorb_symbiont(&mut self, profile: AgentProfile, data: Vec<u8>) -> bool
Absorb another agent’s profile and vocabulary data as a symbiont.
Returns true if absorption succeeded.
Source§fn permeability(&self) -> f64
fn permeability(&self) -> f64
Current boundary permeability (0.0 = rigid, 1.0 = fully dissolved).
Source§fn modulate_boundary(&mut self, context: &BoundaryContext)
fn modulate_boundary(&mut self, context: &BoundaryContext)
Adjust boundary permeability based on environmental context.
Source§fn externalize_vocabulary(&self) -> Vec<String>
fn externalize_vocabulary(&self) -> Vec<String>
Return vocabulary terms to externalize (reinforce in the substrate).
Source§fn internalize_vocabulary(&mut self, terms: &[String])
fn internalize_vocabulary(&mut self, terms: &[String])
Absorb nearby concept terms from the substrate.
Source§fn vocabulary_size(&self) -> usize
fn vocabulary_size(&self) -> usize
Return the size of this agent’s vocabulary (for metrics).
Source§impl Apoptose for Digester
impl Apoptose for Digester
Source§fn self_assess(&self) -> CellHealth
fn self_assess(&self) -> CellHealth
Evaluate own health and usefulness. Read more
Source§fn prepare_death_signal(&self) -> DeathSignal
fn prepare_death_signal(&self) -> DeathSignal
Package final state into a death signal before destruction. Read more
Source§fn should_die(&self) -> bool
fn should_die(&self) -> bool
Whether the agent should initiate death. Read more
Source§fn trigger_apoptosis(self) -> DeathSignalwhere
Self: Sized,
fn trigger_apoptosis(self) -> DeathSignalwhere
Self: Sized,
Initiate orderly self-destruction (for concrete types). Read more
Source§impl Digest for Digester
impl Digest for Digester
Source§type Input = String
type Input = String
The raw input to consume. Ownership is transferred — the input is destroyed.
Source§type Presentation = Vec<String>
type Presentation = Vec<String>
What is presented to other agents after digestion.
Source§fn engulf(&mut self, input: String) -> DigestionResult
fn engulf(&mut self, input: String) -> DigestionResult
Engulf: take ownership of input. Read more
Source§fn digest(&mut self, input: Self::Input) -> Self::Presentation
fn digest(&mut self, input: Self::Input) -> Self::Presentation
Run the full digestion cycle: engulf → lyse → present.
Source§impl Sense for Digester
impl Sense for Digester
Source§fn sense_radius(&self) -> f64
fn sense_radius(&self) -> f64
The radius within which this agent can sense signals.
Source§fn sense_position(&self) -> Position
fn sense_position(&self) -> Position
The position from which this agent senses.
Source§fn gradient(&self, substrate: &dyn Substrate) -> Vec<Gradient>
fn gradient(&self, substrate: &dyn Substrate) -> Vec<Gradient>
Compute the gradient — direction of increasing signal strength. Read more
Source§fn orient(&self, gradients: &[Gradient]) -> Orientation
fn orient(&self, gradients: &[Gradient]) -> Orientation
Determine next orientation based on sensed gradients. Read more
Source§impl SerializableAgent for Digester
impl SerializableAgent for Digester
Source§fn export_state(&self) -> SerializedAgent
fn export_state(&self) -> SerializedAgent
Export the agent’s state for serialization.
Source§fn from_state(state: &SerializedAgent) -> Option<Digester>
fn from_state(state: &SerializedAgent) -> Option<Digester>
Create an agent from serialized state.
Auto Trait Implementations§
impl Freeze for Digester
impl RefUnwindSafe for Digester
impl Send for Digester
impl Sync for Digester
impl Unpin for Digester
impl UnwindSafe for Digester
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