Git Product home page Git Product logo

gametheory's Introduction

An easy-to-use resource created by Luke Currier and Rory Smead for modeling replicator dynamics using Python!

Guide to Running Simulations

How to run in Google Colab:

  1. Go to https://colab.google/.

  2. In the upper right corner, click New Notebook.

  3. Once in your notebook, click File -> Upload Notebook -> Github.

  4. Search for "rorysmead/gametheory".

  5. Select "Current Version". It should load automatically.

  6. Once in the notebook, you need to run the first two cells before you can run the third cell containing run(). You can do that using Shift->Return or by pressing the play button in the top left corner of the cell.

  7. Once you've done that, you're off to the races! You can create new matrices by using the same format as the others in the second code cell (make sure you type your brackets and commas carefully, we'll try to figure out a better way of doing this soon!).

  8. Additionally, you can edit mutation and correlation levels as well as change how the output appears using the variables listed below and in the notebook.

Variables:

Mutation: mu
Default value: 0.00
The chance of mutation, from 0 to 1.

Correlation: r
Default value: 0.00
The chance of correlation, from 0 to 1.

Number of Runs: runs
Default value: 10
The number of times the program runs a randomized simulation according to the provided matrix.
The program will average results from all runs to arrive at a percentage spread of strategies.

Maximum Number of Generations: maxgen
Default value: 1000
The maximum number of replications in a given simulation.
This number will not be reached by most traditional games.

Print Runs: printruns
Default value: True
A boolean (True or False) that determines if the simulation shows results for each individual run in addition to the averaged results.

Print Generations: printgen
Default value: True
A boolean (True or False) that determines if the simulation shows how many generations it took for the simulation to stabilize.

Random Matrix: randfill
Default value: True
A boolean (True or False) that determines whether the matrix has random or uniform distribution.

Project Overview and Description

This is an original project created by Luke Currier, assisted by and based on code from Rory Smead. It is meant to be an easy-to-use companion for non-technical game theorists who want to observe replicator dynamics for assorted game matrix combinations, and an alternative to popular but more complicated game theory simulation tools such as NashPy. Meant to be easy to understand and interact with, as well as build on top of if desired, its notebook format provides easy interaction while keeping it simple - a full UI is something that would be an awesome project in the future.

The notebook is organized into four sections - variables and a user guide, the backend code which runs the replicator dynamics, the editable matrix window, and a last slot to run the program without having to worry about interacting with the matrices. Users should feel free to mess around with the second two as much as they'd like and experiment, but I only recommend changing the code in the second section if you know what you're doing! Changing things in google colab won't alter the github code, so you'll be able to switch things up as much as you'd like on your personal copy of the code.

Thank you for using our project, and we hope you enjoy!

gametheory's People

Contributors

dastardi avatar rorysmead 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.