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

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

quick fix of Jasparon agent to use BoaParty

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());
37 opponentModel = new AgentXFrequencyModel();
38 opponentModel.init(negotiationSession, new HashMap<String, Double>());
39 omStrategy = new NullStrategy(negotiationSession);
40 offeringStrategy = new JasparonBiddingStrategy(negotiationSession,
41 opponentModel, omStrategy);
42
43 acceptConditions = new AC_Next(negotiationSession, offeringStrategy, 1,
44 0);
45 // we have init'd all params already, don't call super init
46 }
47
48 @Override
49 public String getDescription() {
50 return "Agent Jasperon";
51 }
52}
Note: See TracBrowser for help on using the repository browser.