Line | |
---|
1 | package onetomany.bargainingchipsgame;
|
---|
2 |
|
---|
3 | import java.util.concurrent.BlockingQueue;
|
---|
4 | import java.util.concurrent.LinkedBlockingQueue;
|
---|
5 |
|
---|
6 | import onetomany.bargainingchipsgame.interactions.Offer;
|
---|
7 | import onetomany.bargainingchipsgame.interactions.SampleOffer;
|
---|
8 | import onetomany.bargainingchipsgame.players.BilateralAgent;
|
---|
9 |
|
---|
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 | {
|
---|
20 | public static void main(String[] args) throws InterruptedException
|
---|
21 | {
|
---|
22 | BlockingQueue<Offer> in = new LinkedBlockingQueue<Offer>();
|
---|
23 | BlockingQueue<Offer> out = new LinkedBlockingQueue<Offer>();
|
---|
24 | BilateralAgent a = new BilateralAgent(in, out);
|
---|
25 |
|
---|
26 | Thread thread = new Thread(a);
|
---|
27 | thread.start();
|
---|
28 |
|
---|
29 | in.add(new SampleOffer(3));
|
---|
30 | Thread.sleep(5000);
|
---|
31 | in.add(new SampleOffer(4));
|
---|
32 |
|
---|
33 | }
|
---|
34 |
|
---|
35 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.