Skip to main content

Module prelude

Module prelude 

Source
Expand description

Phago Runtime Prelude — convenient imports for common usage.

use phago_runtime::prelude::*;

Re-exports§

pub use crate::colony::Colony;
pub use crate::colony::ColonyConfig;
pub use crate::colony::ColonyEvent;
pub use crate::colony::ColonyStats;
pub use crate::colony::ColonySnapshot;
pub use crate::colony_builder::ColonyBuilder;
pub use crate::colony_builder::PersistentColony;
pub use crate::colony_builder::BuilderError;
pub use crate::session::GraphState;
pub use crate::session::SerializedNode;
pub use crate::session::SerializedEdge;
pub use crate::session::SessionMetadata;
pub use crate::session::save_session;
pub use crate::session::load_session;
pub use crate::session::restore_into_colony;
pub use crate::session::verify_fidelity;
pub use crate::metrics::ColonyMetrics;
pub use crate::metrics::TransferMetrics;
pub use crate::metrics::DissolutionMetrics;
pub use crate::metrics::GraphRichnessMetrics;
pub use crate::backend::BackendConfig;
pub use crate::backend::BackendError;
pub use crate::backend::DynTopologyGraph;
pub use crate::backend::create_backend;

Structs§

AgentFitness
Per-agent fitness data.
AgentGenome
Evolvable parameters for an agent.
AgentId
Unique identifier for an agent in the colony.
BoundaryContext
Context for boundary modulation (Dissolve primitive).
CodeElement
A code element extracted from source files.
DeathSignal
Signal emitted when an agent dies (apoptotic body).
Digester
A text-digesting agent — the computational macrophage.
Document
A document placed in the substrate for agents to digest.
DocumentId
Unique identifier for a document in the substrate.
EdgeData
Data stored on a knowledge graph edge.
FitnessSpawnPolicy
Fitness-based spawn: create mutated offspring of the fittest agent.
FitnessTracker
Tracks fitness across all agents in a colony.
FragmentPresentation
A fragment to present to the knowledge graph.
Gradient
A directional gradient sensed by an agent.
LouvainResult
Result of Louvain community detection.
NodeData
Data stored in a knowledge graph node.
NodeId
Unique identifier for a node in the knowledge graph.
Position
A position in the substrate’s spatial field.
SemanticWiringConfig
Configuration for semantic wiring.
Sentinel
The Sentinel agent — the immune system’s anomaly detector.
Signal
A signal emitted into or read from the substrate.
SymbiontInfo
Information about an integrated symbiont.
Synthesizer
The Synthesizer agent — emergent collective intelligence.
Trace
A trace deposited by an agent on the substrate (stigmergy).

Enums§

AgentAction
An action returned by an agent’s tick.
AgentType
Enumeration of all agent types for deserialization dispatch.
CellHealth
Health assessment of an agent (used by Apoptose).
Classification
Classification result from negative selection.
CodeElementKind
Types of code elements we extract.
DeathCause
Why an agent died.
DigestionResult
Result of a digestion attempt.
NodeType
Types of nodes in the knowledge graph.
Orientation
Orientation decision from sensing.
PhagoError
Errors that can occur during Phago operations.
SerializedAgent
Union of all serializable agent states.
SignalType
The type of a signal in the substrate.
SymbiosisEval
Result of evaluating another agent for symbiosis.
SymbiosisFailure
Why symbiosis failed.
TraceType
The type of trace deposited.

Traits§

Agent
The fundamental unit of computation in Phago — a biological cell.
SerializableAgent
Trait for agents that can be serialized.
SpawnPolicy
Trait for spawn policies.
Substrate
The shared environment that all agents sense and modify.
TopologyGraph
A handle to the topology graph, used by the Wire primitive.

Functions§

compute_modularity
Compute modularity of a given partition.
compute_semantic_weight
Compute the edge weight based on base weight and semantic similarity.
cosine_similarity
Compute cosine similarity between two vectors.
dot_product
Compute dot product between two vectors.
elements_to_document
Generate a document string from code elements for colony ingestion.
extract_code_elements
Extract code elements from Rust source code.
l2_distance
Compute L2 distance between two vectors.
l2_normalize
L2 normalize a vector in place.
l2_normalized
L2 normalize a vector, returning a new vector.
louvain_communities
Run Louvain community detection on a graph.
normalized_similarity
Compute similarity between two embeddings, normalized to [0, 1].

Type Aliases§

Result
Result type for Phago operations.
Tick
The current tick of the simulation.