EventSequencing  
  red indicates value from previous step
  blue indicates value may have been been changed this step 
  green indicates caution!
------------------------------------------------------------
Simulation
    |
Economy.run
    |
Economy.step
    |
  Agent.act()
    CapitalFirm.act() 
      Determine capacity (essentially infinite)
      Determine capitalPrice, price charged for capital, based on smoothedAvgWage
      post sell offer for capital at that price
      post buy offer to labor market, using entire acct.balance as wageBudget 

    CGFirm.act()
      call capital.useCapital to make mortgage payments on owned machines, or buy new machine
        mortgage payments include principal and interest
        new machines will be added when the capital market is cleared
        capital.useCapital returns capitalCost (principal and interest)
        capital.useCapital orders Bank to pay CFirm
        [FIX: THIS CAN CHANGE ACCOUNT BALANCE OF CapitalFirm AFTER BUY-LABOR OFFER!]
      set newWageBudget = acct.balance 
      determine production capacity from capital and labor
        -the latter was hired when the labor market cleared previous step
      post sell offer for capacity to CG market
      post buy offer to labor market in the amount newWageBudget
      decide whether to buy new capital, using criterion 
        capitalCost < (1/(n*r))*(1 - 1/Math.pow(1+r,n))*(1. - beta)*acct.smoothedRevenue
        - the last was recorded and updated previous step when CGMarket cleared
      post offer to buy capital if new capital is desired

    Laborer.act()
      split bank balance between consumption and savings, based on IR
      post buy offer to CGMarket
      post sell offer to labor market 

  Market.clear()
    CapitalMarket.clear()     
      determine capitalPrice, using smoothedAvgWage
      allocate capital to buyers, who are the CGFirms

    ConsumerGoodMarket.clear()
      set price based on supply and demand to clear market
      distribute goods, order Bank to transfer payments from buyers to sellers
      [FIX: THIS CAN CHANGE ACCOUNT BALANCE OF Laborer 
        OR ConsumerGoodFirm AFTER BUY- OR SELL-OFFER!]

    LaborMarket.clear()
      for each employer, determine wage and distribute its wage budget over its employees,
        ordering Bank to make payment transfers from CGFirms to Laborers

  Dump data to file, plot

  Bank.act() 
    determine demandForCapital from previous clearing of capital market
    determine supplyOfLoans = total bank reserve - M0, 
      where M0 is total cash supply (fixed)
    adjust IR by delta ~ demandForCapital - supplyOfLoans    
    pay and collect interest on all accts (not including mortgages)

  update smoothedAvgWage, smoothedCPI, smoothedIR, and all other data and smoothed data

  timeStep++