source: src/main/java/agents/anac/y2014/BraveCat/OpponentModelStrategies/NullStrategy.java

Last change on this file 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: 1.3 KB
Line 
1 package agents.anac.y2014.BraveCat.OpponentModelStrategies;
2
3 import agents.anac.y2014.BraveCat.OpponentModels.OpponentModel;
4 import java.util.HashMap;
5 import java.util.List;
6 import java.util.Random;
7 import agents.anac.y2014.BraveCat.necessaryClasses.NegotiationSession;
8import genius.core.bidding.BidDetails;
9
10 public class NullStrategy extends OMStrategy
11 {
12 private Random rand;
13 private double updateThreshold = 1.1D;
14
15 public NullStrategy()
16 {
17 }
18
19 public NullStrategy(NegotiationSession negotiationSession)
20 {
21 this.negotiationSession = negotiationSession;
22 this.rand = new Random();
23 }
24
25 @Override
26 public void init(NegotiationSession negotiationSession, OpponentModel model, HashMap<String, Double> parameters) throws Exception {
27 super.init(negotiationSession, model);
28 this.rand = new Random();
29 this.negotiationSession = negotiationSession;
30 if (parameters.containsKey("t"))
31 this.updateThreshold = ((Double)parameters.get("t")).doubleValue();
32 }
33
34 @Override
35 public BidDetails getBid(List<BidDetails> allBids)
36 {
37 return (BidDetails)allBids.get(0);
38 }
39
40 @Override
41 public boolean canUpdateOM()
42 {
43 return this.negotiationSession.getTime() < this.updateThreshold;
44 }
45 }
Note: See TracBrowser for help on using the repository browser.