{"id":26223625,"url":"https://github.com/chraibi/amritsar","last_synced_at":"2026-04-19T20:38:22.727Z","repository":{"id":216344106,"uuid":"741087430","full_name":"chraibi/amritsar","owner":"chraibi","description":"Reconstruction of the Amristsar Massacre","archived":false,"fork":false,"pushed_at":"2025-07-21T09:30:14.000Z","size":406,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-12-26T09:34:59.844Z","etag":null,"topics":["amritsar","crowd-simulation","history","simulation","simulation-modeling"],"latest_commit_sha":null,"homepage":"","language":"Jupyter Notebook","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/chraibi.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2024-01-09T17:08:50.000Z","updated_at":"2025-07-21T09:25:56.000Z","dependencies_parsed_at":"2025-04-20T18:25:54.786Z","dependency_job_id":"337d4943-0644-4199-8455-c052cd24c221","html_url":"https://github.com/chraibi/amritsar","commit_stats":null,"previous_names":["chraibi/amritsar"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/chraibi/amritsar","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chraibi%2Famritsar","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chraibi%2Famritsar/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chraibi%2Famritsar/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chraibi%2Famritsar/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/chraibi","download_url":"https://codeload.github.com/chraibi/amritsar/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chraibi%2Famritsar/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32022556,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-18T20:23:30.271Z","status":"online","status_checked_at":"2026-04-19T02:00:07.110Z","response_time":55,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["amritsar","crowd-simulation","history","simulation","simulation-modeling"],"created_at":"2025-03-12T17:39:36.191Z","updated_at":"2026-04-19T20:38:22.721Z","avatar_url":"https://github.com/chraibi.png","language":"Jupyter Notebook","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Rethinking the Amritsar Massacre through Agent-Based Modeling and Social Psychology\n\nThis repository contains an agent-based modeling (ABM) simulation that models crowd evacuation dynamics during crisis scenarios, specifically inspired by the [Amritsar massacre](https://en.wikipedia.org/wiki/Jallianwala_Bagh_massacre). \nThe simulation is built using [JuPedSim](jupedsim.org), a software for simulating pedestrian dynamics, and incorporates social psychology principles to understand how crowd behavior, and spatial constraints affect evacuation outcomes.\n\n\n## Overview\n\nThe simulation models agents (pedestrians) attempting to evacuate from a confined space under crisis conditions using the [JuPedSim](jupedsim.org) pedestrian dynamics software. \n\nKey features include:\n\n- **Stamina decay over time**: Agents' movement speed decreases based on exposure time and distance to exits\n- **Social shielding effects**: Crowd density provides protective effects against targeting\n- **Targeting behavior**: Depending on the parameters shielding effect can be turns into targeting behavior.\n- **Stochastic agent collapse**: Probabilistic model for agents falling due to various factors\n- **Multiple exit strategies**: Agents dynamically choose exits based on distance and crowding\n- **Parallel simulation runs**: Support for parameter sweeps with multiple repetitions\n\n## Installation\n\n### Prerequisites\n\n- Python 3.8+\n- Required packages (see requirements below)\n\n### Environment Setup\n\n1. **Clone the repository:**\n```bash\ngit clone https://github.com/chraibi/amritsar.git\ncd amritsar\n```\n\n2. **Create a virtual environment:**\n```bash\npython -m venv venv\nsource venv/bin/activate  # On Windows: venv\\Scripts\\activate\n```\n\n3. **Install dependencies:**\n```bash\npip install -r requirements.txt\n```\n\n## Configuration\n\nThe simulation is controlled through a `config.json` file.\n\n### Configuration Parameters\n\n| Parameter | Type | Description | Default/Example |\n|-----------|------|-------------|-----------------|\n| **Simulation Settings** | | | |\n| `time_scale` | int | Total simulation time in seconds | 600 |\n| `update_time` | int | Status update interval in seconds | 10 |\n| `num_reps` | int | Number of repetitions per parameter set | 10 |\n| `global_seed` | int | Base seed for reproducibility | 42 |\n| **Agent Parameters** | | | |\n| `num_agents_list` | list | List of agent counts to test | [100, 200, 500] |\n| `v0_max` | float | Maximum agent velocity (m/s) | 3.0 |\n| `determinism_strength_exits` | float | Exit selection randomness (0-1) | 0.2 |\n| `exit_probability` | float | Probability of exiting when at exit | 0.2 |\n| `wp_radius` | float | Exit detection radius (meters) | 1.0 |\n| **Model Parameters** | | | |\n| `lambda_decay_list` | list | Stamina decay rates to test | [0.1, 0.5, 1.0] |\n| `alpha_list` | list | Shielding effectiveness values | [0.0, 0.5, 1.0] |\n| `gamma` | float | Shielding decay parameter | 0.8 |\n| `sigma` | float | Space factor parameter in meters | 20 |\n\n\n## Usage\n\n### Running Simulations\n\n1. **Single simulation run:**\n```bash\npython main.py\n```\n\n2. **The simulation will:**\n   - Load parameters from `config.json`\n   - Run all parameter combinations in parallel\n   - Save results to `fig_results/sweep_simulation_data_TIMESTAMP.pkl`\n\n### Key Parameters Explained\n\n- **λ (lambda_decay)**: Controls the rate of agent stamina decay over time. Higher values mean faster deterioration.\n- **α (alpha)**: Shielding effectiveness parameter. 1.0 = full physical shielding, 0.0 = targeted effects.\n- **γ (gamma)**: Decay rate for shielding effectiveness.\n- **σ (sigma)**: Spatial factor affecting survival probability.\n\n## Analysis and Visualization\n\nThe repository includes several plotting scripts for analyzing simulation results:\n\n### Plot Scripts\n\n| Script | Description | Fixed Parameters |\n|--------|-------------|------------------|\n| `plot_cumulative_fallen_agents_time_lambda.py` | Cumulative fallen agents over time for different λ values | α = fixed |\n| `plot_cumulative_fallen_agents_time_alpha.py` | Cumulative fallen agents over time for different α values | λ = fixed |\n| `heatmap.py` | Multiple PNG survival heatmaps | Various parameters |\n| `plot_heatmap_once.py` | Single PDF survival heatmap | λ = fixed |\n| `plot_heatmap_rspace.py` | Heatmaps for spatial analysis at 4 time points | - |\n\n### Running Analysis\n\n```bash\n# Generate time series plots\npython plot_cumulative_fallen_agents_time_lambda.py\npython plot_cumulative_fallen_agents_time_alpha.py\n\n# Generate heatmaps\npython heatmap.py\npython plot_heatmap_once.py\npython plot_heatmap_rspace.py\n```\n\n## Output Structure\n\n```\nproject/\n├── fig_results/\n│   ├── sweep_simulation_data_TIMESTAMP.pkl  # Raw simulation data\n│   ├── heatmaps/                           # Generated heatmap images\n│   └── plots/                             # Time series plots\n├── trajectories/                          # Individual simulation trajectories\n└── config.json                           # Configuration file\n```\n\n## Key Features\n\n### Technical Features\n\n- **Parallel Processing**: Utilizes joblib for efficient parameter sweeps\n- **Reproducible Results**: Deterministic seeding for consistent outcomes\n- **Scalable Architecture**: Handles large numbers of agents and parameter combinations\n- **Comprehensive Logging**: Detailed simulation progress and results tracking\n\n\n\n\n## Citation\n\nIf you use this simulation in your research, please cite:\n\n```\nTBD\n```\n\n## License\n\nMIT License.\n\n## Contact\n\nhttps://www.chraibi.de/\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchraibi%2Famritsar","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fchraibi%2Famritsar","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchraibi%2Famritsar/lists"}