Starting from:

$25

EECS391-Programming Exercise 5 Enhanced Automated Resource Collection Solved

Use the midas*BuildPeasant config files for this assignment. This is a continuation of resource collection. Now suppose you have an additional action, BuildPeasant (the Townhall can execute this action). This action requires 400 gold and 1 food. The Townhall supplies 3 food and each peasant currently on the map consumes 1 food. If successful, this operator will deduct 400 gold from the current gold tally and result in one additional peasant on the map, which can be subsequently used to collect gold and wood. Since your planner is a simple state space planner, it only produces sequential plans, which will not benefit from the parallelism possible with multiple peasants. To solve this, define additional actions as follows. Write additional Move, Harvest and Deposit operators, Movek, Harvestk and Depositk, that need k peasants to execute and have the effect of k=1 to 3 parallel Moves, Harvests and Deposits, but will only add the cost of a single action to the plan. To execute such operations, your PEA should then find k “idle” peasants and allocate them to carrying out the Movek, Harvestk and Depositk operator by finding the nearest goldmine/forest/townhall to go to. Note that your PEA can further heuristically parallelize your found plans, though this reduction in cost cannot be accounted for by the planner. For example, with 3 peasants, suppose you have a Move1(townhall,goldmine) and a Move2(townhall,forest) in sequence. Your PEA can parallelize these actions to execute at the same time by noticing that their preconditions can be simultaneously satisfied. This sort of  behavior by the execution agent falls under scheduling, a part of automated planning that we did not discuss in class. Be careful when writing heuristics for the BuildPeasant operator. Note that it has an immediate negative effect, i.e. it moves the plan farther from the goal. Somehow your heuristic needs to trade this off against the longer-term positive effect that the parallelism will allow.  

 (a) Set the goal state to be a gold tally of 1000 and a wood tally of 1000. Produce a plan and execute it in SEPIA. (b)  Set the goal state to be a gold tally of 3000 and a wood tally of 2000. Produce a plan and execute it in SEPIA. In each case, output the total time taken to actually execute the plan found. As before, be careful not to “pre-plan” by using your knowledge of the game.

If you feel ambitious, think about how to incorporate an additional action, BuildFarm. This action creates a new Farm that supplies additional food, which can be used to build even more peasants. At this point, however, you will need a proper scheduler to handle the parallelized action dispatching at each time step.  

More products