package bargainingchips; import bargainingchips.players.Buyer; /** * This main class showcases the fundamental concepts in the Bargaining Chips game. * * Bargaining Chips is played by a buyer who seeks to acquire a number of chips for a good price. * For example, the wish list of the buyer may consist of 2 red chips and 1 blue chip. * Chips represents arbitrary indivisible items, such as products or tasks and are differentiated * from others by a unique color. * * Bargaining Chips is played using an asynchronous offer protocol for each bilateral negotiation thread. * Multiple deals in simultaneous threads of one-to-many negotiation need to be coordinated; therefore, * the buyer is equipped with two modules, one coordinator and multiple negotiators one per each thread. * * Each of the individual negotiations is itself a bilateral negotiation over multiple items and multiple * issues, i.e. a multi-issue multi-item thread. As each thread could reach a deal, the whole negotiation * could reach multiple deals. * * Negotiating in this setting needs some coordination efforts to synchronize threads according to the * progress of each individual negotiation as well as the multiple deals compared with the party's preference. * * Bargaining Chips is a testbed for evaluating agents in such settings. * */ public class BargainingChips { public static void main(String[] args) throws InterruptedException { WishList overallWishlist = new WishListBuilder().addWish("Green", 2).build(); // Bob wishes for 2 Green chips Buyer bob = new Buyer(overallWishlist); // Sam WishList wishlistSam = new WishListBuilder().addWish("Green", 10).build(); // Sam wishes for 10 Green chips String sam = "Sam"; // Steve WishList wishlistSteve = new WishListBuilder().addWish("Green", 5).build(); // Sam wishes for 10 Green chips String steve = "Steve"; bob.connectSeller(sam, wishlistSam); bob.connectSeller(steve, wishlistSteve); bob.startThreads(); } }