本文整理汇总了Python中market.Market.agent_report方法的典型用法代码示例。如果您正苦于以下问题:Python Market.agent_report方法的具体用法?Python Market.agent_report怎么用?Python Market.agent_report使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类market.Market
的用法示例。
在下文中一共展示了Market.agent_report方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: main
# 需要导入模块: from market import Market [as 别名]
# 或者: from market.Market import agent_report [as 别名]
def main():
clear()
print('Initializing Test...')
print('Creating Agents...')
agent_types = ['miner', 'farmer', 'refiner', 'woodcutter', 'blacksmith']
agents = [Agent(random.choice(agent_types)) for i in range(100)] # 100 random angets
agents = {agent.id: agent for agent in agents}
# Debug Printing
#print('Sample Agents...')
#for agent in agents[:10]:
# print(agent)
input('Hit any key to continue...')
print('Creating Market...')
market = Market()
market.agents = agents #This needs to be part of the api for Market class
for i in range(50): #10 rounds of market simulation
clear()
market.simulate()
report = market.market_report()
print(report)
report = market.agent_report()
print(report)
input('Hit any key to continue...')