public class BidHistory
extends java.lang.Object
Constructor and Description |
---|
BidHistory()
Creates an empty bid history.
|
BidHistory(java.util.ArrayList<BidDetails> bids)
Creates a bid history given an array of bids offered
by the negotiation agent.
|
BidHistory(UtilitySpace utilSpace) |
Modifier and Type | Method and Description |
---|---|
void |
add(BidDetails bid)
Add an offered bid o the history.
|
BidHistory |
filterBetween(double minU,
double maxU,
double minT,
double maxT)
Returns the set of bids offered between time instances t1 and t2: (t1, t2] and
with a utility in (u1, u2].
|
BidHistory |
filterBetweenTime(double t1,
double t2)
Returns the set of bids offered between time instances t1 and t2: (t1, t2].
|
BidHistory |
filterBetweenUtility(double u1,
double u2)
Returns the set of bids with a utility of at least u1 and at most u2: (u1, u2].
|
double |
getAverageUtility() |
BidDetails |
getBestBidDetails()
Returns the bid with the highest utility stored in the history.
|
BidDetails |
getBidDetailsOfUtility(double u)
Get the
BidDetails of the Bid with utility closest to u. |
BidDetails |
getFirstBidDetails()
Returns the first bid stored in the history
|
java.util.List<BidDetails> |
getHistory()
Returns the full history.
|
BidDetails |
getLastBidDetails()
Returns the last bid added to the history.
|
java.util.List<BidDetails> |
getNBestBids(int count)
Returns a list of the top N bids which the opponent has offered.
|
BidDetails |
getRandom() |
BidDetails |
getRandom(java.util.Random rand) |
BidDetails |
getWorstBidDetails()
Returns the bid with the lowest utility stored in the history.
|
int |
size() |
BidHistory |
sortToTime() |
BidHistory |
sortToUtility() |
public BidHistory(java.util.ArrayList<BidDetails> bids)
bids
- public BidHistory(UtilitySpace utilSpace)
public BidHistory()
public BidHistory filterBetweenTime(double t1, double t2)
t1
- t2
- public BidHistory filterBetweenUtility(double u1, double u2)
u1
- u2
- public BidHistory filterBetween(double minU, double maxU, double minT, double maxT)
minU
- maxU
- minT
- maxT
- public void add(BidDetails bid)
offered
- bidpublic java.util.List<BidDetails> getHistory()
public BidDetails getLastBidDetails()
public BidDetails getFirstBidDetails()
public BidDetails getBestBidDetails()
public BidDetails getWorstBidDetails()
public java.util.List<BidDetails> getNBestBids(int count)
count
- public int size()
public double getAverageUtility()
public BidDetails getBidDetailsOfUtility(double u)
BidDetails
of the Bid
with utility closest to u.public BidHistory sortToUtility()
public BidHistory sortToTime()
public BidDetails getRandom()
public BidDetails getRandom(java.util.Random rand)