An agent-based model exploring how network structure influences policy support, particularly when policy effects are unevenly distributed across social networks.
This model investigates how public support for beneficial policies can erode due to network effects, even when the policies have positive net social benefits. It explores the hypothesis that policy support depends on direct observation of policy effects, and that network structure can lead to negative effects being more visible than positive ones.
- Network Structure: Uses Barabási-Albert preferential attachment model to create realistic social networks
- Agent Types:
- Privileged agents (more connected)
- Marginalized agents (less connected)
- Policy-affected agents (experiencing positive or negative impacts)
- Dynamic Network: Agents can create new connections based on strong opinions
- Policy Maker Behavior: Optional "double down" mechanism where policy coverage expands in response to low support
- Creates a scale-free network using Barabási-Albert algorithm
- Assigns privileged status to most central nodes
- Randomly assigns marginalized status to remaining nodes
- Applies initial policy effects to a subset of agents
- Agents form opinions based on observed policy effects in their neighborhood
- Opinion formation uses a logistic function bounded between -1 and 1
- When opinions exceed a trigger threshold, agents create new connections between their neighbors
- Marginalized agents receive positive policy effects (+1)
- Privileged agents receive negative policy effects (-1)
- Effects spread through network observation
Clone repository
git clone https://github.com/josk0/policy-model.git
cd policy-model
conda env create --file environment.yml
or manually create environment
conda create -n policymodel python numpy pandas tqdm matplotlib solara pytest scipy ipython networkx
conda activate policymodel
python -m pip install mesa
(Note: the mesa package is installed with pip
since it's not up-to-date in conda-forge)
... or pick your favourite package manager
model.py
: Contains the model classPolicyModel
.agents.py
: Contains the agent classPolicyAgent
.app.py
: Contains the code for the interactive Solara visualization.analysis.ipynb
: Jupyter notebook to run and analyse the model.
To run the model interactively, run the following command
solara run app.py
- Number of Agents: Total population size
- Privileged Fraction: Proportion of highly connected agents
- Marginalized Fraction: Proportion of less connected agents
- Policy Coverage: Initial policy coverage rate (and rate at which policy maker "doubles down")
- Trigger Level: Opinion threshold for network modification
- Policy Reaction: Enable/disable policy maker "double down" behavior
The model provides real-time visualization with:
- Network view showing agent types and connections
- 🔵 Blue: Privileged agents
- 🔆 Light blue: Privileged agents affected by policy
- 🔴 Red: Marginalized agents
- 💗 Pink: Marginalized agents affected by policy
- ⚪ Grey: Unaffected agents
- Time series of average policy support and social benefit
- Histogram of node degrees
tbc
This model explores several key questions in policy dynamics:
- How does network structure influence policy support?
- Can beneficial policies lose support due to visibility bias?
- What role does social network position play in policy perception?
- How do policy maker reactions influence long-term support?
- Observe opinion polarization in population
- Should benefits and costs of the policy be symmetric (as they are currently)?
- tbc...
Contributions are welcome! Please feel free to submit a Pull Request.
This project is licensed under the GPL-3.0 License - see the LICENSE file for details.
- Johannes Himmelreich (@josk0)
This project is part of ongoing research at Syracuse University. This is my first model using mesa. I used the "Virus on a Network" example model as a guide.