Warning
This page is located in archive.

Assignment #1 – Programming in Jason

News

2015-11-11: The `head` belief contains a bug (thanks to Ondřej Hubáček for pointing that out). If you want to use it, please use the following implementation:

head([],false).
head([X|List],X).
Additionally, you may be interested in the list of internal actions available (those starting with a dot). You can check the Javadoc of Jason's standard library here.

2015-11-10: New public scenario was released. Check downloads section.

Assignment

A group of four miners is facing an uneasy task. It is deployed to a gold mine and the miners have to collect all gold stones scattered around the mine and bring them all to one of the company depots. The company is saving money wherever it can and the stones they have to carry are becoming more and more heavy. At this point, these stones have become that heavy that no single one of them can lift them alone. Every time a miner wants to lift a stone, he must call some friend to help him. Will you help them to collect all the gold stones in time?

Scenario 1: On day one, they were quite lucky. They have arrived in a tidy gold mine and they may go wherever they want. The only problem here is that the work is still in progress and new gold stones appear from time to time. Whenever a gold stone appears somewhere in the mine, miners must be able to find it and bring it to a depot. If the miners do succeed, they will be awarded 2 points.

Scenario 2: The mine they visit on the second day is also a tidy one. The situation on day two might seem even more plausible for them. The hard digging work has already terminated and the miners just have to collect those gold stones that are present in the mine at the time they entered it (i.e. no gold stones will appear throughout the time). Unfortunately the dawn is quite close and miners must hurry to get everything done in time. In case they succeed they will get 2 points.

Scenario 3: The next day, they arrived in a different mine. As soon as they arrived, they realized that several machines are still located on the site (1×1 obstacles). Luckily for them, there is a lot of free space around the machines — if the miners want, they can form a square formation (2×2) and they can keep this formation while walking around the mine. In case of the success, miners will be awarded 2 points.

Scenario 4: The situation is getting harder and harder. The next mine they visit is divided into two rectangular submines and a pair of miners is deployed into each one of them. They might be used to work with just one colleague — but this time they have to forget about their habits and find a new colleague. At the end of their shift, miners will recieve 2 points.

Scenario 5: On day five, they are visiting exactly the same mine as on the day 3 — and it is also in the same mess as it used to be. However in the meanwhile, managers have decided that the division of mines into two rectangular submines was a great success and thus implemented it even here. Successful miners will get 1 points.

Competition: The group of the miners was proven to be highly competent and thus the managers have decided to send them to a mining competition. Five fastest groups of miners will be awarded another 1 point.

Mining research The conditions in the mining industry are getting worse every day. If you think your group of miners can overcome even greater difficulties, they may be awarded some extra points (after prior discussion with the tutor).

Available actions:

do(down), do(up), do(left), do(right), do(skip), do(pick), do(drop)

Available percepts:

cell(X,Y,gold), cell(X,Y,ally), cell(X,Y,depot), cell(X,Y,obstacle), pos(X,Y), carrying_gold, name(N), gsize(_,W,H)

Rules:

  • Miners see objects only in the 8-neighborhood of their position (i.e. you have to find the objects on the map).
  • The pick action fails if there is no colleague in the 4-neighbourhood of the miner's position.
  • A miner can carry at most one gold stone at a time.
  • Position of depots are not known apriori and must be discovered.
  • The percepts are issued to the agent only after each external action – consider using do(skip) if you are waiting for a certain percept.
  • do(skip) action takes nearly no time regardless the action duration setting

Download

Assessment

  • DEADLINE: 18.11.2015 4:00
  • Maximum number of points for this assignment: 11 pts (when submitted after deadline 0 pts)
    • max 2 pts if the team succeeds in collecting all gold stones in Scenario 1 (i.e. dynamically changing mine with no obstacles)
    • max 2 pts if the team succeeds in collecting all gold stones in Scenario 2 (i.e. no obstacles and no gold added after the simulation started) within the time limit
    • max 2 pts if the team collect all gold stones in Scenario 3 (i.e. mine with 1×1 obstacles with sufficient space around them)
    • max 2 pts if your miners collect every gold stone in Scenario 4 (i.e. mine divided into 2 rectangular subareas - each containing at least one depot)
    • max 1 pts if your miners succeed in a Scenario 5 (i.e. a scenario containing features from both scenarios 3 and 4)
    • 1 point if you place amongst 5 fastest mining teams (in terms of execution time, 50ms per step) on Scenarios 3-5 (time will be taken as the average from runtimes on each of the scenarios)
    • 1 point for a short report describing problems you have encountered and the ways you used to overcome them.
      • How have you found the gold stones and depots?
      • How have you solved synchronization problems?
    • BONUS if your team is able to cope with much more difficult mining scenarios (ask me first). Unfortunately we have just 40 points for you in total, so you could use these points just to compensate your losses in other tasks.
  • Except for the Scenario 1, teams should not be much slower than our reference solution (using 50ms duration of each action). Do not submit agents relying just on their luck please ;-)
    • If your team fails to collect gold stones in time, but your team does reasonable things (i.e. does not wander randomly around the mine) you might still be awarded all the points. Do not forget to mention it in the report!
  • For every scenario, several runs on varying mines will be executed. The points you will get will be proportional to the number of successfully solved instances.
  • Your team must be able to work reliably with any setting of delay after execution of each step

Note: The scenarios used for evaluation purposes might not be identical to the ones present in the public bundle.

Submitting your solution

Create a zip archive containing miner.asl file and your report in PDF format and submit it to the upload system. If you do not have access to the upload system, please send your files to karel.horak@agents.fel.cvut.cz.

FAQ

Q: Are the actions in the environment executed synchronously?

A: The do() actions take the same time to execute in the environment, but they are not executed synchronously by all the agents.

courses/ae4m36mas/assignment1-jason.txt · Last modified: 2015/11/11 13:11 by horakka5