Lab 0: Controlling a robot in a maze
Due Thursday, Sept. 8th by 11:59 pm

A robot in a maze. The maze is rectangular in shape with the robot in the lower left corner.  The goal is for the robot to find a light source in the right corner.

Starting point code

For this first lab, you will work individually.

First create a directory for this class called cs63. Then change into your directory and clone the GitHub repository for lab0, replacing USERNAME with your username:

    mkdir cs63
    cd cs63
    git clone git@github.swarthmore.edu:cs63-f22/lab0-USERNAME.git
  

The starting point code consists of two jupyter notebooks (which have the extension .ipynb).

Introduction

As we discussed in class, an agent is an entity that perceives and acts within an environment. We defined artificial intelligence as the creation and study of agents that behave intelligently. In this lab you will learn how to control a simulated robot (the agent) to traverse through a maze to find a goal marked by a light source.

If you took cs35, you used both breadth-first search and depth-first search to solve various maze problems where the environment was divided into a grid and the agent knew its current (x, y) location within that grid (as in the example shown below).

grid-based maze
For this lab, however, the agent will only be able to perceive the maze environment via its sensors and will not know its global location within the maze.

The objectives of this lab are to:

Review python

If you skipped cs21, or it has been awhile since you've used Python, you may want to do a quick review of Python. Here is the online book that we use in cs21: Learning with Python.

Virtual environment

We will be using some specialized software for this class. In order to access this software you must first activate a virtual environment. Type the following in your terminal:

  source /usr/swat/bin/CS63env
  
When activated, your terminal prompt should change to (cs63-f22). To leave the virtual environment type:
  deactivate
  
Try activating and deactivating the virtual environment a couple of times. You'll need to do this each time you want to use jupyter.

Using jupyter lab

After you have re-activated the virtual environment, type the following command in the terminal window:

  jupyter lab
  
This may immediately open a window in your web browser, or instead, in the terminal window, it will provide a link for you to cut and paste into your browser.

To leave jupyter you should first press the save file icon in your jupyter notebook (it looks like a small disc). Next, you should go the the Kernel menu and shutdown all kernels. Finally in the terminal window you should press CTRL-C to kill all the jupyter processes.

Get started

You should begin with the notebook called GettingStarted.ipynb. Once you complete the exercises there, you can then move on to the notebook called Maze.ipynb. All of the lab instructions are provided within the notebooks themselves.

Submitting your code

To submit your code, use git to add, commit, and push the files that you modified.