1 | package negotiator.boaframework.opponentmodel.nash;
|
---|
2 |
|
---|
3 | import genius.core.issue.IssueReal;
|
---|
4 | import genius.core.issue.Value;
|
---|
5 | import genius.core.issue.ValueReal;
|
---|
6 |
|
---|
7 | /**
|
---|
8 | * This class evaluates an IssueReal. It uses the principle of an IssueEvaluationNumerical.
|
---|
9 | * Since the abstract version already implements a lot of the functionality, this class
|
---|
10 | * exists mainly to work with the specific IssueReal and ValueReal objects.
|
---|
11 | *
|
---|
12 | * @author Roland van der Linden
|
---|
13 | *
|
---|
14 | */
|
---|
15 | public class IssueEvaluationReal extends AIssueEvaluationNumerical
|
---|
16 | {
|
---|
17 | /**
|
---|
18 | * This constructs the issueEvaluationReal.
|
---|
19 | * @param issueR
|
---|
20 | * @param ourNonZeroUtilityRange
|
---|
21 | */
|
---|
22 | public IssueEvaluationReal(IssueReal issueR, Range ourNonZeroUtilityRange)
|
---|
23 | {
|
---|
24 | super(issueR, ourNonZeroUtilityRange);
|
---|
25 | }
|
---|
26 |
|
---|
27 |
|
---|
28 | // **************************************
|
---|
29 | // Getters
|
---|
30 | // **************************************
|
---|
31 |
|
---|
32 | /**
|
---|
33 | * This method gives us the casted IssueReal object we are evaluating.
|
---|
34 | * @return The IssueReal we are evaluating.
|
---|
35 | */
|
---|
36 | public IssueReal getIssueReal()
|
---|
37 | {
|
---|
38 | return (IssueReal)this.issue;
|
---|
39 | }
|
---|
40 |
|
---|
41 | /**
|
---|
42 | * This returns the actual numerical value that resides inside the Value object.
|
---|
43 | * Object must be a ValueReal.
|
---|
44 | */
|
---|
45 | @Override
|
---|
46 | protected double getNumericalValue(Value value)
|
---|
47 | {
|
---|
48 | if(!(value instanceof ValueReal))
|
---|
49 | throw new IllegalArgumentException("The IssueEvaluationReal getNumericalValue method requires a ValueReal value. It is now a: " + value.getClass().getSimpleName());
|
---|
50 |
|
---|
51 | return ((ValueReal)value).getValue();
|
---|
52 | }
|
---|
53 |
|
---|
54 | /**
|
---|
55 | * This method returns the lower bound of the range of the IssueReal.
|
---|
56 | */
|
---|
57 | @Override
|
---|
58 | public double getIssueLowerBound()
|
---|
59 | {
|
---|
60 | return getIssueReal().getLowerBound();
|
---|
61 | }
|
---|
62 |
|
---|
63 | /**
|
---|
64 | * This method returns the upper bound of the range of the IssueReal.
|
---|
65 | */
|
---|
66 | @Override
|
---|
67 | public double getIssueUpperBound()
|
---|
68 | {
|
---|
69 | return getIssueReal().getUpperBound();
|
---|
70 | }
|
---|
71 |
|
---|
72 | } |
---|