org.mars_sim.msp.simulation.manufacture
Class ManufactureUtil

java.lang.Object
  extended by org.mars_sim.msp.simulation.manufacture.ManufactureUtil

public final class ManufactureUtil
extends java.lang.Object

Utility class for getting manufacturing processes.


Method Summary
static boolean canProcessBeStarted(ManufactureProcessInfo process, Manufacture workshop)
          Checks to see if a manufacturing process can be started at a given manufacturing building.
static boolean doesSettlementHaveManufacturing(Settlement settlement)
          Checks if settlement has buildings with manufacture function.
static java.util.List<ManufactureProcessInfo> getAllManufactureProcesses()
          Gets all manufacturing processes.
static int getHighestManufacturingTechLevel(Settlement settlement)
          Gets the highest manufacturing tech level in a settlement.
static java.util.List<ManufactureProcessInfo> getManufactureProcessesForTechLevel(int techLevel)
          Gets manufacturing processes within the capability of a tech level.
static java.util.List<ManufactureProcessInfo> getManufactureProcessesForTechSkillLevel(int techLevel, int skillLevel)
          Gets manufacturing processes within the capability of a tech level and a skill level.
static double getManufactureProcessItemValue(ManufactureProcessItem item, Settlement settlement)
          Gets the good value of a manufacturing process item for a settlement.
static double getManufactureProcessValue(ManufactureProcessInfo process, Settlement settlement)
          Gets the goods value of a manufacturing process at a settlement.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getAllManufactureProcesses

public static final java.util.List<ManufactureProcessInfo> getAllManufactureProcesses()
                                                                               throws java.lang.Exception
Gets all manufacturing processes.

Returns:
list of processes.
Throws:
java.lang.Exception - if error getting processes.

getManufactureProcessesForTechLevel

public static final java.util.List<ManufactureProcessInfo> getManufactureProcessesForTechLevel(int techLevel)
                                                                                        throws java.lang.Exception
Gets manufacturing processes within the capability of a tech level.

Parameters:
techLevel - the tech level.
Returns:
list of processes.
Throws:
java.lang.Exception - if error getting processes.

getManufactureProcessesForTechSkillLevel

public static final java.util.List<ManufactureProcessInfo> getManufactureProcessesForTechSkillLevel(int techLevel,
                                                                                                    int skillLevel)
                                                                                             throws java.lang.Exception
Gets manufacturing processes within the capability of a tech level and a skill level.

Parameters:
techLevel - the tech level.
skillLevel - the skill level.
Returns:
list of processes.
Throws:
java.lang.Exception - if error getting processes.

getManufactureProcessValue

public static final double getManufactureProcessValue(ManufactureProcessInfo process,
                                                      Settlement settlement)
                                               throws java.lang.Exception
Gets the goods value of a manufacturing process at a settlement.

Parameters:
process - the manufacturing process.
settlement - the settlement.
Returns:
goods value of output goods minus input goods.
Throws:
java.lang.Exception - if error determining good values.

getManufactureProcessItemValue

public static final double getManufactureProcessItemValue(ManufactureProcessItem item,
                                                          Settlement settlement)
                                                   throws java.lang.Exception
Gets the good value of a manufacturing process item for a settlement.

Parameters:
item - the manufacturing process item.
settlement - the settlement.
Returns:
good value.
Throws:
java.lang.Exception - if error getting good value.

canProcessBeStarted

public static final boolean canProcessBeStarted(ManufactureProcessInfo process,
                                                Manufacture workshop)
                                         throws java.lang.Exception
Checks to see if a manufacturing process can be started at a given manufacturing building.

Parameters:
process - the manufacturing process to start.
workshop - the manufacturing building.
Returns:
true if process can be started.
Throws:
java.lang.Exception - if error determining if process can be started.

doesSettlementHaveManufacturing

public static final boolean doesSettlementHaveManufacturing(Settlement settlement)
                                                     throws BuildingException
Checks if settlement has buildings with manufacture function.

Parameters:
settlement - the settlement.
Returns:
true if buildings with manufacture function.
Throws:
BuildingException - if error checking for manufacturing buildings.

getHighestManufacturingTechLevel

public static final int getHighestManufacturingTechLevel(Settlement settlement)
                                                  throws BuildingException
Gets the highest manufacturing tech level in a settlement.

Parameters:
settlement - the settlement.
Returns:
highest manufacturing tech level.
Throws:
BuildingException - if error determining highest tech level.