public class LinearPriceCalculator extends Object implements IOfferGenerator
Constructor and Description |
---|
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.
|
Modifier and Type | Method and Description |
---|---|
Comparable |
getCurrentOffer()
Get the current price.
|
Comparable |
getLastOffer()
Returns the offer for the last round.
|
Comparable |
getLimitOffer()
Get the min price.
|
int |
getRound()
Get the round.
|
Comparable |
getStartOffer()
Get the start price.
|
static void |
main(String[] args)
Main for testing.
|
void |
setNextRound()
Increase the round.
|
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.public Comparable getCurrentOffer()
getCurrentOffer
in interface IOfferGenerator
public Comparable getLastOffer()
getLastOffer
in interface IOfferGenerator
public Comparable getLimitOffer()
getLimitOffer
in interface IOfferGenerator
public Comparable getStartOffer()
getStartOffer
in interface IOfferGenerator
public int getRound()
getRound
in interface IOfferGenerator
public void setNextRound()
setNextRound
in interface IOfferGenerator
public static void main(String[] args)
Copyright © 2013. All Rights Reserved.