Struct GenesisProtocol

Source
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

Source

pub fn new() -> Result<Self, GenesisError>

Create a new Genesis Protocol instance

Source

pub fn create_organism( &mut self, dna: Option<DigitalDNA>, ) -> Result<String, GenesisError>

Create a new organism with optional DNA

Source

pub fn get_organism(&self, organism_id: &str) -> Option<&TRON>

Get organism by ID

Source

pub fn get_organism_mut(&mut self, organism_id: &str) -> Option<&mut TRON>

Get mutable organism by ID

Source

pub async fn establish_neural_connection( &mut self, from_id: &str, to_id: &str, ) -> Result<String, GenesisError>

Establish neural connection between two organisms

Source

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

Source

pub fn evolve_organism( &mut self, organism_id: &str, selection_pressure: f64, ) -> Result<(), GenesisError>

Evolve an organism

Source

pub fn get_network_stats(&self) -> NetworkStats

Get network statistics

Source

pub fn get_all_vital_signs(&self) -> Vec<VitalSigns>

Get all organisms vital signs

Source

pub fn cleanup_dead_organisms(&mut self) -> usize

Remove dead organisms

Trait Implementations§

Source§

impl Default for GenesisProtocol

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more