Rev | Line | |
---|
[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;
|
---|
[270] | 7 | import onetomany.bargainingchipsgame.interactions.SampleOffer;
|
---|
[269] | 8 | import onetomany.bargainingchipsgame.players.BilateralAgent;
|
---|
| 9 |
|
---|
[268] | 10 | /**
|
---|
| 11 | * This package describes all the fundamental concepts in Bargaining Chips Game (BCG).
|
---|
| 12 | *
|
---|
| 13 | * BCG rules are based on a non-alternating offer protocol in each bilateral negotiation thread.
|
---|
| 14 | * Multiple deals via simultaneous threads in the BCG one-to-many negotiation need to be coordinated.
|
---|
| 15 | * So the players are equipped with two modules, one coordinator and multiple negotiators one per each thread.
|
---|
| 16 | *
|
---|
| 17 | */
|
---|
| 18 | public class BargainingChips
|
---|
| 19 | {
|
---|
[269] | 20 | public static void main(String[] args) throws InterruptedException
|
---|
[268] | 21 | {
|
---|
[269] | 22 | BlockingQueue<Offer> in = new LinkedBlockingQueue<Offer>();
|
---|
| 23 | BlockingQueue<Offer> out = new LinkedBlockingQueue<Offer>();
|
---|
| 24 | BilateralAgent a = new BilateralAgent(in, out);
|
---|
[268] | 25 |
|
---|
[269] | 26 | Thread thread = new Thread(a);
|
---|
| 27 | thread.start();
|
---|
[268] | 28 |
|
---|
[270] | 29 | in.add(new SampleOffer(3));
|
---|
[269] | 30 | Thread.sleep(5000);
|
---|
[270] | 31 | in.add(new SampleOffer(4));
|
---|
[269] | 32 |
|
---|
[268] | 33 | }
|
---|
| 34 |
|
---|
| 35 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.