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:
805 bytes
|
Line | |
---|
1 | package genius.core.utility;
|
---|
2 |
|
---|
3 | import java.util.HashMap;
|
---|
4 |
|
---|
5 | import genius.core.Bid;
|
---|
6 |
|
---|
7 | public class ZeroConstraint extends RConstraint {
|
---|
8 |
|
---|
9 | Integer issueIndex;
|
---|
10 | private HashMap<Integer, String> checkList;
|
---|
11 |
|
---|
12 | public ZeroConstraint(Integer index) {
|
---|
13 | this.issueIndex = index;
|
---|
14 | this.checkList = new HashMap<Integer, String>();
|
---|
15 | }
|
---|
16 |
|
---|
17 | @Override
|
---|
18 | public void addContraint(Integer issueIndex, String conditionToBeCheck) {
|
---|
19 | this.checkList.put(issueIndex, conditionToBeCheck);
|
---|
20 | }
|
---|
21 |
|
---|
22 | @Override
|
---|
23 | public boolean willZeroUtility(Bid bid) {
|
---|
24 |
|
---|
25 | for (Integer index : this.checkList.keySet()) {
|
---|
26 | if (!bid.getValue(index).toString()
|
---|
27 | .equals(this.checkList.get(index)))
|
---|
28 | return false;
|
---|
29 | }
|
---|
30 | return true;
|
---|
31 | }
|
---|
32 |
|
---|
33 | @Override
|
---|
34 | public Integer getIssueIndex() {
|
---|
35 | return this.issueIndex;
|
---|
36 | }
|
---|
37 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.