eos.market
Class ConsumerGoodMarket

Object
  extended by eos.market.Market
      extended by eos.market.ConsumerGoodMarket

public class ConsumerGoodMarket
extends Market

A market trading consumer goods.

Author:
zhihongx

Field Summary
 
Fields inherited from class eos.market.Market
good
 
Constructor Summary
ConsumerGoodMarket(String good, double initLow, double initHigh)
          Create a new consumer good market trading a good named good
 
Method Summary
 void addBuyOffer(Agent buyer, Demand demand)
          Add a buy offer
 void addSellOffer(Agent seller, double qty)
          Add a sell offer
 void clear()
          Clear the market.
 double getLastMktGoodVol()
          Return volume of good traded
 double getLastMktMoneyVol()
          Return volume of money exchanged
 double getLastMktPrice()
          Return market price
 double getLastMktSupply()
          Return total supply
 
Methods inherited from class eos.market.Market
getGood
 
Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ConsumerGoodMarket

public ConsumerGoodMarket(String good,
                          double initLow,
                          double initHigh)
Create a new consumer good market trading a good named good

Parameters:
good - name of the good traded in the market

initLow - min initial price

initHigh - max initial price
Method Detail

addBuyOffer

public void addBuyOffer(Agent buyer,
                        Demand demand)
Add a buy offer

Parameters:
buyer -

demand -

addSellOffer

public void addSellOffer(Agent seller,
                         double qty)
Add a sell offer

Parameters:
seller -

qty - quantity of good available for sale

clear

public void clear()
Clear the market.

Specified by:
clear in class Market

getLastMktPrice

public double getLastMktPrice()
Return market price

Returns:
market price

getLastMktGoodVol

public double getLastMktGoodVol()
Return volume of good traded

Returns:
volume of good traded

getLastMktMoneyVol

public double getLastMktMoneyVol()
Return volume of money exchanged

Returns:
volume of money exchanged

getLastMktSupply

public double getLastMktSupply()
Return total supply

Returns:
total supply