source: src/main/java/genius/core/SupportedNegotiationSetting.java

Last change on this file was 127, checked in by Wouter Pasman, 6 years ago

#41 ROLL BACK of rev.126 . So this version is equal to rev. 125

File size: 1.4 KB
Line 
1package genius.core;
2
3import genius.core.utility.UTILITYSPACETYPE;
4
5/**
6 * Indicates what negotiation settings are supported by an agent.
7 */
8public class SupportedNegotiationSetting {
9 private final static UTILITYSPACETYPE defaultSpace = UTILITYSPACETYPE.NONLINEAR;
10 /**
11 * LINEAR means: only supports linear domains, NONLINEAR means it supports
12 * any utility space (both linear and non-linear)
13 */
14 private UTILITYSPACETYPE utilityspaceType = defaultSpace;
15
16 public SupportedNegotiationSetting() {
17 }
18
19 public static SupportedNegotiationSetting getLinearUtilitySpaceInstance() {
20 SupportedNegotiationSetting s = new SupportedNegotiationSetting();
21 s.setUtilityspaceType(UTILITYSPACETYPE.LINEAR);
22 return s;
23 }
24
25 public static SupportedNegotiationSetting getDefault() {
26 return new SupportedNegotiationSetting();
27 }
28
29 boolean supportsOnlyLinearUtilitySpaces() {
30 return utilityspaceType == UTILITYSPACETYPE.LINEAR;
31 }
32
33 public UTILITYSPACETYPE getUtilityspaceType() {
34 return utilityspaceType;
35 }
36
37 public void setUtilityspaceType(UTILITYSPACETYPE utilityspaceType) {
38 this.utilityspaceType = utilityspaceType;
39 }
40
41 /**
42 * returns human readible version. Bit hacky, I suspect this will change
43 * when we get more nonlinear agents.
44 */
45 public String toExplainingString() {
46 if (utilityspaceType == UTILITYSPACETYPE.NONLINEAR) {
47 return "compatible with non-linear utility spaces";
48 }
49 return "";
50 }
51
52}
Note: See TracBrowser for help on using the repository browser.