Last change
on this file since 84 was 1, checked in by Wouter Pasman, 6 years ago |
Initial import : Genius 9.0.0
|
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.