Class OpinionDynamics
java.lang.Object
org.episteme.social.sociology.OpinionDynamics
Simulates opinion dynamics in social networks using various theoretical models.
Includes implementations of the DeGroot model, Bounded Confidence (Deffuant-Weisbuch),
and media influence models.
Modernized to use Real for internal calculations and API.
- Since:
- 1.0
- Version:
- 1.2
- Author:
- Silvere Martin-Michiellot, Gemini AI (Google DeepMind)
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final recordRepresents a single agent in the network with a specific opinion and stubbornness.static final recordCaptures the state of the simulation at a specific step. -
Method Summary
Modifier and TypeMethodDescriptionstatic RealcalculatePolarization(Map<String, Real> opinions) Calculates a polarization index for the current opinion distribution.static List<OpinionDynamics.SimulationState> simulateBoundedConfidence(List<OpinionDynamics.Agent> agents, int steps, Real threshold, Real convergenceRate) Runs the Bounded Confidence model (Deffuant-Weisbuch).static List<OpinionDynamics.SimulationState> simulateDeGroot(List<OpinionDynamics.Agent> agents, int steps) Runs the DeGroot opinion dynamics model.static List<OpinionDynamics.SimulationState> simulateWithMedia(List<OpinionDynamics.Agent> agents, int steps, Real mediaOpinion, Real mediaInfluence) Runs a social influence model incorporating external media effects.
-
Method Details
-
simulateDeGroot
public static List<OpinionDynamics.SimulationState> simulateDeGroot(List<OpinionDynamics.Agent> agents, int steps) Runs the DeGroot opinion dynamics model. In this model, agents update their opinions by taking the weighted average of their neighbors' opinions.- Parameters:
agents- initial configuration of agentssteps- number of simulation steps- Returns:
- list of simulation states over time
-
simulateBoundedConfidence
public static List<OpinionDynamics.SimulationState> simulateBoundedConfidence(List<OpinionDynamics.Agent> agents, int steps, Real threshold, Real convergenceRate) Runs the Bounded Confidence model (Deffuant-Weisbuch).- Parameters:
agents- initial configurationsteps- number of interaction stepsthreshold- confidence threshold (epsilon) - RealconvergenceRate- rate of convergence (mu) - Real- Returns:
- list of states (snapshot every 10 steps)
-
simulateWithMedia
public static List<OpinionDynamics.SimulationState> simulateWithMedia(List<OpinionDynamics.Agent> agents, int steps, Real mediaOpinion, Real mediaInfluence) Runs a social influence model incorporating external media effects. -
calculatePolarization
-