FINAL PROJECT ASSIGNMENT
Artificial Intelligence1代写 In this project, you will work with search algorithms to be applied in a simulated environment where a drone takes aerial
DRONE CONTROL FOR AERIAL PHOTOGRAPHY
Artificial Intelligence Grado en Ingenier´ıa Informa´tica
In this project, you will work with search algorithms to be applied in a simulated environment where a drone takes aerial pictures of different predefined locations. The drone’s environment is discretized as shown in Figure 1. The drone starts the flight from its base, where it has to return once all the pictures are taken. The tiles with a diaphragm represent the locations where the drone has to take a picture. There are different types of terrains such a forest, water, and desert.Artificial Intelligence1代写
The programming language is Python. For purposes of this work, we will use the library SIMPLE-AI 0.8.1 (https://pypi.python.org/pypi/simpleai/), which implements many artificial intelligence al- gorithms, including uniformed and informed search algorithms.
The project consists of two parts:
- Part I (7p): basic part that consists of solving a problem in different
- PartII (3p): advanced part that consists of including additional characteristics to the simplified problem, such as types of terrains, drone battery,
Part I: Basic problem (7p) Artificial Intelligence1代写
The idea is to solve a search problem where a drone flies from its base to different locations to take pictures, and then flies back to its base. For purposes of this part, you must take into consideration that (1) the drone cannot fly over the water, and (2) the drone has unlimited battery. The cost of the solution will be the total number of movements performed by the drone.
Figure 1: Problem example: brown tiles represent a desert; green tiles represent a forest; blue tiles represent water; the drone is located at its base; tiles with a diaphragm represent locations to take a picture; light brown tiles represent tiles visited by the drone while simulating the path solution.Artificial Intelligence1代写
Your task consists of two parts:
1.Design and implementation: you will design and implement the problem representation (states and actions), heuristic function, and other additional functions required by the search module SIMPLE-AI. Additionally, you must run different search algorithms to solve the problem in order to check that the implementation is
2. Experimental evaluation and comparison:
- An experimental evaluation to solve the basic problem by using different search algorithms. The SIMPLE-AIlibrary includes, among others, the following search algorithms: breadth first, depth first, limited depth first, greedy, and astar (an example of a call to any of these algorithms is included in the given code). You will do a comparison among the different search algorithms considering number of expanded nodes, cost of the solution, and memory Information about the solution is shown at the end of the simulation.Artificial Intelligence1代写
- Developmentof at least three new scenarios that you consider Then, you will repeat the previous process to compare them. You can: evaluate the same scenario with and without terrain types representing water; modify the size of the grid, number of goals and their location; etc. You must analyze the impact of these changes in the solution of the problem.
Software installation Artificial Intelligence1代写
To install the software, unzip 201718 AI software.zip. Then, create an execution environment by in- stalling the package pygame1. To execute the software, open a command line terminal and type python startGame.py.
The files that you must modify are in the student folder, which has the following files:
- py, which defines the initial settings for theproblem.
- py, which contains the functions required by the search module SIMPLE-AI and that must beimplemented.
You will implement some functions required by the search module SIMPLE-AI. You will do that in the gameProblem.py file given. These files contain a class with the same name, and the definition of the functions that need to be implemented (indicated with comments in the code).Artificial Intelligence1代写
The class gameProblem represents the search problem. It has a list of attributes (described in the Appendix) that you can use to access the grid, types of terrain, etc. These variables can be consulted, but cannot be modified.
The functions you need to implement are the following:
- actions(s): function that receives a state s and returns a list of applicable actions ins.
- result(s,a): function that receives a state s1and an action a and returns a state s2, which is the result of applying a ins1.
1This is already installed in the machines at the university.Artificial Intelligence1代写
- isgoal(s): function that receives a state s and returns True if s is a goal Otherwise, it returns False.
- cost(s,a,s’): function that receives two states s and s’ and an action a, and returns the cost of reachings’ from s applying a.
- heuristic(s):function that receives a state s and returns the heuristic value of s; that is, the estimated cost of reaching the goal from s.
- setup(): function that configures the initial state, the goal state, and the search algorithm to use.
Part II: Advanced problems (3p)Artificial Intelligence1代写
The idea is to perform a similar experimental evaluation as before, but using problems with additional character- istics. To include these characteristics, you will need to make some changes in the design and implementation developed in Part I. We propose to include the following:
- Terrainwith costs. Each terrain type will have a different cost of flying over This cost could represent, for instance, the time or the battery consumed (it is harder to fly over the forest than over the desert). These costs could be modified in the file configuration.
- Heuristics. Define different heuristics and evaluate them.Artificial Intelligence1代写
- Limited battery. The drone has a battery capacity, which decreases with each performed action. The drone can fully charge its battery when it is located at certain locations in the grid, where there is a recharge station. You need to represent those locations in the grid and take them into account in the operators.The location of the recharge stations and the maximum battery capacity can be specified in the configuration file by adding an additional key.
Submission Artificial Intelligence1代写
This project must be done in pairs. You must submit a zip file through a link that will be posted on Aula Global. Note that, if you work in pairs, only one submission is needed. The zip file name must be pr-ai-2018-students- code.zip, where students-code is the last six digits of each student’s NIA (e.g. pr-ai-2018-123456-654321.zip). The zip file will consist of:
An essay containing the following sections (PDFfile):
- For eachpart:– Descriptionand explanation of the tasks performed within the project: problem representation and implemented
–Descriptionand explanation of the performed tests and the results obtained from such
3.Conclusions: technical comments related to the development of this project.
4.Personal comments: difficulties, challenges, benefits,etc.Artificial Intelligence1代写
- A directory, namely pr-ia-2018-student-code, containing the source code, including the parts you have implemented.
The deadline for the submission of the project is on May 13th!
Appendix: Software documentation Artificial Intelligence1代写
The given software consists of the following elements:
- The SIMPLE-AI library, which implements the search algorithms.
- The GAME-AI library, which is the graphic component. It consists of several files that must not be modified.
- The GAMEPROBLEM class, which is the class that you have to implement.
To execute the game open a terminal and type python startGame.py.
The graphical component interacts with the student’s component in the following way:
- During the initialization of the game, an object of gameProblem is created.
- Then,the function setup() is invoked; here you must specify the initial state, the goal state, and the search algorithm.
- Thesearch is performed using the search algorithm specified and returns a solution, if there is Then, the output shows the statistics for the performed search process.
- The graphical component performs a simulation to show the solution found. To do that, it simulates the solution using the predefined actions: ’North’,’East’,’South’,’West’ (the graphical componentignores any other action).
The output shows information about the performed search; it could be useful for the experimental part.Artificial Intelligence1代写
total length of solution: 47 total cost of solution: 51 visited nodes: 8001
iterations: 8001 max fringe size: 554
You could save this output in a file.
The configuration file config.py defines the configuration parameters of the problem. They are described in Ta- ble 1. You can modify the values of the fields of this file. Table 2 describes the fields of a tile. The “basic” tile is defined in “basicTile”. You can access the attributes by calling the methogetAttribute(position,key).Artificial Intelligence1代写
Each tile has two different versions that have identical attributes. One of them has the prefix “-traversed”; it is used by the simulator to change the color of the tile when the drone flies over it. Tiles tagged as traversed are not considered during the search process.
Table 3 describes the attributes of the gameProblem class. This class has the definition of the functions that you must implement.
Table 1: Description of fields of the configuration file Attribute Type Description
“text size” Int. Font size
“tile size” Int. Cell size
“type” “random” Generates a random grid “load” Loads grid from file
“seed” Int. Seed for the random number generator
“file” String File to load or save a grid Artificial Intelligence1代写
“save” Boolean True, save the grid to a file “map size” Tuple (Int,Int) Grid size (column, row) “delay” Float Simulation speed (0.1) “debugMap” Boolean True, shows the MAP variable “basicTile” String (key) default tile
“agentInit” Tuple Initial agent position (X, Y) “agentBaseTile” Key Tile that identifies the base of the agent “agentType” Key Agent type (do not modify) “agentMarker” Character Do not modify
“debug” Do not modify
“hazards” Do not modify
Table 2: Description of fields in tile
|Attribute||Type||Description Artificial Intelligence1代写|
|img||String||File containing the graphical image for the tile|
|id||String||Id of the tile in MAP and POSITIONS variables|
|marker||Char||Character used to symbolize the tile when loading or reading a grid from a file|
|num||Int||Number of tiles of this type in the grid|
|attributes||Dict.||Dictionary of attributes; it consists of at least an “agent” initialized to None|
DRONE CONTROL Artificial Intelligence1代写
|MAP||List   ||Map of the grid. Each tile is a list of:
Type of tile Id
attributes of the tile, loaded from the configuration file
|It contains the keys to all types of tiles of the grid
Type of tile
list of positions for the tiles of the type in key
|CONFIG||Dict.||Configuration from configuration file|
|AGENT START||Tuple  ||Initial position of the agent (from configuration file)
Coordinate X Coordinate Y
|INITIAL STATE||Student definition||Initial state, loaded during the initialization phase|
|GOAL||Student definition||Goal state, loaded during the initialization phase
and checked in is goal()