source: src/main/java/onetomany/bargainingchipsgame/BargainingChips.java@ 270

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

Offers between agents

File size: 1.2 KB
RevLine 
[268]1package onetomany.bargainingchipsgame;
2
[269]3import java.util.concurrent.BlockingQueue;
4import java.util.concurrent.LinkedBlockingQueue;
5
6import onetomany.bargainingchipsgame.interactions.Offer;
[270]7import onetomany.bargainingchipsgame.interactions.SampleOffer;
[269]8import 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 */
18public 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.