eos.market
Class CapitalMarket

Object
  extended by eos.market.Market
      extended by eos.market.CapitalMarket

public class CapitalMarket
extends Market

A market trading capital good

Author:
zhihongx

Field Summary
 
Fields inherited from class eos.market.Market
good
 
Constructor Summary
CapitalMarket()
          Create a new capital market
 
Method Summary
 void addBuyOffer(Capital capital, int qty)
          Add a buy offer
 void addSellOffer(CFirm seller, double price, int capacity)
          Add a sell offer
 void clear()
          Clear the market
 double getAvgPrice()
          Return average price of sell offers posted
 double getLastMktGoodVol()
          Return volume of capital good traded
 
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

CapitalMarket

public CapitalMarket()
Create a new capital market

Method Detail

addBuyOffer

public void addBuyOffer(Capital capital,
                        int qty)
Add a buy offer

Parameters:
capital - a reference to the capital stock owned by the buyer

qty - quantity of machines to buy

addSellOffer

public void addSellOffer(CFirm seller,
                         double price,
                         int capacity)
Add a sell offer

Parameters:
seller -

price - per-step price of each unit

capacity - max quantity of capital available for sale

clear

public void clear()
Clear the market

Specified by:
clear in class Market

getAvgPrice

public double getAvgPrice()
Return average price of sell offers posted

Returns:
average price of sell offers posted

getLastMktGoodVol

public double getLastMktGoodVol()
Return volume of capital good traded

Returns:
volume of capital good traded