market
Class Market

java.lang.Object
  extended by market.Market

public class Market
extends java.lang.Object

Author:
tratch

Constructor Summary
Market(Good good, Currency currency, java.util.ArrayList<Participant> pParticipantArray)
           
 
Method Summary
 void clearTransactions()
          Clears all transactions registered.
 Currency getMarketCurrency()
           
 Good getMarketGood()
           
 java.lang.String getMarketName()
           
 double getMarketPriceCap()
           
 double getMarketQtyCap()
           
 java.util.ArrayList<Participant> getParticipants()
           
 java.util.ArrayList<Transaction> getTransactions()
           
 org.jfree.data.xy.XYSeries getTransactionSeries()
           
 void graphSupplyAndDemand()
          Displays on screen the supply and demand for the good traded in this market by the participants
 void graphTransactions()
          Displays on screen the transactions made between the market participants for the market good.
 void incrementPeriod()
          Increments the period variable by 1.
 void registerTrasaction(Transaction deal, double time)
          Registers the transaction in the market and records the price for which it was traded as well as the relative time.
 void setMarketCurrency(Currency marketCurrency)
           
 void setMarketName(java.lang.String marketName)
           
 void setMarketPriceCap(double marketPriceCap)
           
 void setMarketQtyCap(double marketQuantityCap)
           
 void setParticipants(java.util.ArrayList<Participant> pArrayList)
           
 void supplyAndDemandToFile(java.lang.String path)
          Outputs to file the supply and demand for the good traded in this market by the participants.
 void transactionsToFile(java.lang.String path)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Market

public Market(Good good,
              Currency currency,
              java.util.ArrayList<Participant> pParticipantArray)
Parameters:
good -
currency -
pParticipantArray -
Method Detail

clearTransactions

public void clearTransactions()
Clears all transactions registered.


getMarketCurrency

public Currency getMarketCurrency()
Returns:
The currency used in this market

getMarketGood

public Good getMarketGood()
Returns:
The market good

getMarketName

public java.lang.String getMarketName()
Returns:
The name of the market

getMarketPriceCap

public double getMarketPriceCap()
Returns:
the price cap imposed on the market

getMarketQtyCap

public double getMarketQtyCap()
Returns:
the maximum quantity a participant can trade at a time

graphSupplyAndDemand

public void graphSupplyAndDemand()
Displays on screen the supply and demand for the good traded in this market by the participants


supplyAndDemandToFile

public void supplyAndDemandToFile(java.lang.String path)
Outputs to file the supply and demand for the good traded in this market by the participants.

Parameters:
path -

graphTransactions

public void graphTransactions()
Displays on screen the transactions made between the market participants for the market good.


transactionsToFile

public void transactionsToFile(java.lang.String path)

registerTrasaction

public void registerTrasaction(Transaction deal,
                               double time)
Registers the transaction in the market and records the price for which it was traded as well as the relative time.

Parameters:
deal -
time -

setMarketCurrency

public void setMarketCurrency(Currency marketCurrency)
Parameters:
marketCurrency -

setMarketName

public void setMarketName(java.lang.String marketName)
Parameters:
marketName -

setMarketPriceCap

public void setMarketPriceCap(double marketPriceCap)
Parameters:
marketPriceCap -

setMarketQtyCap

public void setMarketQtyCap(double marketQuantityCap)
Parameters:
marketQuantityCap -

getParticipants

public java.util.ArrayList<Participant> getParticipants()
Returns:
An arraylist of the participants

setParticipants

public void setParticipants(java.util.ArrayList<Participant> pArrayList)
Parameters:
pArrayList -

incrementPeriod

public void incrementPeriod()
Increments the period variable by 1.


getTransactionSeries

public org.jfree.data.xy.XYSeries getTransactionSeries()
Returns:
transactionSeries

getTransactions

public java.util.ArrayList<Transaction> getTransactions()
Returns:
An arraylist of all transactions made so far