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.
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.
send(Uav a, int x, int y, ArrayList Note)
: Sends Note
from a
to the uav at x,y
. The coordinator will respond with a success
message if it succeeds, or a pong
message if it fails.ping(Uav name)
: Causes the coordinator to send a pong
message with a list of all visible entities in the form of an arraylist [target is a uav, x, y]
moveUav(Uav name, int x, int y)
: Moves name
. x
and y
should each be -1, 0, or 1 indicating how much to move in each of these axis. print(String foo)
: Prints foo
. For debugging purposes only.print
, the first argument of a message to a coordinator should always be the sender itself.
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.
-Pytosimu.py: 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 yWhere
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.
uavfile.txt/targets.txt
: Sample uavfile and targets files.
build.sh,run.sh,run2.sh
: Sample build and run files. On Windows, you should replace the ":" with a ";" the ".sh" in the name with ".bat", and the "screen" with "start". On Unix machines, you should run screen
once before running run.sh/run2.sh
Coordinator.salsa
: Coordinator file. You should not need to modify this much, if at all, in order to complete part 1.
salsa1.1.2_version2.jar
: Use this version of Salsa.
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 |
-25% |
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 userid1.zip or userid1_userid2.zip. Only submit one assignment per pair (the other does not need to submit anything via WebCT). Please submit your file via WebCT.