package onetomany.bargainingchipsgame; import java.util.concurrent.BlockingQueue; import java.util.concurrent.LinkedBlockingQueue; import onetomany.bargainingchipsgame.interactions.Offer; import onetomany.bargainingchipsgame.players.BilateralAgent; import onetomany.bargainingchipsgame.players.BuyerSubnegotiator; import onetomany.bargainingchipsgame.players.CoordinationMessage; import onetomany.bargainingchipsgame.players.Coordinator; import onetomany.bargainingchipsgame.players.NegotiationStatusMessage; import onetomany.bargainingchipsgame.players.Seller; /** * This package describes all the fundamental concepts in Bargaining Chips Game (BCG). * * BCG rules are based on a non-alternating offer protocol in each bilateral negotiation thread. * Multiple deals via simultaneous threads in the BCG one-to-many negotiation need to be coordinated. * So the players are equipped with two modules, one coordinator and multiple negotiators one per each thread. * * One-to-Many package is dedicated to one-to-many negotiation which is a kind of negotiation different from bilateral and multilateral settings. * It is between a party which, in parallel, negotiates with many counter parties, opponents, on multiple multi-issue items. * Of course each opponent, in turn, could be in one-to-many negotiation with its own opponents including this party. * * Each of these individual negotiations is itself a bilateral negotiation over multiple items and multiple issues, a multi-issue multi-item thread. Each thread could reach a deal. * So, the whole negotiation could reach multiple deals. * * Negotiating in this atmosphere 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 Game, is a testbed dealing with these complexities. * The fundamental elements of its domain is in a package with this name (bargainingchipsname). * The players and the rules for their interactions are in packages `players' and 'interactions', respectively. * * */ public class BargainingChips { public static void main(String[] args) throws InterruptedException { BlockingQueue in = new LinkedBlockingQueue(); BlockingQueue out = new LinkedBlockingQueue(); BlockingQueue cin = new LinkedBlockingQueue(); BlockingQueue cout = new LinkedBlockingQueue(); BilateralAgent bob1 = new BuyerSubnegotiator("Bob 1", in, out, cin, cout); BilateralAgent sam = new Seller("Sam", out, in); Coordinator c = new Coordinator(cout, cin); Thread threadBuyer = new Thread(bob1); threadBuyer.start(); Thread threadSeller = new Thread(sam); threadSeller.start(); Thread threadCoordinator = new Thread(c); threadCoordinator.start(); } }