Giter Club home page Giter Club logo

coordinatedcharging_socialstructure's Introduction

Coordinated Charging and Social Structure

This repository contains code and supporting documentation for the agent-based model analyzed in upcoming work tentatively called "Components for a theory of culture to promote the spread of coordinated charging behaviors." It is a fork of eehh-stanford/SustainableCBA in the process of being repurposed for analyzing the spread of the more specific climate change-adaptive behavior, coordinated charging. In this model, there will be two populations living in two separate neighborhoods, and they preferentially work in their own neighborhood. They have the option to engage in a coordinated charging behavior or not, which could be workplace charging or vehicle-to-building, delayed charging in morning instead of directly after work, etc.

Quick start

To get started, clone this repository, e.g., execute the following in the terminal:

git clone https://github.com/mt-digital/CoordinatedCharging_SocialStructure

After cloning the repository, install all dependencies by first starting the Julia REPL then run

julia> using Pkg; Pkg.activate("."); Pkg.instantiate()

Unit tests

We developed our model using test-driven development, which uses small, executable code snippets to confirm the model works as expected and to document model mechanics; see src/test/model.jl to view the test suite.

While still in the REPL, run the unit tests to make sure all is working well:

julia> include("src/test/model.jl")

This should print two "Test Summary" outputs where all tests are shown to pass. The tests initialize specially-initialized models and checks that model outputs are as expected.

Run the model and analyze results

Model and computational experiments

The model is implemented in src/model.jl and the computational experiments that run the model over all parameter settings for the desired number of trials and used by the Slurm scripts (below) is in src/experiment.jl.

Run all simulations on Slurm cluster

To run simulations on a Slurm cluster, log in to the cluster then execute the following commands from the project directory, first

./scripts/slurm/main.sh

to run the main analyses, and

./scripts/slurm/supplement.sh

to run the supplemental analyses. This creates a fresh, distinct version of simulation results that can be analyzed as we explain below, using archived data of the simulations used to create our results in the submitted version of the paper.

Analysis

Use main_asymm_heatmaps to create the main heatmap results of success rate as a function of $h_\mathrm{min}$ and $h_\mathrm{maj}$, which can be found in scripts/plot.R. For creating the heatmaps of average time to model fixation, pass the keyword argument measure = "step" to main_asymm_heatmaps. Similarly, to create supplemental analyses use the supp_asymm_heatmaps function in scripts/plot.R.

To create time series of individual model runs, use the make_all_group_prevalence_comparisons function in scripts/analysis.jl.

coordinatedcharging_socialstructure's People

Contributors

mt-digital avatar juemos avatar

Stargazers

Roman avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.