囚徒困境python框架Axelrod小试

git库地址:https://github.com/Axelrod-Python/Axelrod

安装

pip3 install axelrod

Quick Start

$ python3
>>> import axelrod as axl
>>> axl.seed(0)  # Set a seed
>>> players = [s() for s in axl.demo_strategies]  # Create players
>>> tournament = axl.Tournament(players)  # Create a tournament
>>> results = tournament.play()  # Play the tournament
>>> results.ranked_names
['Defector', 'Grudger', 'Tit For Tat', 'Cooperator', 'Random']

猜你喜欢

转载自my.oschina.net/stanleysun/blog/1625158
今日推荐