[127] | 1 | package agents.anac.y2014.BraveCat.OfferingStrategies;
|
---|
| 2 |
|
---|
| 3 | import java.io.Serializable;
|
---|
| 4 | import java.util.HashMap;
|
---|
| 5 |
|
---|
| 6 | import agents.anac.y2014.BraveCat.OpponentModelStrategies.OMStrategy;
|
---|
| 7 | import agents.anac.y2014.BraveCat.OpponentModels.OpponentModel;
|
---|
| 8 | import agents.anac.y2014.BraveCat.necessaryClasses.NegotiationSession;
|
---|
| 9 | import agents.anac.y2014.BraveCat.necessaryClasses.Schedular;
|
---|
| 10 | import genius.core.NegotiationResult;
|
---|
| 11 | import genius.core.bidding.BidDetails;
|
---|
| 12 | import genius.core.boaframework.BoaType;
|
---|
| 13 | import genius.core.boaframework.SharedAgentState;
|
---|
| 14 |
|
---|
| 15 | public abstract class OfferingStrategy {
|
---|
| 16 | protected Schedular schedular;
|
---|
| 17 | protected BidDetails nextBid;
|
---|
| 18 | protected NegotiationSession negotiationSession;
|
---|
| 19 | protected OpponentModel opponentModel;
|
---|
| 20 | protected OMStrategy omStrategy;
|
---|
| 21 | protected SharedAgentState helper;
|
---|
| 22 | protected boolean endNegotiation;
|
---|
| 23 |
|
---|
| 24 | public void init(NegotiationSession negotiationSession, OpponentModel opponentModel, OMStrategy omStrategy,
|
---|
| 25 | HashMap<String, Double> parameters) throws Exception {
|
---|
| 26 | this.negotiationSession = negotiationSession;
|
---|
| 27 | this.opponentModel = opponentModel;
|
---|
| 28 | this.omStrategy = omStrategy;
|
---|
| 29 | this.endNegotiation = false;
|
---|
| 30 | this.schedular = new Schedular(negotiationSession);
|
---|
| 31 | }
|
---|
| 32 |
|
---|
| 33 | public abstract BidDetails determineOpeningBid();
|
---|
| 34 |
|
---|
| 35 | public abstract BidDetails determineNextBid();
|
---|
| 36 |
|
---|
| 37 | public BidDetails getNextBid() {
|
---|
| 38 | return this.nextBid;
|
---|
| 39 | }
|
---|
| 40 |
|
---|
| 41 | public void setNextBid(BidDetails nextBid) {
|
---|
| 42 | this.nextBid = nextBid;
|
---|
| 43 | }
|
---|
| 44 |
|
---|
| 45 | public SharedAgentState getHelper() {
|
---|
| 46 | return this.helper;
|
---|
| 47 | }
|
---|
| 48 |
|
---|
| 49 | public boolean isEndNegotiation() {
|
---|
| 50 | return this.endNegotiation;
|
---|
| 51 | }
|
---|
| 52 |
|
---|
| 53 | public final void storeData(Serializable object) {
|
---|
| 54 | this.negotiationSession.setData(BoaType.BIDDINGSTRATEGY, object);
|
---|
| 55 | }
|
---|
| 56 |
|
---|
| 57 | public final Serializable loadData() {
|
---|
| 58 | return this.negotiationSession.getData(BoaType.BIDDINGSTRATEGY);
|
---|
| 59 | }
|
---|
| 60 |
|
---|
| 61 | public void endSession(NegotiationResult result) {
|
---|
| 62 | }
|
---|
| 63 |
|
---|
| 64 | public abstract String GetName();
|
---|
[1] | 65 | } |
---|