A computational model to simulate how union structure affects strike growth, success, and failure. This model helps unions decide whether to call a strike by predicting the development of industrial action over time.
StrikeSim generates random networks representing the internal structures of unions and workplaces. Nodes represent people and edges represent interactions. Along these networks flows hope and fear affecting workers' willingness to participate in industrial action. The model tracks monetary flows including wages, strike pay, and employer revenue. Over time, the combination of morale and workers' financial position affects whether the strike grows or shrinks, and whether the employer cedes to demands.
- Agent-Based Model: Workers, employers, and unions as individual agents with distinct behaviors
- Network Effects: Social interactions influence worker morale and participation decisions
- Financial Flows: Complete tracking of wages, strike pay, union dues, and employer revenue
- Morale System: Three different morale specifications (sigmoid, linear, no-motivation)
- Policy Simulation: Union and employer policy changes during strikes
- Network Loading: Support for loading pre-defined networks from .gexf files
- Data Export: HDF5 and CSV export for analysis
- Visualization: Network and time series visualizations
- Monte Carlo: Support for multiple simulation runs with different random networks
- Agent-based simulation with workers, employer, and union
- Network-based interactions using union and employer organizational structures
- Multiple morale specifications (sigmoid, linear, no motivation)
- Financial modeling including wages, strike pay, dues, and daily expenses
- Interactive dashboard with real-time parameter adjustment
- Time series visualization of key metrics over time
- Network visualization showing strike spread through organizational networks
- Animated GIF generation showing network evolution over time
- Data export to CSV and HDF5 formats
- Monte Carlo simulation support for statistical analysis
- Clone the repository:
git clone <repository-url>
cd strikesim- Install dependencies:
pip install -r requirements.txtRun a single simulation:
python run.pyThis will:
- Initialize the simulation with default parameters
- Run the strike simulation
- Generate visualizations (networks.png, time_series.png)
- Save data (strikesim_data.h5, strikesim_summary.csv)
To run multiple simulations with different random networks, uncomment the Monte Carlo section in run.py:
# Uncomment to run Monte Carlo simulation
mc_results = run_monte_carlo()Modify settings.py to adjust model parameters:
- Calendar: Start date, duration, working days
- Workers: Number, wages, target wages, initial morale
- Financial: Employer balance, strike fund, revenue markup
- Networks: Union and employer network structure
- Morale: Specification type and parameters
- Policies: Concession thresholds, strike pay rates
- Worker: Individual workers with morale, wages, savings, and participation history
- Employer: Company with balance, revenue calculation, and concession policies
- Union: Organization with strike fund, dues collection, and policy management
- Employer Network: Hierarchical structure (executive → department → team)
- Union Network: Bargaining committee and worker connections with configurable density
- Network Loading: Option to load pre-defined networks from .gexf files in
networks/employers/andnetworks/unions/directories
- Wages paid to working workers
- Strike pay distributed to striking workers
- Union dues collected from members
- Employer revenue based on working days and markup
- Balance tracking for all agents
Three specifications implemented:
- Sigmoid: Non-linear response to wage gaps and savings
- Linear: Linear combination of factors
- No-Motivation: Simplified specification
Morale combines private factors (financial position) with social factors (network interactions).
The model supports two ways to define networks:
- Generated Networks (default): Random networks generated based on parameters in
settings.py - Loaded Networks: Pre-defined networks loaded from .gexf files
To use pre-defined networks, modify settings.py:
# Set to None to use generated networks (default)
employer_network_file = None # e.g., 'defra' to load networks/employers/defra.gexf
union_network_file = None # e.g., 'union_network' to load networks/unions/union_network.gexf
# Or specify network files:
employer_network_file = 'defra' # Loads networks/employers/defra.gexf
union_network_file = 'my_union' # Loads networks/unions/my_union.gexfThe model will automatically fall back to generated networks if the specified files don't exist.
Run the test script to verify network loading functionality:
python test_network_loading.pyThis will show available network files and test different loading scenarios.
strikesim_data.h5: Full time series data in HDF5 formatstrikesim_summary.csv: Summary statisticsmonte_carlo_results.csv: Results from multiple simulationsnetworks.png: Visualization of union and employer networkstime_series.png: Time series plots of key metrics
The model is designed to be calibrated using:
- Academic case studies of historical strikes
- Publicly available information from newspaper articles and press releases
- Union data (without requiring access to sensitive information)
This model can be used to:
- Test different union strategies before calling strikes
- Understand how network structure affects strike outcomes
- Analyze the impact of policy changes on strike success
- Compare different morale specifications
- Study the role of financial factors in strike dynamics
- Language: Python 3.7+
- Dependencies: NetworkX, Pandas, NumPy, Matplotlib, Seaborn, H5Py
- Architecture: Object-oriented with clear separation of concerns
- Data Storage: HDF5 for full data, CSV for summaries
- Visualization: Matplotlib/Seaborn for plots and networks
This model is designed for research and union decision-making. Contributions are welcome, particularly:
- Additional morale specifications
- More sophisticated network generation
- Enhanced policy systems
- Improved visualization tools
- Model validation studies
[Add appropriate license information]
If you use this model in research, please cite: [Add citation information when paper is published]
The dashboard includes interactive network visualizations showing both union and employer networks:
- Real-time slider: Step through each day of the simulation
- Color-coded nodes: Red (striking), Blue (working), Orange (union committee), Green (management)
- Network statistics: Shows network size and connectivity information
- Animated GIF generation: Create animations showing network evolution over time
- Run a simulation in the dashboard
- Scroll to the "Interactive Network Visualization" section
- Adjust animation settings:
- FPS: Control animation speed (1-5 frames per second)
- Max Frames: Limit frames for smaller file size
- Click "Generate Animation" to create a GIF
- Download the animation for sharing or analysis
The animation shows how strike participation spreads through both organizational networks over time, providing insights into:
- Strike contagion patterns
- Network influence on participation decisions
- Temporal dynamics of collective action