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