Petri Net Assignment 

General Information

  • The due date is Thursday 19 November 2013, before 23:55.

  • Submissions must be done via Blackboard. Beware that Blackboard's clock may differ slightly from yours.

  • The assignment must be made in groups of two students.

  • Grading will be done based on correctness and completeness of the solution. Do not forget to document your requirements, assumptions, design, implementation and modelling and simulation results in detail !

The assignment:

Petri Net modelling, simulation and analysis of a simple Role Playing Game (using pipe 2)

You will use the Petri net tool pipe 2.

Required

Syntax and Static Semantics

  1. An RPGGame consists of exactly one scene (or "level"). The scene has a name, such as Forest, Desert, Castle, etc.
  2. In each scene, there are a number of connected tiles.
  3. Tiles can be connected to each other from the left, right, top or bottom. This way, a map is created for the scene.
  4. If a tile has a left neighbor, that neighbor should have the tile as its right neighbor. If a tile has a top neighbor, that neighbor should have the tile as its bottom neighbor.
  5. In the game, there are two characters: the hero and the villain. A character is always on exactly one tile.
  6. A tile can be an empty tile, or an obstacle, on which no character can stand.
  7. There can be a trap on a tile. Each trap has a damage value, by default 1 (although it can be set otherwise).
  8. On an "standard" tile (not an obstacle), there can be an item: a goal or a weapon.
  9. The hero and a villain have a damage value that depicts how much damage they inflict. The default damage value for the hero and for a villain is 2 (although it can be set otherwise).
  10. The hero and a villain have a health value that depicts how much damage they can take. The default health for the hero and for a villain is 5 (although it can be set otherwise).

Dynamic (Behavioural) Semantics

  1. A character can move from one adjacent tile to another (provided it is not an obstacle or it is not occupied).
  2. The hero can attack villains and vice versa, if they stand on the same tile.
  3. A trap hurts the hero, but not a villain (they have set these traps...).
  4. The hero and a villain inflict damage (according to their damage value) if they choose to attack (when on the same tile). A trap inflicts damage (according to their damage value) on the hero if the hero steps onto it.
  5. A hero or villain dies if their health becomes 0.
  6. An item can be picked up by the hero by walking on its tile. Every item can only be picked up once.
  7. A hero can pick up a weapon, that can give the hero additional damage, according to the damage of the weapon (by default 1).
  8. A hero can pick up a goal. There must be at least one goal in the game.
  9. The game is simulated in time slices: first, the hero gets one chance to move or attack. Then, the villain get his chance to move or attack.
  10. When the hero achieves the goals, or dies, the game is over.

The assignment consists of three parts.

  1. Build and document a Petri Net model of the RPG game. Create a scene with 3 by 3 tiles, containing everything described above. Do not use inhibitor arcs!
  2. Perform simulation steps of this process until the game ends, and comment.
  3. Build the coverability graph for this Petri Net and run conservation analysis (note that spurious solutions may occur). This will allow you to draw some conclusions about:
    • boundedness;
    • deadlock;
    • reachability;
    • liveness;
    • persistence;
    • strict alternation of hero and villain acting;
    • other insights derived from the conservation analysis.