source: src/main/java/agents/anac/y2014/E2Agent/myUtility/BidStorageComparator.java

Last change on this file was 1, checked in by Wouter Pasman, 6 years ago

Initial import : Genius 9.0.0

File size: 535 bytes
Line 
1package agents.anac.y2014.E2Agent.myUtility;
2
3import java.util.Comparator;
4
5public class BidStorageComparator implements Comparator {
6 public int compare(Object s, Object t) {
7 // + (x > y)
8 // compare x y = 0 (x = y)
9 // - (x < y)
10 double diff = ((BidStorage) s).getUtility()
11 - ((BidStorage) t).getUtility();
12 int ret = 0;
13 if(0 < diff) {
14 ret = 1;
15 } else if(diff < 0){
16 ret = -1;
17 }
18 return ret;
19 }
20}
Note: See TracBrowser for help on using the repository browser.