source: src/main/java/agents/anac/y2019/harddealer/.!72211!HardDealer_AS.java@ 202

Last change on this file since 202 was 200, checked in by Katsuhide Fujita, 6 years ago

Add ANAC 2019 agents

  • Property svn:executable set to *
File size: 2.2 KB
Line 
1package agents.anac.y2019.harddealer;
2
3import java.util.HashSet;
4import java.util.Map;
5import java.util.Set;
6
7import genius.core.boaframework.AcceptanceStrategy;
8import genius.core.boaframework.Actions;
9import genius.core.boaframework.BOAparameter;
10import genius.core.boaframework.NegotiationSession;
11import genius.core.boaframework.OfferingStrategy;
12import genius.core.boaframework.OpponentModel;
13import genius.core.utility.AdditiveUtilitySpace;
14
15/**
16 * This Acceptance Condition will accept an opponent bid if the utility is
17 * higher than the acceptance boundary or higher than the bid the agent is
18 * ready to present.
19 */
20public class HardDealer_AS extends AcceptanceStrategy {
21 private double a;
22 private double b;
23 private double reservationValue;
24 private double k;
25 /** Concession factor */
26 private double e;
27
28 /**
29 * Empty constructor for the BOA framework.
30 */
31 public HardDealer_AS() {
32 }
33
34 public double f(double t) {
35 // First 10% of session: Slowly come up from bids with util .9
36 if (t < .1)
37 {
38 return 20*(t-0.1)*(t-0.1);
39 }
40 else
41 {
42 if (e == 0)
43 {
44 return k;
45 }
46 double ft = k + (1 - k) * Math.pow(t, 1.0 / e);
47 return ft;
48 }
49
50 }
51
52 public double p(double t) {
53 return this.reservationValue + (1 - this.reservationValue) * (1 - f(t));
54 }
55
56 /**
57 * Method directly called after creating the party which is used to
58 * initialize the component.
59 */
60 @Override
61 public void init(NegotiationSession negoSession, OfferingStrategy strat,
62 OpponentModel opponentModel, Map<String, Double> parameters)
63 throws Exception {
64 this.negotiationSession = negoSession;
65 this.offeringStrategy = strat;
66 this.e = (1.8) / negotiationSession.getTimeline().getTotalTime();
67
68 if (parameters.get("a") != null || parameters.get("b") != null) {
69 a = parameters.get("a");
70 b = parameters.get("b");
71 } else {
72 a = 1;
73 b = 0;
74 }
75 this.reservationValue = negotiationSession.getUtilitySpace().getReservationValue();
76
77 if (parameters.get("k") != null)
78 this.k = parameters.get("k");
79 else
80 this.k = 0;
81 }
82
83 @Override
84 public String printParameters() {
85 String str = "[a: " + a + " b: " + b + "]";
86 return str;
87 }
88
89
90 /**
Note: See TracBrowser for help on using the repository browser.