CS 677 Distributed Operating Systems

Spring 2013

Programming Assignment 2: Angry Birds: Part Deux ( )

Due: 11:55pm, Wed April 12, 2013


 


·  A: The problem

Communication between pigs and the leader can be direct or you can continue to use the P2P network from the previous lab. Further, to determine whether a pig is impacted by a bird, we will use logical clocks (you can choose Lamport's clocks or vector clocks). Assume that each process maintains a logical clock. Messages and events (e.g., bird launch, bird landing) are time-stamped by logical clocks and so are events such as pigs taking an evasive action. A pig is impacted if the bird landing event happened before the took evasive action event. After each round, pigs communicate the time-stamps of various events of interest to the leader, who then compares the clock values and determines the "result".

Like before you can assume that a message can take variable delays to propagate, which you can emulate by making the logical clocks of the receiver tick by more than 1 unit. As a result, the notification to take evasive action may "happen" after a bid lands or before. Like before, the speed of a bird and its trajectory can be chosen randomly each time and the landing event can be emualated by ticking the logical clock by an appropriate amount.

Your program should handle the following cases: 1) A leader can resign any time and the pigs can elect a new leader by running the election algorithm. 2) While either Lamports or Vector clocks can be used, be sure to implement them in a way to ensure clocks values can be compared to determine event ordering.

No GUIs are required. Simple command line interfaces are fine.

Assume that the number of pigs N is specified beforehand (N should be configurable in your system).

Each peer should be able to accept multiple requests at the same time. This could be easily done using threads. Be aware of the thread synchronizing issues to avoid inconsistency or deadlock in your system. For instance, if you use a shared data structure that keeps track of pig and stone positions that are accessed concurrently by different pigs, ensure no pig accesses an inconsistent version of the structure.

No GUIs are required. Simple command line interfaces are fine.


·  B. Evaluation and Measurement

  1. Deploy at least 6 pigs. They can be setup on the same machine (different directories) or different machines. You are free to develop your solution on any platform, but please ensure that your programs compile and run on the edlab machines (See note below).
  2. Conduct careful experiments to evaluate the behavior of your system under different scenarios. Change the speed of bird launches to study when pigs suceed and when they fail. Report any insights, if any, from your experiments, as to which startegies suceed the best.

·  C. What you will submit

·  When you have finished implementing the complete assignment as described above, you will submit your solution in the form of a zip file that you will upload into moodle.

·  Each program must work correctly and be documented. The zip file you upload to moodle should contain:

  1. An electronic copy of the output generated by running your program. Print informative messages when a pig receives and sends key messages and the score. Do not print multiple flooding messages since it will clutter your output.
  2. A seperate document of approximately two pages describing the overall program design, a description of "how it works", and design tradeoffs considered and made. Also describe possible improvements and extensions to your program (and sketch how they might be made). You also need to describe clearly how we can run your program - if we can't run it, we can't verify that it works.
  3. A program listing containing in-line documentation. Important – Please list which classes and methods in your code implement each of the requirements of the project.
  4. A seperate description of the tests you ran on your program to convince yourself that it is indeed correct. Also describe any cases for which your program is known not to work correctly.
  5. Performance results.

·  D. Grading policy for all programming assignments

  1. Program Listing

works correctly ------------- 50%

in-line documentation -------- 15%

  1. Design Document

quality of design and creativity ------------ 15%

understandability of doc ------- 10%

  1. Thoroughness of test cases ---------- 10%
  2. Grades for late programs will be lowered 12 points per day late.

·  Note about edlab machines

·  Read more about edlab and how to access it here

·  Although it is not required that you develop your code on the edlab machines, we will run and test your solutions on the edlab machines. Testing your code on the edlab machines is a good way to ensure that we can run and grade your code. Remember, if we cant run it, we cant grade it.

·  There are no visiting hours for the edlab. You should all have remote access to the edlab machines. Please make sure you are able to log into and access your edlab accounts.

·  IMPORTANT - No submissions are to be made on edlab. Submit your solutions only via moodle.