1 | package agents.anac.y2014.E2Agent.myUtility;
|
---|
2 |
|
---|
3 | import java.io.Serializable;
|
---|
4 | import java.util.ArrayList;
|
---|
5 | import java.util.Collection;
|
---|
6 | import java.util.Collections;
|
---|
7 | import java.util.Comparator;
|
---|
8 | import java.util.HashMap;
|
---|
9 | import java.util.List;
|
---|
10 | import java.util.Random;
|
---|
11 |
|
---|
12 | import agents.anac.y2011.TheNegotiator.BidsCollection;
|
---|
13 | import agents.anac.y2012.MetaAgent.agents.WinnerAgent.opponentOffers;
|
---|
14 | import genius.core.Agent;
|
---|
15 | import genius.core.Bid;
|
---|
16 | import genius.core.actions.Accept;
|
---|
17 | import genius.core.actions.Action;
|
---|
18 | import genius.core.actions.Offer;
|
---|
19 | import genius.core.issue.Issue;
|
---|
20 | import genius.core.issue.IssueInteger;
|
---|
21 | import genius.core.issue.Value;
|
---|
22 | import genius.core.issue.ValueInteger;
|
---|
23 | import genius.core.timeline.Timeline;
|
---|
24 | import genius.core.utility.*;
|
---|
25 |
|
---|
26 |
|
---|
27 |
|
---|
28 | public class BidStorage implements Serializable {
|
---|
29 | private double utility = -1;
|
---|
30 | private Bid bid = null;
|
---|
31 | private double time = -1;
|
---|
32 |
|
---|
33 | public BidStorage(Bid b, double u, double t) {
|
---|
34 | bid = b;
|
---|
35 | utility = u;
|
---|
36 | time = t;
|
---|
37 | }
|
---|
38 |
|
---|
39 | public Bid getBid() { return bid; }
|
---|
40 | public double getUtility() { return utility; }
|
---|
41 | public double getTime() { return time; }
|
---|
42 | public String toString() {
|
---|
43 | return bid.toString() + " Utility: " + utility + " Time: " + time;
|
---|
44 | }
|
---|
45 |
|
---|
46 | // /**
|
---|
47 | // * ��形��る確率を返�
|
---|
48 | // * @param u 効用
|
---|
49 | // * @param t1 経�時間0~1
|
---|
50 | // * @return ��形��る確率
|
---|
51 | // * @throws uã�‹t1ã�Œä¸�æ£ã�ªå€¤ã�®æ™‚
|
---|
52 | // */
|
---|
53 | // double Paccept(double u, double t1) throws Exception {
|
---|
54 | // double t = t1 * t1 * t1;
|
---|
55 | // // æ£è¦�化ã�™ã‚‹ã�¨uã�¯1.0以上ã�«ã�ªã‚‹æ™‚ã�Œã�‚ã‚‹ã�®ã�§1.05ã�¨ã�™ã‚‹
|
---|
56 | // if(u < 0 || u > 1.05) throw new Exception("utility "+u+" outside [0,1]");
|
---|
57 | // if(t < 0 || t > 1) throw new Exception("time "+t+" outside [0,1]");
|
---|
58 | // if(u > 1.0) u = 1;
|
---|
59 | // if(t == 0.5) return u;
|
---|
60 | // return (u - 2.0 * u * t + 2.0 * (-1.0 + t + Math.sqrt(sq(-1.0 + t) + u * (-1.0 + 2 * t))))/(-1. + 2*t);
|
---|
61 | // }
|
---|
62 | }
|
---|