edu.cuny.cat.valuation
Class IntervalValuerGenerator

java.lang.Object
  extended by edu.cuny.cat.valuation.IntervalValuerGenerator
All Implemented Interfaces:
AuctionEventListener, ValuerGenerator, edu.cuny.config.param.Parameterizable, edu.cuny.obj.Resetable

public class IntervalValuerGenerator
extends java.lang.Object
implements ValuerGenerator

Agents configured with valuation policies created by this generator will receive a unique private value from a common set of values starting at minValue and incrementing by step as each agent is assigned a valuation at agent setup time. This is useful for quickly specifying supply or demand curves with a constant "slope" (step).

Parameters

base.minvalue
double >= 0 (50.0 by default)
(the minimal private value to be allocated)
base.step
double >= 0 (5.0 by default)
(the amount to increase each step for next private value)

Default Base

interval_valuer

Version:
$Revision: 1.7 $
Author:
Jinzhong Niu

Field Summary
static double DEFAULT_MINVALUE
           
static double DEFAULT_STEP
           
protected  boolean firstValue
           
protected  double minValue
          The minimum valuation that any buyer will receive.
protected  double nextValue
           
static java.lang.String P_DEF_BASE
           
static java.lang.String P_MINVALUE
           
static java.lang.String P_STEP
           
protected  double step
          The increment in valuation to use
 
Constructor Summary
IntervalValuerGenerator()
           
IntervalValuerGenerator(double minValue, double step)
           
 
Method Summary
 ValuationPolicy createValuer()
          creates a new valuer.
 void eventOccurred(AuctionEvent event)
          Recalculate valuation(s) in response to an auction event.
protected  boolean firstValue()
           
protected  double getMinValue()
           
protected  double getNextValue()
           
protected  double getStep()
           
 void reset()
           
protected  void setFirstValue(boolean firstValue)
           
protected  void setMinValue(double value)
           
protected  void setNextValue(double value)
           
protected  void setStep(double step)
           
 void setup(edu.cuny.config.param.ParameterDatabase parameters, edu.cuny.config.param.Parameter base)
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

P_DEF_BASE

public static final java.lang.String P_DEF_BASE
See Also:
Constant Field Values

P_MINVALUE

public static final java.lang.String P_MINVALUE
See Also:
Constant Field Values

P_STEP

public static final java.lang.String P_STEP
See Also:
Constant Field Values

DEFAULT_MINVALUE

public static final double DEFAULT_MINVALUE
See Also:
Constant Field Values

DEFAULT_STEP

public static final double DEFAULT_STEP
See Also:
Constant Field Values

minValue

protected double minValue
The minimum valuation that any buyer will receive.


step

protected double step
The increment in valuation to use


nextValue

protected double nextValue

firstValue

protected boolean firstValue
Constructor Detail

IntervalValuerGenerator

public IntervalValuerGenerator()

IntervalValuerGenerator

public IntervalValuerGenerator(double minValue,
                               double step)
Method Detail

setup

public void setup(edu.cuny.config.param.ParameterDatabase parameters,
                  edu.cuny.config.param.Parameter base)
Specified by:
setup in interface edu.cuny.config.param.Parameterizable

reset

public void reset()
Specified by:
reset in interface edu.cuny.obj.Resetable

firstValue

protected boolean firstValue()

getMinValue

protected double getMinValue()

getNextValue

protected double getNextValue()

getStep

protected double getStep()

setFirstValue

protected void setFirstValue(boolean firstValue)

setMinValue

protected void setMinValue(double value)

setNextValue

protected void setNextValue(double value)

setStep

protected void setStep(double step)

createValuer

public ValuationPolicy createValuer()
Description copied from interface: ValuerGenerator
creates a new valuer.

Specified by:
createValuer in interface ValuerGenerator

eventOccurred

public void eventOccurred(AuctionEvent event)
Description copied from interface: ValuerGenerator
Recalculate valuation(s) in response to an auction event.

Specified by:
eventOccurred in interface AuctionEventListener
Specified by:
eventOccurred in interface ValuerGenerator

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object