org.mars_sim.msp.simulation.structure.goods
Class GoodsManager

java.lang.Object
  extended by org.mars_sim.msp.simulation.structure.goods.GoodsManager
All Implemented Interfaces:
java.io.Serializable

public class GoodsManager
extends java.lang.Object
implements java.io.Serializable

A manager for goods values at a settlement.

See Also:
Serialized Form

Field Summary
static java.lang.String GOODS_VALUE_EVENT
           
 
Constructor Summary
GoodsManager(Settlement settlement)
          Constructor
 
Method Summary
 double getAmountOfGoodForSettlement(Good good)
          Gets the amount of a good at the settlement.
 double getGoodValuePerItem(Good good)
          Gets the value per item of a good.
 double getGoodValuePerItem(Good good, double supply)
           
 double getGoodValuePerMass(Good good)
          Gets the value per mass of a good.
 double getGoodValuePerMass(Good good, double supply)
           
 double getNumberOfGoodForSettlement(Good good)
          Gets the number of a good at the settlement.
 void timePassing(double time)
          Time passing
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

GOODS_VALUE_EVENT

public static final java.lang.String GOODS_VALUE_EVENT
See Also:
Constant Field Values
Constructor Detail

GoodsManager

public GoodsManager(Settlement settlement)
             throws java.lang.Exception
Constructor

Parameters:
settlement - the settlement this manager is for.
Throws:
java.lang.Exception - if errors constructing instance.
Method Detail

getGoodValuePerMass

public double getGoodValuePerMass(Good good)
Gets the value per mass of a good.

Parameters:
good - the good to check value for.
Returns:
the value per mass (value points / kg).

getGoodValuePerMass

public double getGoodValuePerMass(Good good,
                                  double supply)
                           throws java.lang.Exception
Throws:
java.lang.Exception

getGoodValuePerItem

public double getGoodValuePerItem(Good good)
                           throws java.lang.Exception
Gets the value per item of a good.

Parameters:
good - the good to check.
Returns:
value (VP)
Throws:
java.lang.Exception - if error getting value.

getGoodValuePerItem

public double getGoodValuePerItem(Good good,
                                  double supply)
                           throws java.lang.Exception
Throws:
java.lang.Exception

timePassing

public void timePassing(double time)
                 throws java.lang.Exception
Time passing

Parameters:
time - the amount of time passing (millisols).
Throws:
java.lang.Exception - if error during time.

getNumberOfGoodForSettlement

public double getNumberOfGoodForSettlement(Good good)
                                    throws InventoryException
Gets the number of a good at the settlement.

Parameters:
good - the good to check.
Returns:
the number of the good (or amount (kg) if amount resource good).
Throws:
InventoryException - if error determining the number of the good.

getAmountOfGoodForSettlement

public double getAmountOfGoodForSettlement(Good good)
                                    throws java.lang.Exception
Gets the amount of a good at the settlement.

Parameters:
good - the good to check.
Returns:
the amount (kg) of the good at the settlement.
Throws:
java.lang.Exception - if error determining amount of the good.