Class OpinionDynamics

java.lang.Object
org.episteme.social.sociology.OpinionDynamics

public final class OpinionDynamics extends Object
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)
  • 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 agents
      steps - 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 configuration
      steps - number of interaction steps
      threshold - confidence threshold (epsilon) - Real
      convergenceRate - 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

      public static Real calculatePolarization(Map<String,Real> opinions)
      Calculates a polarization index for the current opinion distribution.
      Parameters:
      opinions - map of agent opinions (Real)
      Returns:
      polarization score (Real)