1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
//! # 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
//! ```
pub use SanghaError;