Last change
on this file since 346 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:
684 bytes
|
Line | |
---|
1 | package agents.anac.y2012.AgentLG;
|
---|
2 | import java.util.Comparator;
|
---|
3 |
|
---|
4 | import genius.core.Bid;
|
---|
5 | import genius.core.utility.AdditiveUtilitySpace;
|
---|
6 |
|
---|
7 |
|
---|
8 | public class BidsComparator implements Comparator<Bid> {
|
---|
9 |
|
---|
10 | public BidsComparator(AdditiveUtilitySpace utilitySpace) {
|
---|
11 | super();
|
---|
12 | this.utilitySpace = utilitySpace;
|
---|
13 | }
|
---|
14 |
|
---|
15 | private AdditiveUtilitySpace utilitySpace;
|
---|
16 |
|
---|
17 | @Override
|
---|
18 | public int compare(Bid arg0, Bid arg1) {
|
---|
19 | try {
|
---|
20 | if (utilitySpace.getUtility(arg0) < utilitySpace.getUtility(arg1))
|
---|
21 | return 1;
|
---|
22 | else if (utilitySpace.getUtility(arg0) == (utilitySpace.getUtility(arg1))) {
|
---|
23 | return 0;
|
---|
24 | }
|
---|
25 | } catch (Exception e) {
|
---|
26 |
|
---|
27 | }
|
---|
28 | return -1;
|
---|
29 | }
|
---|
30 |
|
---|
31 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.