source: src/main/java/negotiator/boaframework/opponentmodel/OppositeModel.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.5 KB
Line 
1package negotiator.boaframework.opponentmodel;
2
3import java.util.Map;
4
5import genius.core.Bid;
6import genius.core.boaframework.NegotiationSession;
7import genius.core.boaframework.OpponentModel;
8import genius.core.issue.Issue;
9import genius.core.utility.AdditiveUtilitySpace;
10import negotiator.boaframework.opponentmodel.tools.UtilitySpaceAdapter;
11
12/**
13 * Simple baseline opponent model which just mirror's the utility space of the
14 * agent. Note that the model does not measure the issue weights, it makes no
15 * sense.
16 *
17 * Tim Baarslag, Koen Hindriks, Mark Hendrikx, Alex Dirkzwager and Catholijn M.
18 * Jonker. Decoupling Negotiating Agents to Explore the Space of Negotiation
19 * Strategies
20 *
21 * @author Mark Hendrikx
22 */
23public class OppositeModel extends OpponentModel {
24
25 @Override
26 public void init(NegotiationSession negotiationSession, Map<String, Double> parameters) {
27 this.negotiationSession = negotiationSession;
28 this.opponentUtilitySpace = new UtilitySpaceAdapter(this, negotiationSession.getUtilitySpace().getDomain());
29 }
30
31 @Override
32 public void updateModel(Bid bid, double time) {
33 }
34
35 @Override
36 public double getBidEvaluation(Bid bid) {
37 try {
38 return (1.0 - negotiationSession.getUtilitySpace().getUtility(bid));
39 } catch (Exception e) {
40 e.printStackTrace();
41 }
42 return 0.0;
43 }
44
45 //
46 public double getWeight(Issue issue) {
47 return ((AdditiveUtilitySpace) negotiationSession.getUtilitySpace()).getWeight(issue.getNumber());
48 }
49
50 @Override
51 public String getName() {
52 return "Opposite Model";
53 }
54}
Note: See TracBrowser for help on using the repository browser.