org.mars_sim.msp.core.structure.construction
Class ConstructionValues

java.lang.Object
  extended by org.mars_sim.msp.core.structure.construction.ConstructionValues
All Implemented Interfaces:
java.io.Serializable

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

Provides value information for construction.

See Also:
Serialized Form

Method Summary
 void clearCache()
          Clears the value caches.
 double getAllConstructionSitesProfit(int constructionSkill)
          Gets the overall profit of all existing construction sites at a settlement that can be worked on with a given construction skill.
 java.util.Map<ConstructionStageInfo,java.lang.Double> getAllConstructionStageValues()
          Gets a map of all construction stage infos and their values.
 double getConstructionSiteProfit(ConstructionSite site)
          Gets the profit of an existing construction site at a settlement.
 double getConstructionSiteProfit(ConstructionSite site, int constructionSkill)
          Gets the profit of an existing construction site at a settlement.
 java.util.Map<ConstructionStageInfo,java.lang.Double> getConstructionStageProfit(java.lang.String stageType, int constructionSkill, boolean checkMaterials)
          Gets a map of construction stage infos and their profits for a given stage type.
 double getNewConstructionSiteProfit(int constructionSkill)
          Gets the profit of creating a new construction site at a settlement.
 java.util.Map<ConstructionStageInfo,java.lang.Double> getNewConstructionStageProfits(ConstructionSite site, int constructionSkill)
          Gets a map of construction stage infos and their profits for a particular construction site.
 double getSettlementConstructionProfit()
          Gets the overall profit for construction at the settlement.
 double getSettlementConstructionProfit(int constructionSkill)
          Gets the overall profit for construction at the settlement.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getSettlementConstructionProfit

public double getSettlementConstructionProfit()
                                       throws java.lang.Exception
Gets the overall profit for construction at the settlement.

Returns:
profit (VP)
Throws:
java.lang.Exception - if error determining profit.

getSettlementConstructionProfit

public double getSettlementConstructionProfit(int constructionSkill)
                                       throws java.lang.Exception
Gets the overall profit for construction at the settlement.

Parameters:
constructionSkill - the architect's construction skill.
Returns:
profit (VP)
Throws:
java.lang.Exception - if error determining profit.

getAllConstructionSitesProfit

public double getAllConstructionSitesProfit(int constructionSkill)
                                     throws java.lang.Exception
Gets the overall profit of all existing construction sites at a settlement that can be worked on with a given construction skill.

Parameters:
constructionSkill - the architect's construction skill.
Returns:
profit (VP)
Throws:
java.lang.Exception - if error determining profit.

getConstructionSiteProfit

public double getConstructionSiteProfit(ConstructionSite site)
                                 throws java.lang.Exception
Gets the profit of an existing construction site at a settlement.

Parameters:
site - the construction site.
Returns:
profit (VP)
Throws:
java.lang.Exception - if error determining profit.

getConstructionSiteProfit

public double getConstructionSiteProfit(ConstructionSite site,
                                        int constructionSkill)
                                 throws java.lang.Exception
Gets the profit of an existing construction site at a settlement.

Parameters:
site - the construction site.
constructionSkill - the architect's construction skill.
Returns:
profit (VP)
Throws:
java.lang.Exception - if error determining profit.

getNewConstructionSiteProfit

public double getNewConstructionSiteProfit(int constructionSkill)
                                    throws java.lang.Exception
Gets the profit of creating a new construction site at a settlement.

Parameters:
constructionSkill - the architect's construction skill.
Returns:
profit (VP)
Throws:
java.lang.Exception - if error determining profit.

getNewConstructionStageProfits

public java.util.Map<ConstructionStageInfo,java.lang.Double> getNewConstructionStageProfits(ConstructionSite site,
                                                                                            int constructionSkill)
                                                                                     throws java.lang.Exception
Gets a map of construction stage infos and their profits for a particular construction site.

Parameters:
site - the construction site.
constructionSkill - the architect's construction skill.
Returns:
map of construction stage infos and their profits (VP).
Throws:
java.lang.Exception - if error determining profit.

getConstructionStageProfit

public java.util.Map<ConstructionStageInfo,java.lang.Double> getConstructionStageProfit(java.lang.String stageType,
                                                                                        int constructionSkill,
                                                                                        boolean checkMaterials)
                                                                                 throws java.lang.Exception
Gets a map of construction stage infos and their profits for a given stage type.

Parameters:
stageType - the construction stage type.
constructionSkill - the architect's construction skill.
checkMaterials - should check if settlement has enough construction materials?
Returns:
map of construction stage infos and their profits (VP).
Throws:
java.lang.Exception - if error determining profit.

getAllConstructionStageValues

public java.util.Map<ConstructionStageInfo,java.lang.Double> getAllConstructionStageValues()
                                                                                    throws java.lang.Exception
Gets a map of all construction stage infos and their values.

Returns:
map of construction stage infos and their values (VP).
Throws:
java.lang.Exception - if error determining value.

clearCache

public void clearCache()
Clears the value caches.