source: src/main/java/negotiator/boaframework/opponentmodel/SmithFrequencyModel.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: 1.6 KB
Line 
1package negotiator.boaframework.opponentmodel;
2
3import java.util.Map;
4
5import agents.bayesianopponentmodel.OpponentModelUtilSpace;
6import genius.core.Bid;
7import genius.core.boaframework.NegotiationSession;
8import genius.core.boaframework.OpponentModel;
9import genius.core.issue.Issue;
10import genius.core.utility.AbstractUtilitySpace;
11import negotiator.boaframework.opponentmodel.agentsmith.SmithModel;
12
13/**
14 * Adapter for the Frequency Model for the BOA framework.
15 *
16 * Tim Baarslag, Koen Hindriks, Mark Hendrikx, Alex Dirkzwager and Catholijn M.
17 * Jonker. Decoupling Negotiating Agents to Explore the Space of Negotiation
18 * Strategies
19 *
20 * @author Mark Hendrikx
21 */
22public class SmithFrequencyModel extends OpponentModel {
23
24 private SmithModel model;
25 private int round = 0;
26
27 @Override
28 public void init(NegotiationSession negotiationSession, Map<String, Double> parameters) {
29 model = new SmithModel(negotiationSession.getUtilitySpace());
30 this.negotiationSession = negotiationSession;
31 }
32
33 @Override
34 public void updateModel(Bid opponentBid, double time) {
35 round++;
36 model.addBid(opponentBid);
37 }
38
39 @Override
40 public double getBidEvaluation(Bid bid) {
41 if (round > 0) {
42 return model.getNormalizedUtility(bid);
43 } else {
44 return 0;
45 }
46 }
47
48 @Override
49 public AbstractUtilitySpace getOpponentUtilitySpace() {
50 if (round > 0) {
51 return new OpponentModelUtilSpace(model);
52 } else {
53 return negotiationSession.getUtilitySpace();
54 }
55 }
56
57 public double getWeight(Issue issue) {
58 return model.getWeight(issue.getNumber());
59 }
60
61 @Override
62 public String getName() {
63 return "Smith Frequency Model";
64 }
65
66 public void cleanUp() {
67 super.cleanUp();
68 model = null;
69 }
70}
Note: See TracBrowser for help on using the repository browser.