eos.agent.laborer
Class Laborer

Object
  extended by eos.agent.Agent
      extended by eos.agent.laborer.Laborer

public class Laborer
extends Agent

Laborer

Author:
zhihongx

Constructor Summary
Laborer(double initEQty, double initNQty, double initCheckingBal, double initSavingsBal, double initSavingsRate)
          Create a new laborer
 
Method Summary
 void act()
          Called by Economy.step() in each step.
 double getConsumption()
          Return consumption (in $)
 double getEConsumption()
          Return consumption of enjoyment
 Good getGood(String goodName)
          Return a reference to the good with name goodName
 double getIncome()
          Return total income in the last step
 double getNConsumption()
          Return consumption of necessity (in $)
 double getSavings()
          Return savings
 double getSavingsRate()
          Return savings rate
 double getWage()
          Return wage in the last step
 
Methods inherited from class eos.agent.Agent
die, getID, getName, isAlive
 
Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Laborer

public Laborer(double initEQty,
               double initNQty,
               double initCheckingBal,
               double initSavingsBal,
               double initSavingsRate)
Create a new laborer

Parameters:
initEQty - initial enjoyment quantity
initNQty - initial necessity quantity
initCheckingBal - initial checking account balance
initSavingsBal - initial savings account balance
initSavingsRate - initial savings rate
Method Detail

act

public void act()
Called by Economy.step() in each step.

Specified by:
act in class Agent

getGood

public Good getGood(String goodName)
Return a reference to the good with name goodName

Specified by:
getGood in class Agent
Returns:
a reference to a good given goodName

getWage

public double getWage()
Return wage in the last step

Returns:
wage in the last step

getIncome

public double getIncome()
Return total income in the last step

Returns:
total income in the last step

getConsumption

public double getConsumption()
Return consumption (in $)

Returns:
consumption (in $)

getSavings

public double getSavings()
Return savings

Returns:
savings

getSavingsRate

public double getSavingsRate()
Return savings rate

Returns:
savings rate

getNConsumption

public double getNConsumption()
Return consumption of necessity (in $)

Returns:
consumption of necessity

getEConsumption

public double getEConsumption()
Return consumption of enjoyment

Returns:
consumption of enjoyment