pub struct FleetGraph { /* private fields */ }Expand description
The fleet constraint graph
Implementations§
Source§impl FleetGraph
impl FleetGraph
pub fn new() -> Self
pub fn add_agent( &mut self, id: u64, position: [f64; 2], capabilities: Vec<String>, )
pub fn add_edge(&mut self, a: u64, b: u64)
pub fn V(&self) -> usize
pub fn E(&self) -> usize
Sourcepub fn check_laman_rigidity(&self) -> RigidityResult
pub fn check_laman_rigidity(&self) -> RigidityResult
Check Laman rigidity condition
A graph is generically rigid (2D) iff:
- E = 2V - 3 (approximately — allow 5% tolerance for boundary cases)
- Every subgraph with v’ vertices has E’ ≤ 2v’ - 3
For small graphs (V < 3), just check main condition.
Sourcepub fn max_neighbors(&self) -> usize
pub fn max_neighbors(&self) -> usize
Maximum neighbors for any agent (Laman’s theorem: 2V-3 for V≥3)
Sourcepub fn get_agent(&self, id: u64) -> Option<&FleetAgent>
pub fn get_agent(&self, id: u64) -> Option<&FleetAgent>
Get agent by ID — O(1) via HashMap index
Sourcepub fn get_neighbors(&self, id: u64) -> Vec<u64>
pub fn get_neighbors(&self, id: u64) -> Vec<u64>
Get neighbors of an agent
Trait Implementations§
Source§impl Clone for FleetGraph
impl Clone for FleetGraph
Source§fn clone(&self) -> FleetGraph
fn clone(&self) -> FleetGraph
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 FleetGraph
impl Debug for FleetGraph
Source§impl Default for FleetGraph
impl Default for FleetGraph
Source§impl<'de> Deserialize<'de> for FleetGraph
impl<'de> Deserialize<'de> for FleetGraph
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 FleetGraph
impl RefUnwindSafe for FleetGraph
impl Send for FleetGraph
impl Sync for FleetGraph
impl Unpin for FleetGraph
impl UnsafeUnpin for FleetGraph
impl UnwindSafe for FleetGraph
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