EconPapers    
Economics at your fingertips  
 

Simulating Evolutionary Games: A Python-Based Introduction

Alan Isaac

Journal of Artificial Societies and Social Simulation, 2008, vol. 11, issue 3, 8

Abstract: This paper is an introduction to agent-based simulation using the Python programming language. The core objective of the paper is to enable students, teachers, and researchers immediately to begin social-science simulation projects in a general purpose programming language. This objective is facilitated by design features of the Python programming language, which we very briefly discuss. The paper has a 'tutorial' component, in that it is enablement-focused and therefore strongly application-oriented. As our illustrative application, we choose a classic agent-based simulation model: the evolutionary iterated prisoner's dilemma. We show how to simulate the iterated prisoner's dilemma with code that is simple and readable yet flexible and easily extensible. Despite the simplicity of the code, it constitutes a useful and easily extended simulation toolkit. We offer three examples of this extensibility: we explore the classic result that topology matters for evolutionary outcomes, we show how player type evolution is affected by payoff cardinality, and we show that strategy evaluation procedures can affect strategy persistence. Social science students and instructors should find that this paper provides adequate background to immediately begin their own simulation projects. Social science researchers will additionally be able to compare the simplicity, readability, and extensibility of the Python code with comparable simulations in other languages.

Keywords: Agent-Based Simulation; Python; Prisoner's Dilemma (search for similar items in EconPapers)
Date: 2008-06-30
References: View references in EconPapers View complete reference list from CitEc
Citations: View citations in EconPapers (3)

Downloads: (external link)
https://www.jasss.org/11/3/8/8.pdf (application/pdf)

Related works:
This item may be available elsewhere in EconPapers: Search for items with the same title.

Export reference: BibTeX RIS (EndNote, ProCite, RefMan) HTML/Text

Persistent link: https://EconPapers.repec.org/RePEc:jas:jasssj:2008-8-2

Access Statistics for this article

More articles in Journal of Artificial Societies and Social Simulation from Journal of Artificial Societies and Social Simulation
Bibliographic data for series maintained by Francesco Renzini ().

 
Page updated 2025-03-19
Handle: RePEc:jas:jasssj:2008-8-2