uk.ac.liv.auction.agent
Class RandomValuer

java.lang.Object
  extended byuk.ac.liv.auction.agent.RandomValuer
All Implemented Interfaces:
AuctionEventListener, Parameterizable, Resetable, java.io.Serializable, ValuationPolicy
Direct Known Subclasses:
DailyRandomValuer, RandomScheduleValuer

public class RandomValuer
extends java.lang.Object
implements ValuationPolicy, java.io.Serializable

A valuation policy in which we randomly determine our valuation across all auctions and all units at agent-initialisation time. Valuations are drawn from a uniform distribution with the specified range.

Parameters

base .minvalue
double >= 0
(the minimum valuation)
base .maxvalue
double >=0
(the maximum valuation)

Version:
$Revision: 1.19 $
Author:
Steve Phelps
See Also:
Serialized Form

Field Summary
protected  cern.jet.random.AbstractContinousDistribution distribution
          The probability distribution to use for drawing valuations.
protected  double maxValue
          The maximum valuation to use.
protected  double minValue
          The minimum valuation to use.
static java.lang.String P_MAXVALUE
           
static java.lang.String P_MINVALUE
           
protected  double value
          The current valuation.
 
Constructor Summary
RandomValuer()
           
RandomValuer(double minValue, double maxValue)
           
 
Method Summary
 void consumeUnit(Auction auction)
          Recalculate valuation after consumption of the commodity being traded in the given auction.
 double determineValue(Auction auction)
          Determine the current valuation of commodity in the given auction.
 void drawRandomValue()
           
 void eventOccurred(AuctionEvent event)
          Recalculate valuation(s) in response to an auction event.
 double getCurrentValuation()
           
 double getMaxValue()
           
 double getMinValue()
           
 void initialise()
           
 void reset()
          Reinitialise our state to the original settings.
 void setMaxValue(double maxValue)
           
 void setMinValue(double minValue)
           
 void setup(ec.util.ParameterDatabase parameters, ec.util.Parameter base)
          Initialise this object from a parameter database.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

value

protected double value
The current valuation.


minValue

protected double minValue
The minimum valuation to use.


maxValue

protected double maxValue
The maximum valuation to use.


distribution

protected cern.jet.random.AbstractContinousDistribution distribution
The probability distribution to use for drawing valuations.


P_MINVALUE

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

P_MAXVALUE

public static final java.lang.String P_MAXVALUE
See Also:
Constant Field Values
Constructor Detail

RandomValuer

public RandomValuer()

RandomValuer

public RandomValuer(double minValue,
                    double maxValue)
Method Detail

setup

public void setup(ec.util.ParameterDatabase parameters,
                  ec.util.Parameter base)
Description copied from interface: Parameterizable
Initialise this object from a parameter database.

Specified by:
setup in interface Parameterizable

determineValue

public double determineValue(Auction auction)
Description copied from interface: ValuationPolicy
Determine the current valuation of commodity in the given auction.

Specified by:
determineValue in interface ValuationPolicy

consumeUnit

public void consumeUnit(Auction auction)
Description copied from interface: ValuationPolicy
Recalculate valuation after consumption of the commodity being traded in the given auction.

Specified by:
consumeUnit in interface ValuationPolicy

eventOccurred

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

Specified by:
eventOccurred in interface ValuationPolicy

reset

public void reset()
Description copied from interface: Resetable
Reinitialise our state to the original settings.

Specified by:
reset in interface Resetable

initialise

public void initialise()

setMaxValue

public void setMaxValue(double maxValue)

getMaxValue

public double getMaxValue()

setMinValue

public void setMinValue(double minValue)

getMinValue

public double getMinValue()

getCurrentValuation

public double getCurrentValuation()

drawRandomValue

public void drawRandomValue()

toString

public java.lang.String toString()