observingacrowd

This repo contains supporting code for the manuscript 'Observing a crowd to infer the characteristics of agents'.

https://github.com/arshednabeel/observingacrowd

Science Score: 44.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
    Found CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
  • Academic publication links
  • Academic email domains
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (10.7%) to scientific vocabulary
Last synced: 10 months ago · JSON representation ·

Repository

This repo contains supporting code for the manuscript 'Observing a crowd to infer the characteristics of agents'.

Basic Info
  • Host: GitHub
  • Owner: arshednabeel
  • Language: Python
  • Default Branch: main
  • Size: 77.1 KB
Statistics
  • Stars: 0
  • Watchers: 1
  • Forks: 1
  • Open Issues: 0
  • Releases: 1
Created about 5 years ago · Last pushed about 4 years ago
Metadata Files
Readme Citation

README.md

Observing and Inferring A Collective

This repo contains the supporting code for the manuscript 'Observing a Collective to Infer the Characteristics of Agents'

The code is organized as two subdirectories: Simulation, which contains code (MATLAB) to generate simulated data, and Analysis, which contains code (Python) that performs classification analysis. The general workflow is as follows:

  • Use simulation scripts to generate simulated data (MAT files).
  • Use the functions in batch_processing.py script to generate summary data.
  • Use the functions in figures.py to reproduce figures in the manuscript.

Simulation

Runner_OandI_delv_rho_Nr.m : Runs the 2D simulations for a variety of parameters: delv (which is the intrinsic speed, s0), Nr (which is the number ratio) and rho which is the packing density.

ABM_bidispese_delv_rho_Nr.m : Code for the Agent based model for circular agents in 2D periodic domain for a given set of parameters. agents_Expmemory_per2D.m : Contains the forces on the agents (self-propulsion, inter-agent short ranged interaction, brownian noise (turned off in the default))

RandomizationOfAgents_InitialConditions.m and agents_Expmemory_per2D_Randomization.m : These functions are used to create randomly packed arrangement of agents for the initial conditions to be used later in ABM_bidispese_delv_rho_Nr.m.

parameters.m and parameters_additional.m the required parameters for the ABM simulations.

NOTE: To reproduce the results in the paper (ArXiv link), run Runner_OandI_delv_rho_Nr.m. The system size N can be varied in the above m file. The parameters corresponding to the forces between the agents can be changed using the parameters.m file.

Analysis

Most of the heavy-lifting is done by the classes AgentDynamics (see agent_dynamics.py) and DataClassifier (see classify.py). AgentDynamics represents one simulation realization, while DataClassifier aggregates multiple realizations for a given set of parameters. See the methods of each class for more details, most of the methods are documented.

Once we have simulated data from the simulation scripts, batch_processing.py script contains functions to process and summarize classification results.

  • cache_all_data and cache_all_data_parallel collects and summarizes simulation data (MAT files) into summary representations.
  • compute_classification_metrics performs classification analysis (with both observers -- see paper for details) on the summary representations, and saves the confusion matrices.
  • The functions in figures.py uses the confusion matrices and summary representations to generate figures from the manuscript.

Owner

  • Name: Arshed Nabeel
  • Login: arshednabeel
  • Kind: user
  • Location: Bangalore
  • Company: Indian Institute of Science, Bangalore

Citation (CITATION.cff)

cff-version: 1.2.0
message: "If you use this software, please cite it as below."
authors:
- family-names: "Nabeel"
  given-names: "Arshed"
  orcid: "https://orcid.org/0000-0001-9750-9070"
- family-names: "Masila"
  given-names: "Danny Raj"
  orcid: "https://orcid.org/0000-0002-6983-0390"
title: "ObservingACrowd"
version: 1.0.0
url: "https://github.com/arshednabeel/ObservingACrowd"

GitHub Events

Total
Last Year

Dependencies

Analysis/requirements.txt pypi
  • joblib ==1.0.0
  • matplotlib ==3.3.2
  • numpy ==1.19.2
  • scikit_learn ==0.24.2
  • scipy ==1.5.2
  • tqdm ==4.51.0