1 | package bargainingchips.players.history;
|
---|
2 |
|
---|
3 | import bargainingchips.Bundle;
|
---|
4 | import bargainingchips.actions.Bid;
|
---|
5 |
|
---|
6 | /**
|
---|
7 | *
|
---|
8 | * Event refers to a {@link Bid} happened at a specific time in the past,
|
---|
9 | * offered by an {@link Agent} (g to {@link Agent} \bar{g}).
|
---|
10 | *
|
---|
11 | *
|
---|
12 | * @author Faria Nassiri-Mofakham
|
---|
13 | *
|
---|
14 | */
|
---|
15 | public class BidEvent
|
---|
16 | {
|
---|
17 | //private final String sender;
|
---|
18 | private final Bundle bid;
|
---|
19 | private static double time;
|
---|
20 | private final double myUtility;
|
---|
21 |
|
---|
22 |
|
---|
23 | public BidEvent
|
---|
24 | //(String id, Bundle b, double u, double t)
|
---|
25 | (Bundle b, double u, double t)
|
---|
26 | {
|
---|
27 | this.bid = b;
|
---|
28 | //this.sender = id;
|
---|
29 | this.myUtility = u;
|
---|
30 | this.time = t;
|
---|
31 | }
|
---|
32 |
|
---|
33 | /**
|
---|
34 | * Just a sample example of an event at a time by a sender
|
---|
35 | */
|
---|
36 | // public static BidEvent getSampleEvent(String sender, String color, int qty, double util, double t)
|
---|
37 | public static BidEvent getSampleEvent(String color, int qty, double util, double t)
|
---|
38 |
|
---|
39 | {
|
---|
40 | // return new BidEvent(sender, Bid.getSampleBid(color, qty), util , time);
|
---|
41 | return new BidEvent(Bid.getSampleBid(color, qty), util , time);
|
---|
42 | }
|
---|
43 |
|
---|
44 | // public String getSender()
|
---|
45 | // {
|
---|
46 | // return sender;
|
---|
47 | // }
|
---|
48 |
|
---|
49 | public Bundle getBid()
|
---|
50 | {
|
---|
51 | return bid;
|
---|
52 | }
|
---|
53 |
|
---|
54 | /**
|
---|
55 | * @return the myUtility
|
---|
56 | */
|
---|
57 | public double getMyUtility() {
|
---|
58 | return myUtility;
|
---|
59 | }
|
---|
60 |
|
---|
61 | public double getTime()
|
---|
62 | {
|
---|
63 | return time;
|
---|
64 | }
|
---|
65 |
|
---|
66 | @Override
|
---|
67 | public String toString()
|
---|
68 | {
|
---|
69 | return "MyUtility: " + myUtility + "of Bid: "+ bid.toString() + " at: "+ time + " " ;
|
---|
70 | }
|
---|
71 | }
|
---|