[268] | 1 | package onetomany.bargainingchipsgame;
|
---|
| 2 |
|
---|
[269] | 3 | import java.util.concurrent.BlockingQueue;
|
---|
| 4 | import java.util.concurrent.LinkedBlockingQueue;
|
---|
| 5 |
|
---|
| 6 | import onetomany.bargainingchipsgame.interactions.Offer;
|
---|
| 7 | import onetomany.bargainingchipsgame.players.BilateralAgent;
|
---|
[273] | 8 | import onetomany.bargainingchipsgame.players.BuyerSubnegotiator;
|
---|
| 9 | import onetomany.bargainingchipsgame.players.Seller;
|
---|
[269] | 10 |
|
---|
[268] | 11 | /**
|
---|
| 12 | * This package describes all the fundamental concepts in Bargaining Chips Game (BCG).
|
---|
| 13 | *
|
---|
| 14 | * BCG rules are based on a non-alternating offer protocol in each bilateral negotiation thread.
|
---|
| 15 | * Multiple deals via simultaneous threads in the BCG one-to-many negotiation need to be coordinated.
|
---|
| 16 | * So the players are equipped with two modules, one coordinator and multiple negotiators one per each thread.
|
---|
[272] | 17 | *
|
---|
| 18 | * One-to-Many package is dedicated to one-to-many negotiation which is a kind of negotiation different from bilateral and multilateral settings.
|
---|
| 19 | * It is between a party which, in parallel, negotiates with many counter parties, opponents, on multiple multi-issue items.
|
---|
| 20 | * Of course each opponent, in turn, could be in one-to-many negotiation with its own opponents including this party.
|
---|
| 21 | *
|
---|
| 22 | * 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.
|
---|
| 23 | * So, the whole negotiation could reach multiple deals.
|
---|
| 24 | *
|
---|
| 25 | * 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.
|
---|
| 26 | *
|
---|
| 27 | * Bargaining Chips Game, is a testbed dealing with these complexities.
|
---|
| 28 | * The fundamental elements of its domain is in a package with this name (bargainingchipsname).
|
---|
| 29 | * The players and the rules for their interactions are in packages `players' and 'interactions', respectively.
|
---|
| 30 | *
|
---|
[268] | 31 | *
|
---|
| 32 | */
|
---|
| 33 | public class BargainingChips
|
---|
| 34 | {
|
---|
[269] | 35 | public static void main(String[] args) throws InterruptedException
|
---|
[268] | 36 | {
|
---|
[269] | 37 | BlockingQueue<Offer> in = new LinkedBlockingQueue<Offer>();
|
---|
| 38 | BlockingQueue<Offer> out = new LinkedBlockingQueue<Offer>();
|
---|
[268] | 39 |
|
---|
[273] | 40 | BilateralAgent bob1 = new BuyerSubnegotiator("Bob 1", in, out);
|
---|
[274] | 41 | BilateralAgent sam = new Seller("Sam", out, in);
|
---|
[268] | 42 |
|
---|
[273] | 43 | Thread threadBuyer = new Thread(bob1);
|
---|
| 44 | threadBuyer.start();
|
---|
[269] | 45 |
|
---|
[273] | 46 | Thread threadSeller = new Thread(sam);
|
---|
| 47 | threadSeller.start();
|
---|
[268] | 48 | }
|
---|
| 49 |
|
---|
| 50 | }
|
---|