Changeset 8 for exampleparties/timedependentparty/src/main/java
- Timestamp:
- 09/30/19 15:37:05 (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
exampleparties/timedependentparty/src/main/java/geniusweb/exampleparties/timedependentparty/TimeDependentParty.java
r4 r8 39 39 * on bidspaces > 10000 bids. In special cases it may even run out of memory, 40 40 */ 41 public abstractclass TimeDependentParty extends DefaultParty {41 public class TimeDependentParty extends DefaultParty { 42 42 43 43 private static final BigDecimal DEC0001 = new BigDecimal("0.0001"); … … 49 49 private Bid lastReceivedBid = null; 50 50 private ExtendedUtilSpace extendedspace; 51 private double e = 1.2; 51 52 52 53 public TimeDependentParty() { … … 79 80 this.me = settings.getID(); 80 81 this.progress = settings.getProgress(); 82 Object newe = settings.getParemeters().get("e"); 83 if (newe != null) { 84 if (newe instanceof Double) { 85 this.e = (Double) newe; 86 } else { 87 getReporter().log(Level.WARNING, 88 "parameter e should be Double but found " 89 + newe); 90 } 91 } 92 81 93 } else if (info instanceof ActionDone) { 82 94 Action otheract = ((ActionDone) info).getAction(); … … 113 125 * 4. When e = 0, the agent plays hardball. 114 126 */ 115 public abstract double getE(); 127 public double getE() { 128 return e; 129 } 116 130 117 131 /******************* private support funcs ************************/ … … 177 191 .min(maxUtil).max(minUtil); 178 192 } 193 194 @Override 195 public String getDescription() { 196 return "Time-dependent conceder. Aims at utility u(t) = scale * t^(1/e) " 197 + "where t is the time (0=start, 1=end), e is a parameter (default 1.1), and scale such that u(0)=minimum and " 198 + "u(1) = maximum possible utility. "; 199 } 179 200 }
Note:
See TracChangeset
for help on using the changeset viewer.