package onetomany.bargainingchipsgame.players; import java.util.concurrent.BlockingQueue; import onetomany.bargainingchipsgame.interactions.Offer; /** * An agent has typically a buyer or seller role. * An agent has a wish list (to buy or sell), which is a bundle, and a utility function for evaluating any proposal. * */ public abstract class BilateralAgent implements Runnable { String name; // Messaging from and to the opponent protected BlockingQueue in; protected BlockingQueue out; protected abstract void receiveOffer(Offer bundle); protected abstract Offer sendOffer(); protected abstract Offer sendOpeningOffer(); public BilateralAgent(String name, BlockingQueue in, BlockingQueue out) { super(); this.name = name; this.in = in; this.out = out; } @Override public String toString() { return name; } }