囚徒困境python框架Axelrod小试

2018-03-01 11:08:41来源:oschina作者:StanleySun人点击

分享

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']

最新文章

123

最新摄影

微信扫一扫

第七城市微信公众平台