pub struct DynamicGalaxyRegistry { /* private fields */ }Expand description
Registry for dynamic galaxies created from memory clustering.
Instead of a fixed set of 14 galaxies, the system can create new virtual galaxies when memory clustering reveals natural groupings that don’t fit the existing taxonomy.
Implementations§
Source§impl DynamicGalaxyRegistry
impl DynamicGalaxyRegistry
Sourcepub fn with_config(
min_cluster_size: usize,
max_galaxies: usize,
prune_threshold: f32,
) -> Self
pub fn with_config( min_cluster_size: usize, max_galaxies: usize, prune_threshold: f32, ) -> Self
Create a registry with custom settings.
Sourcepub fn try_create(
&mut self,
name: &str,
description: &str,
cluster_tags: Vec<String>,
memory_count: usize,
) -> Option<&DynamicGalaxy>
pub fn try_create( &mut self, name: &str, description: &str, cluster_tags: Vec<String>, memory_count: usize, ) -> Option<&DynamicGalaxy>
Try to create a dynamic galaxy from a memory cluster.
Returns the created galaxy, or None if the cluster is too small
or the registry is full.
Sourcepub fn get(&self, id: &str) -> Option<&DynamicGalaxy>
pub fn get(&self, id: &str) -> Option<&DynamicGalaxy>
Get a dynamic galaxy by ID.
Sourcepub fn all(&self) -> Vec<&DynamicGalaxy>
pub fn all(&self) -> Vec<&DynamicGalaxy>
Get all dynamic galaxies.
Sourcepub fn update_effectiveness(&mut self, id: &str, effectiveness: f32)
pub fn update_effectiveness(&mut self, id: &str, effectiveness: f32)
Update the effectiveness of a dynamic galaxy.
Sourcepub fn prune(&mut self) -> usize
pub fn prune(&mut self) -> usize
Prune galaxies below the effectiveness threshold.
Returns the number of galaxies pruned.
Sourcepub fn galaxy_count(&self) -> usize
pub fn galaxy_count(&self) -> usize
Number of dynamic galaxies (alias for len()).
Trait Implementations§
Source§impl Clone for DynamicGalaxyRegistry
impl Clone for DynamicGalaxyRegistry
Source§fn clone(&self) -> DynamicGalaxyRegistry
fn clone(&self) -> DynamicGalaxyRegistry
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for DynamicGalaxyRegistry
impl Debug for DynamicGalaxyRegistry
Source§impl Default for DynamicGalaxyRegistry
impl Default for DynamicGalaxyRegistry
Source§impl<'de> Deserialize<'de> for DynamicGalaxyRegistry
impl<'de> Deserialize<'de> for DynamicGalaxyRegistry
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for DynamicGalaxyRegistry
impl RefUnwindSafe for DynamicGalaxyRegistry
impl Send for DynamicGalaxyRegistry
impl Sync for DynamicGalaxyRegistry
impl Unpin for DynamicGalaxyRegistry
impl UnsafeUnpin for DynamicGalaxyRegistry
impl UnwindSafe for DynamicGalaxyRegistry
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