source: anac2021/dicehaggler/src/main/java/geniusweb/exampleparties/learningagent/NegotiationData.java@ 62

Last change on this file since 62 was 14, checked in by wouter, 3 years ago

#2 ANAC2021 parties received from Bram

File size: 1.5 KB
Line 
1package geniusweb.exampleparties.learningagent; // TODO: change name
2
3import com.fasterxml.jackson.annotation.JsonAutoDetect;
4import com.fasterxml.jackson.annotation.JsonAutoDetect.Visibility;
5
6/**
7 * The class hold the negotiation data that is obtain during a negotiation
8 * session. It will be saved to disk after the negotiation has finished. During
9 * the learning phase, this negotiation data can be used to update the
10 * persistent state of the agent. NOTE that Jackson can serialize many default
11 * java classes, but not custom classes out-of-the-box.
12 */
13@JsonAutoDetect(fieldVisibility = Visibility.ANY, getterVisibility = Visibility.NONE, setterVisibility = Visibility.NONE)
14public class NegotiationData {
15
16 private Double maxReceivedUtil = 0.0;
17 private Double agreementUtil = 0.0;
18 private String opponentName;
19
20 public void addAgreementUtil(Double agreementUtil) {
21 this.agreementUtil = agreementUtil;
22 if (agreementUtil > maxReceivedUtil)
23 this.maxReceivedUtil = agreementUtil;
24 }
25
26 public void addBidUtil(Double bidUtil) {
27 if (bidUtil > maxReceivedUtil)
28 this.maxReceivedUtil = bidUtil;
29 }
30
31 public void setOpponentName(String opponentName) {
32 this.opponentName = opponentName;
33 }
34
35 public String getOpponentName() {
36 return this.opponentName;
37 }
38
39 public Double getMaxReceivedUtil() {
40 return this.maxReceivedUtil;
41 }
42
43 public Double getAgreementUtil() {
44 return this.agreementUtil;
45 }
46}
Note: See TracBrowser for help on using the repository browser.