eos.market
Class ConsumerGoodMarket

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

public class ConsumerGoodMarket
extends Market

A market trading consumer goods.


Field Summary
 
Fields inherited from class eos.market.Market
good
 
Constructor Summary
ConsumerGoodMarket(java.lang.String good)
          Create a new consumer good market trading a good named good the price is not initialized at construction, but should be calculated the first time through
 
Method Summary
 void addBuyOffer(Agent buyer, double qty)
          Add a buy offer, now simplified as demand in dollars replaces zhihongx's implementation of demand as a function
 void addSellOffer(Agent seller, double qty)
          Add a sell offer
 void clear()
          Clear the market.
static double getLastMktDemand()
          Return last total demand, in dollars
 double getLastMktGoodVol()
          Return volume of good traded
 double getLastMktMoneyVol()
          Return volume of money exchanged
static double getLastMktPrice()
          Return market price
static double getLastMktSupply()
          Return last total supply, in units of CG
static double getSmoothedLastMktDemand()
          Return smoothed total demand, in dollars
static double getSmoothedLastMktSupply()
          Return smoothed total supply, in units of CG
 
Methods inherited from class eos.market.Market
getGood
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ConsumerGoodMarket

public ConsumerGoodMarket(java.lang.String good)
Create a new consumer good market trading a good named good the price is not initialized at construction, but should be calculated the first time through

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

addBuyOffer

public void addBuyOffer(Agent buyer,
                        double qty)
Add a buy offer, now simplified as demand in dollars replaces zhihongx's implementation of demand as a function

Parameters:
buyer -

qty -

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 static double getLastMktPrice()
Return market price

Returns:
market price static is necessary here if ConsumerGoodMarket is referenced specifically instead of an instance of type ConsumerGoodMarket; simplify this later

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 static double getLastMktSupply()
Return last total supply, in units of CG

Returns:
last total supply, in units of CG

getLastMktDemand

public static double getLastMktDemand()
Return last total demand, in dollars

Returns:
last total demand, in dollars

getSmoothedLastMktDemand

public static double getSmoothedLastMktDemand()
Return smoothed total demand, in dollars

Returns:
smothed total demand, in dollars

getSmoothedLastMktSupply

public static double getSmoothedLastMktSupply()
Return smoothed total supply, in units of CG

Returns:
smothed total supply, in units of CG