Code Monkey home page Code Monkey logo

tutorial_agent_based_models's Introduction

Tutorial_Agent_Based_Models

A Short Tutorial on Agent Based Modeling in Python

Authors: Limor Raviv and Bill Thompson

Updated: 07.03.2018

Summary

This repository contains three Jupyter notebooks offering a short tutorial on agent-based modeling using Python. They are intended to offer anyone with little or no prior experience with Python the ability to incrementally construct a simple simulation of sound change in a population of agents with different personalities (stubborn or flexible learners). We will try to answer questions like: Has one of the variants spread to the entire community? Does this depend on the community's size and initial structure? How many stubborn people must be present to prevent (or facilitate?) convergence? etc.

This choice of model and questions reflect our personal theoretical interests: the cultural evolution of language through interaction in populations. However, we hope that the tutorials can also be of use to those who wish to build simulations of completely different topics, by modifying the basic parameters of the model.

We aim for simplicity in design: agents are represented as simple Python lists whose elements represent their properties; populations are represented as lists of agents; evolution is implemented by looping over members of the population and modifying their properties. It is our hope that these implementational principles can be applied to a broad range of phenomena. In addition, any part of the code can be changed to introduce new features and constraints.

Please let us know if you have any comments, suggestions or questions regarding this notebook!

Technical Requirements

To view the tutorial in the browser, just click on each notebook. For a more interactive experience in which you can fiddle with the code and run the simulations yourself, you can download the tutorial by clicking the green "Clone or Download" button at the top right of this page, and open it as a Jupyter Notebook.

You'll need Python and Jupyter installed to run the notebooks yourself. We recommend using the Anaconda distribution of Python, which already includes everything you need including Jupyter. If you need any help with the installation process, you can check out these two tutorials: for installing Anaconda on Windows or on a Mac. We wrote the tutorial using Python 2.7, so it's probably better to use Python 2.7 to run the notebooks unless you understand the differences between Python versions 2.7 and 3.x.

For instructions on how to open and use jupyter notebooks, see this page.

Notebooks

If you already know Python, jump straight to Part Two.

Part One:

notebook here

Part one lays out the Python basics. We hope that this notebook can be a good starting point even with no prior experience of programming, but it is designed to be readable in an afternoon by someone who understands how programming works in general (e.g. can code in another language, like R or Matlab), but doesn't have much experience with Python.

You'll need to be reasonably comfortable with the material in this notebook to begin building the models in the following sections.

To open the jupyter notebook,

Part Two:

notebook here

Part two uses the knowledge from part one to build a model of communicating agents with different biases (vowel preferences, personality) step by step.

By the end of the notebook you'll be running multiple simulations on different conditions, and plot your results to see trends in interactions patterns.

Part Three:

notebook here

Part three expands on the functions introduced in part two and introduces new features for building a slightly more complex and ecologically valid model of communicating agents.

We hope you'll find this tutorial useful, and we'd love to hear from you!

Contact Us: [email protected] // [email protected]

tutorial_agent_based_models's People

Contributors

wschuell avatar limor-raviv avatar billdthompson avatar

Watchers

James Cloos 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.