source: src/main/java/agents/anac/y2019/minf/etc/TimeDependent_Offering.java

Last change on this file was 200, checked in by Katsuhide Fujita, 5 years ago

Add ANAC 2019 agents

  • Property svn:executable set to *
File size: 2.9 KB
Line 
1package agents.anac.y2019.minf.etc;
2
3import java.util.HashSet;
4import java.util.Map;
5import java.util.Set;
6
7import genius.core.bidding.BidDetails;
8import genius.core.boaframework.BOAparameter;
9import genius.core.boaframework.NegotiationSession;
10import genius.core.boaframework.NoModel;
11import genius.core.boaframework.OMStrategy;
12import genius.core.boaframework.OfferingStrategy;
13import genius.core.boaframework.OpponentModel;
14import genius.core.boaframework.SortedOutcomeSpace;
15
16public class TimeDependent_Offering extends OfferingStrategy {
17 /** Outcome space */
18 private SortedOutcomeSpace outcomespace;
19 /** Time of Maximum Utility */
20 private double MaxUtilTime;
21 /** Time of Concession */
22 private double ConcedeTime;
23 /** Negotiation Information */
24 private NegotiationInfo negotiationInfo;
25
26 public TimeDependent_Offering(NegotiationInfo negoInfo){
27 this.negotiationInfo = negoInfo;
28 }
29
30 @Override
31 public void init(NegotiationSession negoSession, OpponentModel model, OMStrategy oms,
32 Map<String, Double> parameters) throws Exception {
33 super.init(negoSession, parameters);
34
35 this.negotiationSession = negoSession;
36
37 outcomespace = new SortedOutcomeSpace(negotiationSession.getUtilitySpace());
38 negotiationSession.setOutcomeSpace(outcomespace);
39
40 if (parameters.get("MT") != null)
41 this.MaxUtilTime = parameters.get("MT");
42 else
43 this.MaxUtilTime = 0;
44
45 if (parameters.get("CT") != null)
46 this.ConcedeTime = parameters.get("CT");
47 else
48 this.ConcedeTime = 1.0;
49
50 this.opponentModel = model;
51
52 this.omStrategy = oms;
53 }
54
55 @Override
56 public BidDetails determineOpeningBid() {
57 return determineNextBid();
58 }
59
60 @Override
61 public BidDetails determineNextBid() {
62 double time = negotiationSession.getTime();
63 double utilityGoal = negotiationInfo.getRandomThreshold(time);
64
65 if (time < MaxUtilTime) {
66 nextBid = negotiationSession.getOutcomeSpace().getMaxBidPossible();
67 } else if (time >= ConcedeTime && utilityGoal != 1.0D &&
68 negotiationSession.getOpponentBidHistory().getBestBidDetails().getMyUndiscountedUtil()
69 >= negotiationSession.getUtilitySpace().getReservationValueUndiscounted()) {
70 nextBid = negotiationSession.getOpponentBidHistory().getBestBidDetails();
71 } else {
72 // if there is no opponent model available
73 if (opponentModel instanceof NoModel) {
74 nextBid = negotiationSession.getOutcomeSpace().getBidNearUtility(utilityGoal);
75 } else {
76 nextBid = omStrategy.getBid(outcomespace, utilityGoal);
77 }
78 }
79
80 return nextBid;
81 }
82
83 public NegotiationSession getNegotiationSession() {
84 return negotiationSession;
85 }
86
87 @Override
88 public Set<BOAparameter> getParameterSpec() {
89 Set<BOAparameter> set = new HashSet<BOAparameter>();
90 set.add(new BOAparameter("MT", 0.0, "Max Utility Time"));
91 set.add(new BOAparameter("CT", 1.0, "Concede Time"));
92
93 return set;
94 }
95
96 @Override
97 public String getName() {
98 return "TimeDependent Offering";
99 }
100}
Note: See TracBrowser for help on using the repository browser.