ai lab-1
-
Upload
aarav-singh -
Category
Documents
-
view
215 -
download
0
Transcript of ai lab-1
-
8/11/2019 ai lab-1
1/2
AI Lab
Assignment 1: GOAL
General Instructions:You can use any programming language that you like, provided it is available at thesystems you are using or can manage one. The submissions need to be finally made to the TAs.
Please discuss with the TA regarding the form of submission (only soft copies allowed, nothing
in hard copy). A dedicated team of TAs will check a large number of random pairs of codes. Anyformat of cheating and copying would go to the instructors for action. Minor copying would be
laughed at and ignored, serious ones would be dealt with the same degree as copying in any
written examination as per institutional policies (barbarically, if it does not exist). To avoid
problems please:i) Make sure your roll number and name appears in all source code text files that you make (1st
line of all source files) along with the assignment/question number.
ii) Any material copied from a friend or online (if permitted or necessary to proceed) is clearlymarked (// proudly coped from XXXX, he's awesome)
iii) Any non-standard external library or tool used is clearly marked in the source files at the start
of the main file.
The assignment is inspired by the FIFA World Cup, although having watched the matches or
knowing the game to a specialized degree is not a requirement of the assignment. We willhowever take an overly simplistic system for this assignment. Consider a single player, a ball and
a goal post. Consider that the field is made up of 10x10 blocks. Each block can either contain the
player, the ball or both. The ball can only move along with the player, it would otherwise lie as
static. Identify the Performance Measure, Environment, Actuators and Sensors for the systemand make a simulation architecture for this system, based on which answer the following
questions.
In all the questions make sure that the agent and the environment are kept separate, and each
entity as separate as possible. Please submit at least 2 questions inside the lab. The solutions can
be taken out, re-worked, extended, discussed and asked from the TAs/instructors. Extendedsolutions can be submitted separately, however the code part should be original or properly
credited. Normally it should be OK to share architecture (with credit) but not the agents. Please
maintain a separate project folder/source file for each question. Inputs can be hard coded in the
source files or dynamically supplied at execution time. Please supply a text/word file for allquestions with the inputs and the final output (the path traced by the player and the performance
measure). Repeat the same for 2 test cases per question. Only submit a question if the solution is
fully correct and tested. There is no part marking.
1. Imagine that the player can see the location of the ball and the goal post at all times, and his
own location. The player and the ball occupy one block each, while the goal post is the
region from (10,4) to (10,7). Move the player from his current position to the ball and thentogether with the ball to the goal post. A player can move in any of the 4 neighboring blocks
-
8/11/2019 ai lab-1
2/2
using the action MOVE; and if the player is in possession with the ball, he can move along
with the ball using the action KICK. For testing use different random locations of the player
and the ball.2. Imagine that the player can only see the ball if that lies in a Manhattan distance of 3 blocks.
Now modify the agent used in question 1 and build a state based agent. Note that there may
be numerous ways to achieve this, any would suffice.3. Imagine that the player can only see the ball if that lies 'ahead' where from the direction thatthe player is pointing to. The player can point in any one of the 4 directions
parallel/perpendicular to the field. Now modify the agent used in question 1 and build a state
based agent. For this question the player may additionally turn at angles of 90 degrees andsense his current orientation.
4. You realize that the only motion to the player and the ball is made by the agent itself and
hence continuously sensing the positions of the two are not needed, rather the information
can be maintained from the prior state of the player and ball and the actions applied to them.However now there is a goalkeeper who can exist in any one of the positions of the goalpost
and cannot leave the post. The game ends if goalkeeper catches the ball. The goalkeeper, the
player and the ball can move one block at a time. If a player/ball move to a location in thegoal post at the same time as the goal keeper, the priority is given to the player/ball. Make a
random agent for the goal keeper which randomly moves the goalkeeper.
5. Add 2 opponent players, who cannot move. Their positions at any time can be sensed. Make
a goal based agent which optimally moves the player to the goal. Solutions based onassumptions would be acceptable as long as the assumptions are stated.
6. Repeat question 5 when the players can move. However if any two players simultaneously
aim to reach the same position, they collide and the game is stopped. The game resumes withthe players and the ball in the original position (before colliding) and the ball in possession of
the player initially with the ball. Make random agents for each of the players. Solutions based
on assumptions would be acceptable as long as the assumptions are stated.