CSCI.4430/6969 Programming Languages Fall 2007
Programming Assignment #3

This assignment is to be done either individually or in pairs. Do not show your code to any other group and do not look at any other group's code. Do not put your code in a public directory or otherwise make it public. However, you may get help from the TA or the instructor. You are encouraged to use the WebCT Discussions page to post questions so that other students can also answer and see the answers.

UAV Simulator in Salsa

The goal of this assignment is to create a UAV simulator in Salsa. Unmanned Autonomous Vehicles (UAVs) are independently moving vehicles (cars, helicopters, planes, etc.) which attempt to move to targets. In this simulation, UAVs have a size of 1 cell and can move to any adjacent cell. They can communicate with any visible cell.

Part 1 - 50%

Your task is to implement a UAV behavior which works with a coordinator behavior (provided) to simulate UAV movement. UAVs can move to any of the eight adjacent cells and can see any target or UAV within the nearby 25 cells (i.e. within the 5x5 grid of cells centered at the UAV). UAVs can send each other messages if they are visible via the coordinator. The UAVs should move over all targets as quickly as possible, without crashing into each other. The coordinator behavior understands the following messages: With the exception of print, the first argument of a message to a coordinator should always be the sender itself.
Note that you should avoid breaking the simulation (e.g. sending messages to nonvisible UAVs, having UAVs send each other their UANs, etc).

Part 2 - 50%

Change Coordinator.salsa to be usable with 4 coordinators---instead of 1---representing quadrants. Upon starting, 4 coordinator behavior instances should be created dividing the work into 4 quadrants. UAVs should migrate to the node (theater) of a new coordinator if they move into its quadrant. Each coordinator will track the information in its own quadrant, but will need to communicate with other coordinators to respond to ping requests from UAVs for which other quadrants are visible.

Provided Files

Download provided files. A python simulation visualizer which takes in an input with alternating "rem" and "add" lines. To add the initial setup, just give it an input of the form

rem x y
add x y
Where x and y are the coordinates of a particular coordinator. You are not required to use pytosimu, but may find it helpful to see what your program is actually doing. It requires the installation of python and pygame to run.

Extra Credit:

See the professor or the TA if you have ideas for other extensions to this assignment and would like extra credit for implementing them.

Due Date:
Received Time Grade Modification
before Monday, November 19, 11:59PM +10%
Tuesday, November 20, from 12:00AM to 11:59PM no modification (on time)
Wednesday, November 21, from 12:00AM to 11:59PM -10%
from Thursday, November 22, 12:00AM to
Friday, November 23, 11:59PM
after Saturday, November 24, 12:00AM not accepted

The assignment will be graded mostly on correctness, but code clarity / readability will also be a factor (comment, comment, comment!).
A penalty of about 20% will be given if your program does not run or compile using the build and run scripts provided (run2 is for part 2).
Be sure your solutions are robust.

Submission Requirements: Your code should consist of the included files (modified as needed) and a uav.salsa file, plus a README file. Combine these files into a single ZIP file with your WebCT user name(s) as the filename, either or Only submit one assignment per pair (the other does not need to submit anything via WebCT). Please submit your file via WebCT.