source: src/main/java/negotiator/boaframework/opponentmodel/nash/IssueEvaluationInteger.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: 2.0 KB
Line 
1package negotiator.boaframework.opponentmodel.nash;
2
3import genius.core.issue.IssueInteger;
4import genius.core.issue.Value;
5import genius.core.issue.ValueInteger;
6
7/**
8 * This class evaluates an IssueInteger. 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 IssueInteger and ValueInteger objects.
11 *
12 * @author Roland van der Linden
13 *
14 */
15public class IssueEvaluationInteger extends AIssueEvaluationNumerical
16{
17 /**
18 * This constructs the IssueEvaluationInteger.
19 * @param issueI The issue we are evaluating.
20 * @param ourNonZeroUtilityRange Our own range where the utility is not zero.
21 */
22 public IssueEvaluationInteger(IssueInteger issueI, Range ourNonZeroUtilityRange)
23 {
24 super(issueI, ourNonZeroUtilityRange);
25 }
26
27
28 // **************************************
29 // Getters
30 // **************************************
31
32 /**
33 * This method gives us the casted IssueInteger object we are evaluating.
34 * @return The IssueInteger we are evaluating.
35 */
36 public IssueInteger getIssueInteger()
37 {
38 return (IssueInteger)this.issue;
39 }
40
41 /**
42 * This method returns the actual value that resides inside the Value object.
43 * Given objects should be ValueInteger objects.
44 */
45 @Override
46 protected double getNumericalValue(Value value)
47 {
48 if(!(value instanceof ValueInteger))
49 throw new IllegalArgumentException("The IssueEvaluationInteger getNumericalValue method requires a ValueInteger value. It is now a: " + value.getClass().getSimpleName());
50
51 return ((ValueInteger)value).getValue();
52 }
53
54 /**
55 * This method returns the lower bound of the range of the IssueInteger.
56 */
57 @Override
58 public double getIssueLowerBound()
59 {
60 return this.getIssueInteger().getLowerBound();
61 }
62
63 /**
64 * This method returns the upper bound of the range of the IssueInteger.
65 */
66 @Override
67 public double getIssueUpperBound()
68 {
69 return this.getIssueInteger().getUpperBound();
70 }
71
72}
Note: See TracBrowser for help on using the repository browser.