Jadex 0.96-beta1

jadex.planlib
Class LinearPriceCalculator

java.lang.Object
  extended by jadex.planlib.LinearPriceCalculator
All Implemented Interfaces:
IOfferGenerator

public class LinearPriceCalculator
extends Object
implements IOfferGenerator

A sample implementation of the IPriceCalculator. Calculates the price for the rounds of an english auction.


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
 Comparable getCurrentOffer()
          Get the current price.
 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.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LinearPriceCalculator

public LinearPriceCalculator(double startprice,
                             double limitprice,
                             double base)
Create a new linear price calculator.

Parameters:
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.

LinearPriceCalculator

public LinearPriceCalculator(double startprice,
                             double limitprice,
                             double stepwidth,
                             double variation,
                             double minstepwidth)
Create a new linear price calculator.

Parameters:
startprice - the start price
limitprice - the minimal price for a successful auction
stepwidth - 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

getCurrentOffer

public Comparable getCurrentOffer()
Get the current price.

Specified by:
getCurrentOffer in interface IOfferGenerator
Returns:
The current price.

getLimitOffer

public Comparable getLimitOffer()
Get the min price.

Specified by:
getLimitOffer in interface IOfferGenerator
Returns:
The minprice.

getStartOffer

public Comparable getStartOffer()
Get the start price.

Specified by:
getStartOffer in interface IOfferGenerator
Returns:
The startprice

getRound

public int getRound()
Get the round.

Specified by:
getRound in interface IOfferGenerator
Returns:
The round.

setNextRound

public void setNextRound()
Increase the round.

Specified by:
setNextRound in interface IOfferGenerator

main

public static void main(String[] args)
Main for testing.


Jadex 0.96-beta1

Submit a bug or feature
For further API reference and developer documentation, see the Jadex User Guide and the Jadex Tutorial. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, and working code examples.

Copyright (C) 2002-2007 Lars Braubach, Alexander Pokahr - University of Hamburg. Use is subject to license terms.