uk.ac.liv.auction.ui
Class DrawableAgentAdaptor

java.lang.Object
  extended byuk.ac.liv.auction.ui.DrawableAgentAdaptor
All Implemented Interfaces:
uchicago.src.sim.gui.Drawable

public class DrawableAgentAdaptor
extends java.lang.Object
implements uchicago.src.sim.gui.Drawable

An adaptor that allows an AbstractTraderAgent to be drawn on a RePast Object2DDisplay. Each agent is represented by a coloured bar. Profitable buyers are shown as red, and profitable sellers are shown as blue. The brighter the colour, the more profitable the agent. Agents with zero profits are shown as white bars. The height of the bar represents the current margin offered by the agent; that is, the absolute difference between their current valuation of the commodity on offer and their last shout price.

Version:
$Revision: 1.12 $
Author:
Steve Phelps

Field Summary
protected  AbstractTradingAgent agent
           
protected  Auction auction
           
protected  uchicago.src.sim.gui.ColorMap colorMap
           
protected static float maxMarkup
           
protected static float maxProfit
           
protected static float minProfit
           
 float scale
           
 
Constructor Summary
DrawableAgentAdaptor(Auction auction)
           
DrawableAgentAdaptor(Auction auction, AbstractTradingAgent agent)
           
DrawableAgentAdaptor(Auction auction, AbstractTradingAgent agent, uchicago.src.sim.gui.ColorMap colorMap)
           
 
Method Summary
 void draw(uchicago.src.sim.gui.SimGraphics g)
           
 java.lang.Object getAgentType()
           
 float getCurrentValuation()
           
 long getId()
           
 float getLastProfit()
           
 boolean getLastShoutAccepted()
           
 float getLastShoutPrice()
           
 float getLearningDelta()
           
 java.lang.String getRole()
           
 float getTotalProfits()
           
 int getX()
           
 int getY()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

agent

protected AbstractTradingAgent agent

auction

protected Auction auction

colorMap

protected uchicago.src.sim.gui.ColorMap colorMap

minProfit

protected static float minProfit

maxProfit

protected static float maxProfit

maxMarkup

protected static float maxMarkup

scale

public float scale
Constructor Detail

DrawableAgentAdaptor

public DrawableAgentAdaptor(Auction auction)

DrawableAgentAdaptor

public DrawableAgentAdaptor(Auction auction,
                            AbstractTradingAgent agent)

DrawableAgentAdaptor

public DrawableAgentAdaptor(Auction auction,
                            AbstractTradingAgent agent,
                            uchicago.src.sim.gui.ColorMap colorMap)
Method Detail

draw

public void draw(uchicago.src.sim.gui.SimGraphics g)
Specified by:
draw in interface uchicago.src.sim.gui.Drawable

getX

public int getX()
Specified by:
getX in interface uchicago.src.sim.gui.Drawable

getY

public int getY()
Specified by:
getY in interface uchicago.src.sim.gui.Drawable

getLastProfit

public float getLastProfit()

getTotalProfits

public float getTotalProfits()

getCurrentValuation

public float getCurrentValuation()

getId

public long getId()

getRole

public java.lang.String getRole()

getLastShoutPrice

public float getLastShoutPrice()

getAgentType

public java.lang.Object getAgentType()

getLastShoutAccepted

public boolean getLastShoutAccepted()

getLearningDelta

public float getLearningDelta()