source: src/main/java/agents/anac/y2010/AgentFSEGA/ReverseBidComparator.java@ 126

Last change on this file since 126 was 126, checked in by Aron Hammond, 6 years ago

Added function to calculate opposition to MultiLateralAnalysis.java

Moved code to add RLBOA listeners to RLBOAUtils is misc package

Added input for strategyParameters to SessionPanel (gui)

!! close SessionInfo after tournament; this caused /tmp/ to fill up with GeniusData files

Our own package:

  • Added opponents and strategies that are mentioned in the report
  • Change class hierarchy, agents can now extend from RLBOAagentBilateral to inherit RL functionality.
  • States extend from AbstractState
File size: 757 bytes
Line 
1package agents.anac.y2010.AgentFSEGA;
2
3import genius.core.Bid;
4import genius.core.utility.AdditiveUtilitySpace;
5
6public class ReverseBidComparator implements java.util.Comparator<Bid>
7{
8 private AdditiveUtilitySpace usp;
9 private final boolean TEST_EQUIVALENCE = false;
10
11 public ReverseBidComparator(AdditiveUtilitySpace pUsp)
12 {
13 usp = pUsp;
14 }
15
16 public int compare(Bid b1, Bid b2)
17 {
18 try
19 {
20 double u1 = usp.getUtility(b1);
21 double u2 = usp.getUtility(b2);
22 if (TEST_EQUIVALENCE) {
23 if (u1 == u2) {
24 return String.CASE_INSENSITIVE_ORDER.compare(b1.toString(), b2.toString());
25 }
26 }
27 if(u1 > u2)
28 return -1; // ! is reversed
29 else if(u1 < u2)
30 return 1;
31 else
32 return 0;
33 }
34 catch(Exception e)
35 { return -1; }
36 }
37}
Note: See TracBrowser for help on using the repository browser.