CSCI.6962 Distributed Computing over the Internet

Spring 2004

Programming Assignment #4

This project is to be done individually. Do not show your code to any other student and do not look at any other student's code. Do not put your code in a public directory or otherwise make it public. You are encouraged to use the WebCT Discussions page to post problems so that other students can also answer and see the answers.

The goal of this assignment is to practice concurrent and distributed programming using the SALSA programming language.

Part 1 - An Online Market

An online market is a peer-to-peer connected collection of auction stores containing auctions and buyer agents.  

Each auction store contains a list of items on sale.  For each item, the store keeps a description, an available quantity, a minimum per-item selling price, an initial minimum bidding price, a minimum bid increment, and auction duration and frequency times.

Each buyer agent contains a shopping list, a budget, and a  time to return to its buyer site.  Each item in the agent's shopping list contains a description, a desired quantity, and a maximum price to pay for each item.

The goal of each auction store is to sell as many items as possible for as much as possible.  The goal of each buyer agent is to buy as many items in its shopping list as possible within the given budget and time constraints.

Your goal is to write the programs that simulate an online market, following a few rules:

Part 2 - A Flea Online Market

The goal of the second part is to deal with potential computational resource limitations.

Because online markets may be restricted to certain times for operation (e.g., from 2-6 am local time, when nobody else is using the computational resources) and because participating sites may become overloaded and request auction stores to move elsewhere, you are to endow the auction stores with the ability to dynamically migrate to other sites (perhaps with a different time zone or resource availability).

Migrating an auction store requires migrating all its auctions and buyer agents in a coordinated fashion, so that operations resume consistently in the new auction store site.

You are to write a program that enables dynamically migrating auction stores without disrupting online auctions, buyer agent itineraries, or interaction with human buyer and sellers.

Extra Credit - Site Failures

The extra-credit part of the assignment deals with failures.  Sites can be sent soft-failures and hard-failures. You will need a manager for each site to receive these failure messages.  The following pseudo-code provides potential algorithms to model failures:
softFailure()
  Don't allow any other auction store to enter the site.
  For each auction store s in the site
    Tell s to leave.
  After all have left, allow auction stores to enter again.
hardFailure()
  Don't allow any other auction stores to enter the lounge.
  For each auction store s in the site
    Kill s.
The sellers and buyers should then check periodically if all stores and agents are still alive (using a heart-beating protocol). If not, they should generate new stores and agents to re-establish the online market.

You may also want to give a time argument to these failures, so that the failure (or time-bomb) does not happen until that time has elapsed.

Other Possible Extensions

Submission:

The due date for this project is April 5th, 2004, 11:55pm EST. You should use the assignments drop-off box located at the course's WebCT page. Upload a ZIP file containing all the relevant documented SALSA files, along with a README file describing the project and its usage.  24-hour late submissions will receive a 10% grade penalty, 3-day late submissions will receive a 25% penalty.  Assignments will not be received after April 9th, 2004.