【发布时间】:2015-12-14 08:29:46
【问题描述】:
我正在尝试解决以下问题。
Given the following:
resources: food, wood, stone, gold
units: peon(requirements: 50 food, town hall, 3 turns to make) which can produce: 10 amount of any resource or 3 building points
warrior(requirements: 30 food, 20 wood, 4 turns to make, barracks)
archer(requirements: 30 wood, 25 gold, archery, 3 turns to make)
buildings: town hall(requirements: 500 food, 500 points, 20 building points) required to produce peons, only one peon can be produced at a time
barracks: 100 wood, 50 stone, 10 building points, required to produce warriors
archery: 200 wood, 30 gold, 12 building points, at least one barracks, required to produce archers
and the following: starting resources, buildings, units and their quantities
final resources, buildings, units and their quantities
output: the minimum required turns to get from starting quantities to final quantities of resources, buildings and units
notes: you start with at least one town hall
what's the point of having multiple town halls: they can produce peons faster
现在,我的第一个方法是使用启发式方法来解决这个问题,即从最终状态中选择最昂贵的资源/建筑物/单元,并确定我需要什么才能达到该数量。
我的问题是:是否有任何非启发式方法来解决这个问题/这种类型的问题。
【问题讨论】:
标签: algorithm greedy heuristics