pub struct GenesisProtocol {
pub organisms: HashMap<String, TRON>,
pub network: NetworkDiscovery,
pub collective: CollectiveIntelligence,
pub evolution_engine: EvolutionEngine,
}
Expand description
Main Genesis Protocol interface
Fields§
§organisms: HashMap<String, TRON>
§network: NetworkDiscovery
§collective: CollectiveIntelligence
§evolution_engine: EvolutionEngine
Implementations§
Source§impl GenesisProtocol
impl GenesisProtocol
Sourcepub fn new() -> Result<Self, GenesisError>
pub fn new() -> Result<Self, GenesisError>
Create a new Genesis Protocol instance
Sourcepub fn create_organism(
&mut self,
dna: Option<DigitalDNA>,
) -> Result<String, GenesisError>
pub fn create_organism( &mut self, dna: Option<DigitalDNA>, ) -> Result<String, GenesisError>
Create a new organism with optional DNA
Sourcepub fn get_organism(&self, organism_id: &str) -> Option<&TRON>
pub fn get_organism(&self, organism_id: &str) -> Option<&TRON>
Get organism by ID
Sourcepub fn get_organism_mut(&mut self, organism_id: &str) -> Option<&mut TRON>
pub fn get_organism_mut(&mut self, organism_id: &str) -> Option<&mut TRON>
Get mutable organism by ID
Sourcepub async fn establish_neural_connection(
&mut self,
from_id: &str,
to_id: &str,
) -> Result<String, GenesisError>
pub async fn establish_neural_connection( &mut self, from_id: &str, to_id: &str, ) -> Result<String, GenesisError>
Establish neural connection between two organisms
Sourcepub async fn send_neural_message(
&self,
from_id: &str,
to_id: &str,
message_type: MessageType,
payload: Vec<u8>,
) -> Result<(), GenesisError>
pub async fn send_neural_message( &self, from_id: &str, to_id: &str, message_type: MessageType, payload: Vec<u8>, ) -> Result<(), GenesisError>
Send neural message between organisms
Sourcepub fn evolve_organism(
&mut self,
organism_id: &str,
selection_pressure: f64,
) -> Result<(), GenesisError>
pub fn evolve_organism( &mut self, organism_id: &str, selection_pressure: f64, ) -> Result<(), GenesisError>
Evolve an organism
Sourcepub fn get_network_stats(&self) -> NetworkStats
pub fn get_network_stats(&self) -> NetworkStats
Get network statistics
Sourcepub fn get_all_vital_signs(&self) -> Vec<VitalSigns>
pub fn get_all_vital_signs(&self) -> Vec<VitalSigns>
Get all organisms vital signs
Sourcepub fn cleanup_dead_organisms(&mut self) -> usize
pub fn cleanup_dead_organisms(&mut self) -> usize
Remove dead organisms
Trait Implementations§
Auto Trait Implementations§
impl Freeze for GenesisProtocol
impl RefUnwindSafe for GenesisProtocol
impl Send for GenesisProtocol
impl Sync for GenesisProtocol
impl Unpin for GenesisProtocol
impl UnwindSafe for GenesisProtocol
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