source: src/main/java/uva/projectai/y2018/jasparon/Jasparon.java@ 112

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

#38 NegotiationSession now contains UserModel. Cleaned up negotiationsession.

File size: 1.7 KB
Line 
1package uva.projectai.y2018.jasparon;
2
3import java.util.HashMap;
4
5import genius.core.boaframework.BoaParty;
6import genius.core.boaframework.NegotiationSession;
7import genius.core.boaframework.SessionData;
8import genius.core.parties.NegotiationInfo;
9import genius.core.persistent.PersistentDataType;
10import negotiator.boaframework.acceptanceconditions.other.AC_Next;
11import negotiator.boaframework.omstrategy.NullStrategy;
12import negotiator.boaframework.opponentmodel.AgentXFrequencyModel;
13
14@SuppressWarnings("serial")
15public class Jasparon extends BoaParty {
16
17 public Jasparon() {
18 super(null, new HashMap<String, Double>(), null,
19 new HashMap<String, Double>(), null,
20 new HashMap<String, Double>(), null,
21 new HashMap<String, Double>());
22 }
23
24 @Override
25 public void init(NegotiationInfo info) {
26 SessionData sessionData = null;
27 if (info.getPersistentData()
28 .getPersistentDataType() == PersistentDataType.SERIALIZABLE) {
29 sessionData = (SessionData) info.getPersistentData().get();
30 }
31 if (sessionData == null) {
32 sessionData = new SessionData();
33 }
34
35 negotiationSession = new NegotiationSession(sessionData,
36 info.getUtilitySpace(), info.getTimeline(), null,
37 info.getUserModel());
38 opponentModel = new AgentXFrequencyModel();
39 opponentModel.init(negotiationSession, new HashMap<String, Double>());
40 omStrategy = new NullStrategy(negotiationSession);
41 offeringStrategy = new JasparonBiddingStrategy(negotiationSession,
42 opponentModel, omStrategy);
43
44 acceptConditions = new AC_Next(negotiationSession, offeringStrategy, 1,
45 0);
46 // we have init'd all params already, don't call super init
47 }
48
49 @Override
50 public String getDescription() {
51 return "Agent Jasperon";
52 }
53}
Note: See TracBrowser for help on using the repository browser.