Curate this topic. To associate your repository with the game-theory topic, visit your repo's landing page and select "manage topics. Learn more. Skip to content. Here are public repositories matching this topic Language: All Filter by language.
Sort options. Star 1. Updated Aug 12, Star 1k. Updated Aug 13, Star A research tool for the Iterated Prisoner's Dilemma. Updated Nov 30, Python. Code and datasets for the Tsetlin Machine. Updated Jan 4, Cython. Updated Dec 15, Updated Jul 29, Updated Nov 18, Jupyter Notebook. Matches and Tournaments. Writing a Strategy. Human Strategy. View code. Game-Theory-and-Python This is a repository created to run a workshop on Game Theory using the programming language Python and more specifically an open-source software called the Axelrod Python library.
The topics being covered in this workshop are the following: An introduction to game theory and the Iterated Prisoner's Dilemma Creating matches and tournaments using Axelrod-Python Writing strategies and contributing to Axelrod-Python Playing against strategies of the Iterated Prisoner's Dilemma Installing Python There are various distributions of Python. Virtual Environment This repository comes with an environment. Usage The tutorial Game Theory and Python can be used in a workshop environment or through independent learning.
Workshop: The material have been designed for a 2 hours workshop. Suggested timetable: - Installation guidelines are given above - An introduction to game theory and the Iterated Prisoner's Dilemma - Creating matches and tournaments using Axelrod-Python - Writing strategies and contributing to Axelrod-Python - Playing against strategies of the Iterated Prisoner's Dilemma - Closing remarks and wrapping up In a workshop environment we suggest that the instructor has familiarized themselves with the written parts of the tutorial beforehand.
Suggested timetable: - Installation guidelines are given above - An introduction to game theory and the Iterated Prisoner's Dilemma - Creating matches and tournaments using Axelrod-Python - Writing strategies and contributing to Axelrod-Python - Playing against strategies of the Iterated Prisoner's Dilemma If the tutorial is being followed by an individual learner, we suggest that the learner reads the written parts of each notebook followed by running the tutorial and completing the exercises.
Contributions All contributions are welcome! Events This tutorial has been used in the following events: PyCon Namibia Have you used this tutorial in an event you hosted or participated? License The code in this repository, including all code samples in the notebooks listed above, is released under the MIT license.
About Game Theory and Python, a workshop investigating repeated games using the prisoner's dilemma Topics python game-theory ipd axelrod-python-library.
MIT License. Code of conduct. At the end of the installation, you can begin to set the game conditions. For two players with a non-zero result which is the default value in Nashpy , you need to create two matrices that reflect the game situations for each player. For example, for player 1, the matrix will look like this:. Looking at these plates, we can get an estimate of the usefulness of the interaction of the players. We can get the same thing with matrix calculations in Nashphy.
We take a vector of actions as a sigma we have two of them: to collaborate or hand in another prisoner , where the value 0 is assigned to all cells except the one where the action takes place. Then for player 1, the utility of the action will be calculated as:. Applying the formula to the scenario, when player 1 chose a strategy for cooperation with another player, and player 2 decided to turn in player 1, we get:.
We will find out whether the algorithm finds the Nash equilibrium, which, as we have already found out, is NC; NC :. As you can see, the Nash equilibrium consists of two vectors, each of which reflects the actions of one player: for player 1, this [0; 1], where 1 in the second field means that player 1 has decided to turn in player 2. We see a similar picture for the second player. Skip to content Game theory is a method of studying strategic situations where the results depend not only on your actions, but also on what others will do.
0コメント