source: src/main/java/genius/core/utility/ExclusiveHyperRectangle.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.0 KB
Line 
1package genius.core.utility;
2
3import java.util.ArrayList;
4
5import genius.core.Bid;
6import genius.core.issue.ValueInteger;
7
8public class ExclusiveHyperRectangle extends HyperRectangle {
9
10 private ArrayList<Bound> boundlist;
11 private double utilityValue;
12
13 public ExclusiveHyperRectangle() {
14
15 }
16
17 public ArrayList<Bound> getBoundList() {
18 return boundlist;
19 }
20
21 public void setBoundList(ArrayList<Bound> boundlist) {
22 this.boundlist = boundlist;
23 }
24
25 public double getUtilityValue() {
26 return utilityValue;
27 }
28
29 public void setUtilityValue(double utilityValue) {
30 this.utilityValue = utilityValue;
31 }
32
33 @Override
34 public double getUtility(Bid bid) {
35
36 int issueValue;
37 for (int i = 0; i < boundlist.size(); i++) {
38 issueValue = (int) ((ValueInteger) bid.getValue(boundlist.get(i)
39 .getIssueIndex())).getValue();
40 if ((boundlist.get(i).getMin() > issueValue)
41 || (issueValue > boundlist.get(i).getMax()))
42 return utilityValue * weight;
43 }
44
45 return 0.0;
46 }
47
48}
Note: See TracBrowser for help on using the repository browser.