sangha 1.0.0

Sangha — sociology engine for social networks, game theory, and group dynamics
Documentation
//! # Sangha — Sociology Engine
//!
//! **सङ्घ** (Sanskrit: community, assembly)
//!
//! A Rust library for computational sociology: social networks, game theory,
//! group dynamics, population models, opinion dynamics, inequality,
//! coalition formation, collective decision-making, trust, and contagion.
//!
//! ## Modules
//!
//! - [`network`] — Social network graphs, Watts-Strogatz, Barabasi-Albert, BFS, centrality
//! - [`game_theory`] — Nash equilibria, prisoner's dilemma, iterated games
//! - [`coordination`] — N-player public goods, auctions, tragedy of the commons, folk theorem
//! - [`coalition`] — Shapley value, core stability, faction merge/split
//! - [`collective`] — Voting (plurality, Borda, Condorcet), jury theorem, wisdom of crowds
//! - [`trust`] — Trust propagation, reputation aggregation, decay, betrayal
//! - [`contagion`] — Hatfield emotional contagion, SIS dynamics, mood propagation
//! - [`opinion`] — Bounded confidence, echo chambers, consensus
//! - [`group`] — Tuckman stages, social loafing, groupthink
//! - [`population`] — Logistic growth, SIR model, herd immunity
//! - [`influence`] — Conformity, social proof, Bass diffusion
//! - [`inequality`] — Gini coefficient, Lorenz curve
//!
//! ## Example
//!
//! ```
//! use sangha::population;
//!
//! // Herd immunity threshold for R0 = 3
//! let h = population::herd_immunity_threshold(3.0).unwrap();
//! assert!((h - 2.0 / 3.0).abs() < 1e-10); // ~66.7%
//!
//! // Gini coefficient of equal distribution
//! let g = sangha::inequality::gini_coefficient(&[100.0, 100.0, 100.0]).unwrap();
//! assert!(g.abs() < 1e-10); // perfect equality
//! ```

#![warn(missing_docs)]

pub mod coalition;
pub mod collective;
pub mod contagion;
pub mod coordination;
pub mod error;
pub mod game_theory;
pub mod group;
pub mod inequality;
pub mod influence;
pub mod network;
pub mod opinion;
pub mod population;
pub mod trust;

pub use error::SanghaError;