Search
We log on, discuss the rules, answer first questions, create first simple Python program.
Read about computer labs how to set-up initial password, access home directory, links to other university services, …
Reading about Python and programming essentials from the Programming Essentials course. Tutorials help with setting Python, discuss how to upload homework correctly, and add some class examples and some most frequent Python modules.
After solving the logging issues we will go into Objective Python. We will look into the environment you'll use to implement and deliver the algorithms you'll meet in the course. Python is well on-line documented/discussed, in case of problems, the internet is your friend. However, be careful to read about the plagiarism rules concerning your assignments uploads.
In the State Space Search environment, find the cheapest path. Keep in mind that the cost of changing positions is not necessarily the same everywhere.
How To
kuimaze.InfEasyMaze
maps/easy_intro/easy_intro_1.bmp
>>> import kuimaze >>> MAP = 'maps/easy_intro/easy_intro_1.bmp' >>> env = kuimaze.InfEasyMaze(map_image=MAP)
render()
>>> env.render()
reset()
>>> env.reset() ((1, 0, 0.0), (4, 2, 0.0))
expand()
>>> env.expand((1,0)) [[(2, 0), 1.0], [(0, 0), 1.0]]
env.render()
easy_example.py
Agent.find_path()
01-easy-search
Although some of you might be impatient to jump to the implementation of the A* algorithm, try finding your way through a simple maze first. It is a smaller problem, easier for you to follow step-by-step and debug, and you will verify the correct handling of the environment on a simpler problem. The basic communication interface is the same, that is
import kuimaze MAP = 'maps/normal/normal9.bmp' env = kuimaze.InfEasyMaze(map_image=MAP) observation = env.reset() # returns start_pos, goal_pos positions_with_costs = env.expand(position) # list of tuples (pos,cost), i.e. [(pos1, cost1),(pos2,cost2),...]
agent.py
01-easy_search
This assignment is meant to implement an algorithm you'll see in the second lecture, A*, but if you can do the bonus “Easy Search” assignment fast enough and if you are used to Python, you can start working on the first mandatory assignment.
The full description of the assignment is here Search (1st assignment). In a maze environment, you will program the A* algorithm to find the shortest path. Do not forget that the cost of transition between different positions does not have to be the same.