Last change
on this file since 307 was 301, checked in by Tim Baarslag, 5 years ago |
Boulware works with UF_CloseToQuantityMaxPrice
|
File size:
1.3 KB
|
Line | |
---|
1 | package onetomany.bargainingchipsgame.players;
|
---|
2 |
|
---|
3 | import java.util.concurrent.BlockingQueue;
|
---|
4 |
|
---|
5 | import onetomany.bargainingchipsgame.WishList;
|
---|
6 |
|
---|
7 | /**
|
---|
8 | * Coordinates all bilateral threads.
|
---|
9 | * The coordinator monitors and synchronizes all bilateral negotiation threads
|
---|
10 | * of each negotiator agent with an opponent regarding the whole preference list of the user.
|
---|
11 | */
|
---|
12 | public class Coordinator implements Runnable
|
---|
13 | {
|
---|
14 | // Messages coming in and out of the coordinator
|
---|
15 | protected BlockingQueue<NegotiationStatusMessage> cin;
|
---|
16 | protected BlockingQueue<CoordinationMessage> cout;
|
---|
17 | /** The fixed, initial wish list that should be obtained overall */
|
---|
18 | private WishList overallWishList;
|
---|
19 |
|
---|
20 | public Coordinator(WishList wishlist, BlockingQueue<NegotiationStatusMessage> negotiationMsg,
|
---|
21 | BlockingQueue<CoordinationMessage> coordinationMsg)
|
---|
22 | {
|
---|
23 | this.overallWishList = wishlist;
|
---|
24 | cin = negotiationMsg;
|
---|
25 | cout = coordinationMsg;
|
---|
26 | }
|
---|
27 |
|
---|
28 | @Override
|
---|
29 | public void run()
|
---|
30 | {
|
---|
31 | // Send a very simple coordination message to Bob_i after a while
|
---|
32 | try {
|
---|
33 | Thread.sleep(2000);
|
---|
34 |
|
---|
35 | // CoordinationMessage coordinationMessage2 = new CoordinationMessage();
|
---|
36 | // coordinationMessage2.f = new UF_IWantColorAndQuantity("Green", 7);
|
---|
37 | // cout.put(coordinationMessage2);
|
---|
38 |
|
---|
39 | } catch (InterruptedException e) {
|
---|
40 | e.printStackTrace();
|
---|
41 | }
|
---|
42 |
|
---|
43 | }
|
---|
44 |
|
---|
45 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.