pub struct FleetGraph {
pub agents: Vec<AgentNode>,
pub edges: Vec<CommEdge>,
}Expand description
The fleet graph: a directed weighted graph of agents and communication channels.
Fields§
§agents: Vec<AgentNode>§edges: Vec<CommEdge>Implementations§
Source§impl FleetGraph
impl FleetGraph
Sourcepub fn node_count(&self) -> usize
pub fn node_count(&self) -> usize
Number of agents (nodes).
Sourcepub fn edge_count(&self) -> usize
pub fn edge_count(&self) -> usize
Number of edges.
Sourcepub fn adjacency_matrix(&self) -> Vec<Vec<f64>>
pub fn adjacency_matrix(&self) -> Vec<Vec<f64>>
Build the adjacency matrix (n×n). Entry [i][j] = total bandwidth from i→j.
For undirected analysis, use undirected_adjacency.
Sourcepub fn undirected_adjacency(&self) -> Vec<Vec<f64>>
pub fn undirected_adjacency(&self) -> Vec<Vec<f64>>
Build the undirected adjacency matrix: A[i][j] = A[j][i] = max bandwidth in either direction.
Sourcepub fn degree_matrix(&self) -> Vec<Vec<f64>>
pub fn degree_matrix(&self) -> Vec<Vec<f64>>
Degree matrix (diagonal): D[i][i] = sum of weights incident to node i. Uses undirected version of the graph.
Sourcepub fn is_connected(&self) -> bool
pub fn is_connected(&self) -> bool
Check if the graph is connected (undirected BFS).
Sourcepub fn connected_components(&self) -> Vec<Vec<usize>>
pub fn connected_components(&self) -> Vec<Vec<usize>>
Number of connected components.
Sourcepub fn from_github_org(
repos: Vec<(String, Vec<String>)>,
dependencies: Vec<(String, String, f64)>,
) -> Self
pub fn from_github_org( repos: Vec<(String, Vec<String>)>, dependencies: Vec<(String, String, f64)>, ) -> Self
Build from GitHub org data: repos as nodes, dependencies as edges. Each repo has a name (agent id) and list of capabilities (languages, topics). Dependencies are edges weighted by coupling strength.
Sourcepub fn barbell(k: usize) -> Self
pub fn barbell(k: usize) -> Self
Create a barbell graph: two cliques of size k joined by a single bridge edge.
Sourcepub fn two_cliques(k: usize) -> Self
pub fn two_cliques(k: usize) -> Self
Create two disconnected cliques of size k each.
Trait Implementations§
Source§impl Clone for FleetGraph
impl Clone for FleetGraph
Source§fn clone(&self) -> FleetGraph
fn clone(&self) -> FleetGraph
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more