source: src/main/java/onetomany/bargainingchipsgame/players/BilateralAgent.java@ 298

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

Major refactor of Agent design

File size: 923 bytes
RevLine 
[269]1package onetomany.bargainingchipsgame.players;
2
3import java.util.concurrent.BlockingQueue;
4
5import onetomany.bargainingchipsgame.interactions.Offer;
[283]6/**
7 * An agent has typically a buyer or seller role.
8 * An agent has a wish list (to buy or sell), which is a bundle, and a utility function for evaluating any proposal.
9 *
10 */
[273]11public abstract class BilateralAgent implements Runnable
[269]12{
[273]13 String name;
[278]14 // Messaging from and to the opponent
15 protected BlockingQueue<Offer> in;
16 protected BlockingQueue<Offer> out;
[269]17
[278]18 protected abstract void receiveOffer(Offer bundle);
[274]19
20 protected abstract Offer sendOffer();
21
22 protected abstract Offer sendOpeningOffer();
23
[273]24 public BilateralAgent(String name, BlockingQueue<Offer> in, BlockingQueue<Offer> out)
[269]25 {
26 super();
[273]27 this.name = name;
[269]28 this.in = in;
[273]29 this.out = out;
[269]30 }
31
[287]32 @Override
[274]33 public String toString()
34 {
35 return name;
36 }
37
[269]38}
Note: See TracBrowser for help on using the repository browser.