source: src/main/java/bargainingchips/BargainingChips.java@ 337

Last change on this file since 337 was 331, checked in by Tim Baarslag, 5 years ago

New Buyer class with a Coordinator and List<NegotiationThread>.

NegotiationThreads make it possible to connnect with multiple sellers

File size: 2.0 KB
Line 
1package bargainingchips;
2
3import bargainingchips.players.Buyer;
4
5/**
6 * This main class showcases the fundamental concepts in the Bargaining Chips game.
7 *
8 * Bargaining Chips is played by a buyer who seeks to acquire a number of chips for a good price.
9 * For example, the wish list of the buyer may consist of 2 red chips and 1 blue chip.
10 * Chips represents arbitrary indivisible items, such as products or tasks and are differentiated
11 * from others by a unique color.
12 *
13 * Bargaining Chips is played using an asynchronous offer protocol for each bilateral negotiation thread.
14 * Multiple deals in simultaneous threads of one-to-many negotiation need to be coordinated; therefore,
15 * the buyer is equipped with two modules, one coordinator and multiple negotiators one per each thread.
16 *
17 * Each of the individual negotiations is itself a bilateral negotiation over multiple items and multiple
18 * issues, i.e. a multi-issue multi-item thread. As each thread could reach a deal, the whole negotiation
19 * could reach multiple deals.
20 *
21 * Negotiating in this setting needs some coordination efforts to synchronize threads according to the
22 * progress of each individual negotiation as well as the multiple deals compared with the party's preference.
23 *
24 * Bargaining Chips is a testbed for evaluating agents in such settings.
25 *
26 */
27public class BargainingChips
28{
29 public static void main(String[] args) throws InterruptedException
30 {
31 WishList overallWishlist = new WishListBuilder().addWish("Green", 2).build(); // Bob wishes for 2 Green chips
32 Buyer bob = new Buyer(overallWishlist);
33
34 // Sam
35 WishList wishlistSam = new WishListBuilder().addWish("Green", 10).build(); // Sam wishes for 10 Green chips
36 String sam = "Sam";
37
38 // Steve
39 WishList wishlistSteve = new WishListBuilder().addWish("Green", 5).build(); // Sam wishes for 10 Green chips
40 String steve = "Steve";
41
42 bob.connectSeller(sam, wishlistSam);
43 bob.connectSeller(steve, wishlistSteve);
44
45 bob.startThreads();
46
47 }
48
49}
Note: See TracBrowser for help on using the repository browser.