1 | package genius.core;
|
---|
2 |
|
---|
3 | import genius.core.utility.UTILITYSPACETYPE;
|
---|
4 |
|
---|
5 | /**
|
---|
6 | * Indicates what negotiation settings are supported by an agent.
|
---|
7 | */
|
---|
8 | public 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 | }
|
---|