人工智能代写 |AI 代写

COMP90054 Assignment2


You must read fully and carefully the assignment specification and instructions detailed in this file. You are NOT to modify this file in any way.

  • Course: COMP90054 AI Planning for Autonomy @ Semester 1, 2024
  • Instructor: Dr. Nir Lipovetzky, Dr.Joe West and Dr. Sarita Rosenstock
  • Code Deadline: Thursday 11th April, 2024 @ 18:00 (Mid of Week 6)
  • Deadline: Monday 15th April, 2024 @ 18:00 (start of Week 7)
  • Course Weight: 10%
  • Assignment type:: Individual
  • ILOs covered: 1, 2, and 3
  • Submission method: via git tagging and Canvas submission (see Submission Instructions below for instructions)
  • Extensions: For extension applications, email Nir or Joe. He will ask you to consider whether an extension is really a good idea, as it is likely to impact other assessments. If an extension is not a good option, try to do what you can and let us know about your work and learning in the self-evaluation.

The aim of this project is to improve your understanding of PDDL modelling.

(Un)grading

Assignment 2 will use ungrading the same way that assignment 1 did. We have given some additional detail to clarify the self evaluation and to help people learn how to "deal with" ungrading.

Based on assignment 1 feedback, a majority of people preferred self-grading (85.5%), with about 14.5% prefering traditional grading. The main reasons people disliked ungrading this last 2 semesters were:

  1. Quite a few people saying that they found it great but they wanted to just be able to tick boxes to get marks so they could "know" what their mark would be. We agree this is good if your only aim is to get marks rather than to learn, which is precisely why we are using ungrading: to encourage learning. Further, this is much closer to reality -- there are very few tech jobs where peopel get structured rubrics to assess their contribution.
  1. It seems many people felt that they have to write a lot for the self evaluation. A self assessment can be short AND good. There is no need to write pages of text -- just justify why you did a good job and learnt stuff. In Assignment 2, we give a bit more direction and set expecations to avoid people spending too much time on the self evaluation
  2. A number of people felt that the self evaluation was unnecessary when there are test cases. However, several people who said this also commented that it did make them reflect on their own learning, so this is good! In addition, many people who liked ungrading commented that it reduced the stress of trying to get every test case right.
  3. A number of people felt that they should get partial marks for the part 3. (This is why we use self-grading, you can use self evaluation to give yourselves the marks you think you deserve and justified the reason).

There were many reasons people liked ungrading, chiefly:

  1. Independence and autonomy: people felt more responsible for their own learning and appreciated the additional autonomy and independence that ungrading provided.
  2. Reduced the stress of trying to get everything right and figure out what the staff wanted to see.
  3. Allowed people to explore and take a few more risks, because if they failed, learning still occurred.

More generally, we very few people either not submitting a self evaluation or not really taking the time to reflect on their learning. In this assignment, we make the expectations clearer: students are marked based on their self evaluation.

Task

Your task is to read the description of the domain below and encode the three planning problem instances specified filling the template files provided in this repository in the folder pddl_template. Finally, you will be asked to extend your solution to deal with an updated spec.

The Domain - Real Player Game Scenario

Help the hero to get out of dungeon!

A hero woke up in a dungeon full of monsters and traps (perhaps the party last night went wrong...) and needs your help to get out. Here are basic facts for the dungeon domain:

  • The dungeon contains rooms that are connected by corridors (dungeon can thus be represented by undirected graph)
  • each room can be empty, or can have a monster in it, or can have a trap in it, or can have a sword in it
  • one of the empty rooms is the goal: it has an exit, so the hero can escape

The hero is lucky since she/he has full knowledge about the dungeon. But not that lucky – just after the hero leaves each room s/he visits, the room is destroyed and cannot be visited again.

The hero can perform the following actions – but only if s/he is alive!

  • The hero can move to an adjacent room (connected by a corridor) that has not been destroyed (i.e., the hero has not already visited the room)
  • Pickup the sword if present in the room the hero is currently in and the hero is empty handed
  • Destroy the sword that the hero currently holds. However, this can have unpleasant effects if done in a room with a trap or a monster: it triggers the trap or invites the monster to eat the hero.
  • Disarm a trap – if there is a trap in the room the hero is in and the hero is empty-handed (does not hold a sword), then the hero can disarm it

However, there are some (dangerous) constraints the hero has to consider:

  • If the hero enters a room with a monster in it, s/he has to carry a sword (so the monster is afraid of him/her), otherwise the monster kills him/her. Notice that the hero is pacifist, so s/he cannot kill the monster.
  • If the hero destroys the sword in a room with a monster in it, the monster kills him/her as well.
  • The only action the hero can safely perform in a room with a trap in it is the disarm a trap action. Any other action (even moving away) triggers the trap which kills the hero.

Important: We recommend reading the description carefully several times to make sure you fully understand it before starting coding in PDDL.

Problem 1

The problems are specified such that cells stand for rooms and edges between them represent corridors. I is the hero's initial position, G is hero's desired goal position,  indicates a sword, M is a monster, and T stands for trap. The numbers identify a unique ID for each cell. Good luck!

problem1

Problem 2

problem1

Problem 3

problem1

Planimated Example Solution

Planimation

You can generate the gif above to visualise your solutions, but you will need to use the planimation plugin in the editor.planning.domains, the animation file, and you will need to add a cell predicate to the domain and problem files, so that the animation engine can distribute the cells in a grid accordingly. This is not mandatory, it's just optional in case you want to visualise your solutions. Happy to discuss this further in ED.

Problem 4

Once you modeled correctly the three problems, please consider how would you change your PDDL domain and problem to make it turn based and support multiple heroes. Turn based means each hero take turns to complete a round, where at each turn the planner chooses an action for ONE hero present in the dungeon and after every agent chosen one action, a round is complete. The turn order of heroes in a round can be arbitary, i.e (h1->h2->h3) then (h1->h2->h3), or (h1->h2->h3) then (h3->h1->h2) are both valid.

Now some rooms are locked, and heroes need a key to enter them. Any key can open any locked room multiple times, but those locked rooms stays locked. The key works like the sword: if a hero has the key, they can't carry the sword or disarm traps, and the key has no sharing space with other items or monsters or traps. Heroes can pick up or destroy the key.

Also, to save the resources heroes can give the item they hold to other hero if they're in the same room, but they won't ask for items themselves because they're shy. And remember, if there's a trap, they can't share items. Monsters might still attack heroes who don't have a sword, even if other heroes in the same room do.

You will likely need to add or change existing predicates and actions. Include a problem instance with more than one hero and more than one locked room where all of them CAN reach their respective goals. Once a hero reaches a target goal location, you can assume the planner cannot assign more actions for that hero.

 

咨询 Alpha 小助手,获取更多课业帮助