eos.good
Class Capital

java.lang.Object
  extended by eos.good.Good
      extended by eos.good.Capital

public class Capital
extends Good

Capital stock


Field Summary
 
Fields inherited from class eos.good.Good
quantity
 
Constructor Summary
Capital(int quantity, int ownerID, CFirm[] producers)
          Create a new capital stock initialized with quantity of machines.
 
Method Summary
 void add(int qty, double price, int life, CFirm producer)
          Add qty of machines produced by producer to the LinkedHashSet of machines, with a total price of price, exclusive of interest, and a usable lifetime of life number of steps
 int getScrapped()
          return number of machines scrapped this step
 double useCapital()
          Use the machines.
 
Methods inherited from class eos.good.Good
decrease, getName, getQuantity, increase
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Capital

public Capital(int quantity,
               int ownerID,
               CFirm[] producers)
Create a new capital stock initialized with quantity of machines.

Parameters:
quantity - initial quantity of machines
ownerID - ID of the owner
producers - array of all CFirms
Method Detail

add

public void add(int qty,
                double price,
                int life,
                CFirm producer)
Add qty of machines produced by producer to the LinkedHashSet of machines, with a total price of price, exclusive of interest, and a usable lifetime of life number of steps

Parameters:
qty - quantity of machines to add
price - per-step price of one machine
life - max number of steps the machines can be used for
producer - CFirm that produces these machines

getScrapped

public int getScrapped()
return number of machines scrapped this step


useCapital

public double useCapital()
Use the machines. Pay for the machines, the per-step installment

Returns:
cost this step of machines used this is total of mortgage payments scrap expired machines