uk.ac.liv.auction.electricity
Class ElectricityTrader

java.lang.Object
  extended byuk.ac.liv.auction.agent.AbstractTradingAgent
      extended byuk.ac.liv.auction.electricity.ElectricityTrader
All Implemented Interfaces:
AuctionEventListener, java.lang.Cloneable, Parameterizable, Prototypeable, Resetable, java.io.Serializable, TradingAgent

public class ElectricityTrader
extends AbstractTradingAgent

An adaptive trader, trading in a simulated Elecitricty market. Agents of this type have a fixed generating capacity, and they trade units equal to their capacity in each round of the auction.

For further details, see:

"Market Power and Efficiency in a Computational Electricity Market with Discriminatory Double-Auction Pricing" Nicolaisen, J.; Petrov, V.; and Tesfatsion, L. in IEEE Trans. on Evol. Computation, Vol. 5, No. 5. 2001

This code was written by Steve Phelps in an attempt to replicate the results in the above paper. This work was carried out independently from the original authors. Any corrections to this code are welcome.

Parameters

base.capacity
int >= 0
(the generating capacity of the agent)

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

Field Summary
protected  int capacity
          The capacity of this trader in MWh
protected  double fixedCosts
          The fixed costs for this trader.
 
Fields inherited from class uk.ac.liv.auction.agent.AbstractTradingAgent
currentShout, funds, group, id, initialFunds, initialStock, isSeller, lastProfit, lastShoutAccepted, P_DEFAULT_STRATEGY, P_GROUP, P_INITIAL_FUNDS, P_INITIAL_STOCK, P_IS_SELLER, P_STRATEGY, P_VALUER, profits, stock, strategy, valuer
 
Constructor Summary
ElectricityTrader()
           
ElectricityTrader(int capacity, double privateValue, double fixedCosts, boolean isSeller)
           
ElectricityTrader(int capacity, double privateValue, double fixedCosts, boolean isSeller, Strategy strategy)
           
 
Method Summary
 boolean acceptDeal(Auction auction, double price, int quantity)
           
 boolean active()
          Determine whether or not this trader is active.
 void endOfDay(AuctionEvent event)
           
 double equilibriumProfits(Auction auction, double equilibriumPrice, int quantity)
          Calculate the hypothetical surplus this agent will receive if the market had cleared uniformly at the specified equilibrium price and quantity.
 int getCapacity()
           
 double getLastProfit()
          Return the profit made in the most recent auction round.
 void informOfSeller(Auction auction, Shout winningShout, TradingAgent seller, double price, int quantity)
          This method is used by an auction to notify a buyer that one of its bids has been successful.
 void initialise()
           
 void requestShout(Auction auction)
          Place a shout in the auction as determined by our currently configured strategy.
 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 uk.ac.liv.auction.agent.AbstractTradingAgent
auctionClosed, auctionOpen, deliver, determineQuantity, eventOccurred, getCurrentShout, getFunds, getGroup, getId, getProfits, getStock, getStrategy, getValuation, getValuationPolicy, giveFunds, informOfBuyer, isBuyer, isSeller, lastShoutAccepted, pay, protoClone, purchaseFrom, reset, roundClosed, setGroup, setIsSeller, setPrivateValue, setStrategy, setValuationPolicy
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

capacity

protected int capacity
The capacity of this trader in MWh


fixedCosts

protected double fixedCosts
The fixed costs for this trader.

Constructor Detail

ElectricityTrader

public ElectricityTrader(int capacity,
                         double privateValue,
                         double fixedCosts,
                         boolean isSeller,
                         Strategy strategy)

ElectricityTrader

public ElectricityTrader(int capacity,
                         double privateValue,
                         double fixedCosts,
                         boolean isSeller)

ElectricityTrader

public ElectricityTrader()
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
Overrides:
setup in class AbstractTradingAgent

initialise

public void initialise()
Overrides:
initialise in class AbstractTradingAgent

requestShout

public void requestShout(Auction auction)
Description copied from class: AbstractTradingAgent
Place a shout in the auction as determined by our currently configured strategy.

Specified by:
requestShout in interface TradingAgent
Overrides:
requestShout in class AbstractTradingAgent

informOfSeller

public void informOfSeller(Auction auction,
                           Shout winningShout,
                           TradingAgent seller,
                           double price,
                           int quantity)
Description copied from interface: TradingAgent
This method is used by an auction to notify a buyer that one of its bids has been successful.

Specified by:
informOfSeller in interface TradingAgent
Overrides:
informOfSeller in class AbstractTradingAgent

acceptDeal

public boolean acceptDeal(Auction auction,
                          double price,
                          int quantity)

getCapacity

public int getCapacity()

getLastProfit

public double getLastProfit()
Description copied from class: AbstractTradingAgent
Return the profit made in the most recent auction round. This can be used as, e.g. input to a re-inforcement learning algorithm.

Overrides:
getLastProfit in class AbstractTradingAgent

equilibriumProfits

public double equilibriumProfits(Auction auction,
                                 double equilibriumPrice,
                                 int quantity)
Description copied from class: AbstractTradingAgent
Calculate the hypothetical surplus this agent will receive if the market had cleared uniformly at the specified equilibrium price and quantity.

Specified by:
equilibriumProfits in class AbstractTradingAgent

active

public boolean active()
Description copied from class: AbstractTradingAgent
Determine whether or not this trader is active. Inactive traders do not place shouts in the auction, but do carry on learning through their strategy.

Specified by:
active in class AbstractTradingAgent
Returns:
true if the trader is active.

endOfDay

public void endOfDay(AuctionEvent event)
Overrides:
endOfDay in class AbstractTradingAgent

toString

public java.lang.String toString()