public class BidsCollection
extends java.lang.Object
Constructor and Description |
---|
BidsCollection()
Creates a BidsCollection-object which stores the partner bids and all possible
bids.
|
Modifier and Type | Method and Description |
---|---|
void |
addPartnerBid(Bid bid,
double utility,
double time)
Add a partner bid to the history.
|
void |
addPossibleBid(Bid bid,
double utility)
Add a possible bid to the list of possible bids.
|
Bid |
getBestPartnerBids(double threshold)
Get a partner bid which has a utility of at least a certain
value.
|
Bid |
getOwnBidBetween(double lowerThres,
double upperThres) |
Bid |
getOwnBidBetween(double lowerThres,
double upperThres,
int counter)
Get a random bid between two given thresholds.
|
Bid |
getPartnerBid(int i)
Get a partner bid.
|
java.util.ArrayList<BidDetails> |
getPartnerBids() |
java.util.ArrayList<BidDetails> |
getPossibleBids() |
double |
getUpperThreshold(double threshold,
double percentage)
Calculate the upperthreshold based on the lowerthreshold and a given percentage.
|
void |
sortPossibleBids()
Sorts all possible bids in reverse natural order.
|
public BidsCollection()
public java.util.ArrayList<BidDetails> getPartnerBids()
public java.util.ArrayList<BidDetails> getPossibleBids()
public void addPartnerBid(Bid bid, double utility, double time)
bid
- made by partner in the current turnutility
- of the bidpublic void addPossibleBid(Bid bid, double utility)
bid
- which is possibleutility
- of the bidpublic void sortPossibleBids()
public Bid getPartnerBid(int i)
i
- public Bid getBestPartnerBids(double threshold)
threshold
- public Bid getOwnBidBetween(double lowerThres, double upperThres)
public Bid getOwnBidBetween(double lowerThres, double upperThres, int counter)
lowerThres
- lowerbound thresholdupperThres
- upperbound thresholdpublic double getUpperThreshold(double threshold, double percentage)
threshold
- percentage
-