|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjadex.bdi.planlib.protocols.LinearPriceCalculator
public class LinearPriceCalculator
A sample implementation of the IPriceCalculator. Calculates the price for the rounds of an english auction.
| Field Summary | |
|---|---|
protected boolean |
increasing
Flag indicating if increasing or decreasing prices are calculated. |
protected double |
limitprice
The limit price. |
protected double |
minstepwidth
The minimum step width. |
protected java.util.List |
prices
The prices. |
protected int |
round
The negotiation round. |
protected double |
startprice
The start price. |
protected double |
stepwidth
The base (base^round). |
protected double |
variation
The variance. |
| Constructor Summary | |
|---|---|
LinearPriceCalculator(double startprice,
double limitprice,
double base)
Create a new linear price calculator. |
|
LinearPriceCalculator(double startprice,
double limitprice,
double stepwidth,
double variation,
double minstepwidth)
Create a new linear price calculator. |
|
| Method Summary | |
|---|---|
java.lang.Comparable |
getCurrentOffer()
Get the current price. |
java.lang.Comparable |
getLastOffer()
Returns the offer for the last round. |
java.lang.Comparable |
getLimitOffer()
Get the min price. |
int |
getRound()
Get the round. |
java.lang.Comparable |
getStartOffer()
Get the start price. |
static void |
main(java.lang.String[] args)
Main for testing. |
void |
setNextRound()
Increase the round. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected int round
protected double startprice
protected double limitprice
protected java.util.List prices
protected double variation
protected double stepwidth
protected double minstepwidth
protected boolean increasing
| Constructor Detail |
|---|
public LinearPriceCalculator(double startprice,
double limitprice,
double base)
startprice - The start price.limitprice - The minimal price for a successful auction.base - The base for the exponential function, should be
positive for english and negative for dutch auctions.
public LinearPriceCalculator(double startprice,
double limitprice,
double stepwidth,
double variation,
double minstepwidth)
startprice - the start pricelimitprice - the minimal price for a successful auctionstepwidth - The normal increment/decrement value.variation - The variation in percentage (0->1) for the increment.
The increment will be used to adapt the increment by multiplying
it with (+/-) a random value that has maximal the variation
percentage influence, e.g. setting 0.1 will cause the increment
being maximally +/-10% changed.| Method Detail |
|---|
public java.lang.Comparable getCurrentOffer()
getCurrentOffer in interface IOfferGeneratorpublic java.lang.Comparable getLastOffer()
getLastOffer in interface IOfferGeneratorpublic java.lang.Comparable getLimitOffer()
getLimitOffer in interface IOfferGeneratorpublic java.lang.Comparable getStartOffer()
getStartOffer in interface IOfferGeneratorpublic int getRound()
getRound in interface IOfferGeneratorpublic void setNextRound()
setNextRound in interface IOfferGeneratorpublic static void main(java.lang.String[] args)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||