Git Product home page Git Product logo

dynamics_sim's Introduction

A generic, extensible simulation library for evolutionary game theory simulations. DyPy provides Moran, and Wright-Fisher processes, as well as Replicator Dynamics and makes it simple to execute complex and robust simulations across a range of parameters and visualize the results with beautiful graphs.

See documentation here.

####Requirements

DyPy depends on matplotlib for graphing, and numpy and joblib. To install these dependencies, make sure you are in the root directory of the repo and run the following command, which may require sudo.

$ pip install -r requirements.txt

####Usage

The easiest way to get started with DyPy is to subclass the Game class and define the game that of interest to be simulated by defining its payoff matrix appropriately as a function of various parameters. You can also define a function that classifies equlibria as a function of the distribution of players playing each strategy.

Once the game class is defined, choose a dynamics process and execute the desired simulation. Some options are:

  • Simulate a given number of generations of one simulation, and graph the dynamics of each player's strategies over time
  • Repeat a given simulation multiple times and return the frequency of each resulting equilibria.
  • Vary one or more parameters to the dynamics or game constructors and graph the effect of this variation on the resulting equilibria, either in 2D or 2D graphs.

The GameDynamicsWrapper and VariedGame classes take care of simplifying the simulation and graphing processes, and automatically parallelize the computations across all available cores.

To see an example, take a look at the Cooperate Without Looking subclass along with its associated simulations.

####Persistence (coming soon)

DyPy decouples the process of simulating with graphing. This encourages users to run long-running simulations and gather tons of data, and then insert and tweak the graph parameters afterwards.

dynamics_sim's People

Contributors

ecbtln avatar kaxixi 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.