Line | |
---|
1 | package onetomany.bargainingchipsgame.players;
|
---|
2 |
|
---|
3 | import java.util.concurrent.BlockingQueue;
|
---|
4 |
|
---|
5 | import onetomany.bargainingchipsgame.interactions.Offer;
|
---|
6 |
|
---|
7 | public abstract class BilateralAgent implements Runnable
|
---|
8 | {
|
---|
9 | String name;
|
---|
10 | // Messaging from and to the opponent
|
---|
11 | protected BlockingQueue<Offer> in;
|
---|
12 | protected BlockingQueue<Offer> out;
|
---|
13 |
|
---|
14 | protected abstract void receiveOffer(Offer bundle);
|
---|
15 |
|
---|
16 | protected abstract Offer sendOffer();
|
---|
17 |
|
---|
18 | protected abstract Offer sendOpeningOffer();
|
---|
19 |
|
---|
20 | public BilateralAgent(String name, BlockingQueue<Offer> in, BlockingQueue<Offer> out)
|
---|
21 | {
|
---|
22 | super();
|
---|
23 | this.name = name;
|
---|
24 | this.in = in;
|
---|
25 | this.out = out;
|
---|
26 | }
|
---|
27 |
|
---|
28 | @Override
|
---|
29 | public String toString()
|
---|
30 | {
|
---|
31 | return name;
|
---|
32 | }
|
---|
33 |
|
---|
34 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.