eos.economy
Class Economy

Object
  extended by eos.economy.Economy

public class Economy
extends Object

Economy provides a container to hold all agents and markets together.

Author:
zhihongx

Field Summary
static int INFLATION_TIME_WIN
          time window within which average inflation is computed
 
Constructor Summary
Economy()
           
 
Method Summary
static void addAgent(Agent agent)
          Add agent to the economy
static void addMarket(Market market)
          Add market to the economy
static void addPrinter(Printer printer)
          Add printer
static void cleanUpPrinters()
          clean up printers
static java.util.Collection<Agent> getAgents()
          Return agents who are still alive
static double getInflation()
          Return the average inflation within INFLATION_TIME_WIN
static Market getMarket(String good)
          Return market corresponding to good
static int getTimeStep()
          Return the current time step
static void run(int steps)
          Run simulation for steps number of steps
static void step()
          Run simulation for one step
 
Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

INFLATION_TIME_WIN

public static final int INFLATION_TIME_WIN
time window within which average inflation is computed

See Also:
Constant Field Values
Constructor Detail

Economy

public Economy()
Method Detail

getMarket

public static Market getMarket(String good)
Return market corresponding to good

Parameters:
good - name of a good
Returns:
market corresponding to good

run

public static void run(int steps)
Run simulation for steps number of steps

Parameters:
steps -

getTimeStep

public static int getTimeStep()
Return the current time step

Returns:
the current time step

step

public static void step()
Run simulation for one step


getInflation

public static double getInflation()
Return the average inflation within INFLATION_TIME_WIN

Returns:
the average inflation within INFLATION_TIME_WIN

getAgents

public static java.util.Collection<Agent> getAgents()
Return agents who are still alive

Returns:
agents who are still alive

addMarket

public static void addMarket(Market market)
Add market to the economy

Parameters:
market -

addAgent

public static void addAgent(Agent agent)
Add agent to the economy

Parameters:
agent -

addPrinter

public static void addPrinter(Printer printer)
Add printer

Parameters:
printer -

cleanUpPrinters

public static void cleanUpPrinters()
clean up printers