source: src/main/java/bargainingchips/players/history/BidEvent.java@ 340

Last change on this file since 340 was 340, checked in by Tim Baarslag, 4 years ago

Change BilateralProtocol loop to avoid busy wait; note that this fixes only a part of the busy wait problem.

Package structure now in line with latest Acumex discussions.

Pinpointed error avoidance in Agent.

File size: 1.5 KB
Line 
1package bargainingchips.players.history;
2
3import bargainingchips.Bundle;
4import 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 */
15public 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}
Note: See TracBrowser for help on using the repository browser.