本文整理汇总了Python中agent.Agent.perform_production方法的典型用法代码示例。如果您正苦于以下问题:Python Agent.perform_production方法的具体用法?Python Agent.perform_production怎么用?Python Agent.perform_production使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类agent.Agent
的用法示例。
在下文中一共展示了Agent.perform_production方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_blacksmith_production_whole
# 需要导入模块: from agent import Agent [as 别名]
# 或者: from agent.Agent import perform_production [as 别名]
def test_blacksmith_production_whole(self):
f = Agent(occupation='blacksmith')
f.inventory['Metal'] = 10
f.perform_production()
tools_amount = f.inventory['Tools']
self.assertEqual(tools_amount, 10)
示例2: test_miner_production
# 需要导入模块: from agent import Agent [as 别名]
# 或者: from agent.Agent import perform_production [as 别名]
def test_miner_production(self):
f = Agent(occupation='miner')
f.inventory['Food'] = 1
f.perform_production()
ore_amount = f.inventory['Ore']
self.assertEqual(ore_amount, 2)
示例3: test_woodcutter_production
# 需要导入模块: from agent import Agent [as 别名]
# 或者: from agent.Agent import perform_production [as 别名]
def test_woodcutter_production(self):
f = Agent(occupation='woodcutter')
f.inventory['Food'] = 1
f.perform_production()
wood_amount = f.inventory['Wood']
self.assertEqual(wood_amount, 1)
示例4: test_farmer_production
# 需要导入模块: from agent import Agent [as 别名]
# 或者: from agent.Agent import perform_production [as 别名]
def test_farmer_production(self):
f = Agent(occupation='farmer')
f.inventory['Wood'] = 1
f.perform_production()
food_amount = f.inventory['Food']
self.assertEqual(food_amount, 2)