[127] | 1 | package negotiator.boaframework.opponentmodel;
|
---|
| 2 |
|
---|
| 3 | import java.util.Map;
|
---|
| 4 |
|
---|
| 5 | import genius.core.Bid;
|
---|
| 6 | import genius.core.boaframework.NegotiationSession;
|
---|
| 7 | import genius.core.boaframework.OpponentModel;
|
---|
| 8 | import genius.core.issue.Issue;
|
---|
| 9 | import genius.core.utility.AdditiveUtilitySpace;
|
---|
| 10 | import 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 | */
|
---|
| 23 | public 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 | }
|
---|
[1] | 54 | } |
---|