Package jadex.bdi.planlib.protocols
Class ExponentialPriceCalculator
- java.lang.Object
- 
- jadex.bdi.planlib.protocols.ExponentialPriceCalculator
 
- 
- All Implemented Interfaces:
- IOfferGenerator
 
 public class ExponentialPriceCalculator extends java.lang.Object implements IOfferGenerator A sample implementation of the IPriceCalculator. Calculates the price for the next round of an english auction.
- 
- 
Field SummaryFields Modifier and Type Field Description protected doublebaseThe base (base^round).protected booleanincreasingFlag indicating if increasing or decreasing prices are calculated.protected doublelimitpriceThe limit price.protected doubleminstepwidthThe minimum step width.protected java.util.ListpricesThe prices.protected introundThe negotiation round.protected doublestartpriceThe start price.protected doublevariationThe variation.
 - 
Constructor SummaryConstructors Constructor Description ExponentialPriceCalculator(double startprice, double limitprice, double base)Create a new exponential price calculator.ExponentialPriceCalculator(double startprice, double limitprice, double base, double variation, double minstepwidth)Create a new exponential price calculator.
 - 
Method SummaryAll Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.ComparablegetCurrentOffer()Get the price for the current round of this auction.java.lang.ComparablegetLastOffer()Returns the offer for the last round.java.lang.ComparablegetLimitOffer()Get the min price.intgetRound()Get the round.java.lang.ComparablegetStartOffer()Get the start price.static voidmain(java.lang.String[] args)Main for testing.voidsetNextRound()Increase the round.
 
- 
- 
- 
Field Detail- 
roundprotected int round The negotiation round.
 - 
startpriceprotected double startprice The start price.
 - 
limitpriceprotected double limitprice The limit price.
 - 
pricesprotected java.util.List prices The prices.
 - 
variationprotected double variation The variation.
 - 
baseprotected double base The base (base^round).
 - 
minstepwidthprotected double minstepwidth The minimum step width.
 - 
increasingprotected boolean increasing Flag indicating if increasing or decreasing prices are calculated.
 
- 
 - 
Constructor Detail- 
ExponentialPriceCalculatorpublic ExponentialPriceCalculator(double startprice, double limitprice, double base)Create a new exponential price calculator.- Parameters:
- startprice- The start price.
- limitprice- The limit price (min or max) for a auction.
- base- The base for the exponential function.
 
 - 
ExponentialPriceCalculatorpublic ExponentialPriceCalculator(double startprice, double limitprice, double base, double variation, double minstepwidth)Create a new exponential price calculator.- Parameters:
- startprice- the start price
- limitprice- the minimal price for a successful auction
- base- The base for the exponential function.
- 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.
- minstepwidth- The minimum step width (a positive value that describes the minimum price change in each round).
 
 
- 
 - 
Method Detail- 
getCurrentOfferpublic java.lang.Comparable getCurrentOffer() Get the price for the current round of this auction.- Specified by:
- getCurrentOfferin interface- IOfferGenerator
- Returns:
- The price.
 
 - 
getLastOfferpublic java.lang.Comparable getLastOffer() Returns the offer for the last round.- Specified by:
- getLastOfferin interface- IOfferGenerator
- Returns:
- The last offer.
 
 - 
getLimitOfferpublic java.lang.Comparable getLimitOffer() Get the min price.- Specified by:
- getLimitOfferin interface- IOfferGenerator
- Returns:
- The minprice.
 
 - 
getStartOfferpublic java.lang.Comparable getStartOffer() Get the start price.- Specified by:
- getStartOfferin interface- IOfferGenerator
- Returns:
- The startprice
 
 - 
getRoundpublic int getRound() Get the round.- Specified by:
- getRoundin interface- IOfferGenerator
- Returns:
- The round.
 
 - 
setNextRoundpublic void setNextRound() Increase the round.- Specified by:
- setNextRoundin interface- IOfferGenerator
 
 - 
mainpublic static void main(java.lang.String[] args) Main for testing.
 
- 
 
-