org.mars_sim.msp.simulation.resource
Class Part

java.lang.Object
  extended by org.mars_sim.msp.simulation.resource.ItemResource
      extended by org.mars_sim.msp.simulation.resource.Part
All Implemented Interfaces:
java.io.Serializable, Resource

public class Part
extends ItemResource

The Part class represents a type of unit resource that is used for maintenance and repairs.

See Also:
Serialized Form

Constructor Summary
Part(java.lang.String name, double mass)
          Constructor.
 
Method Summary
 int getMaintenanceMaximumNumber(java.lang.String entityName)
          Gets the maximum number of this part needed by a maintenance entity.
 int getMaintenanceProbability(java.lang.String entityName)
          Gets the percentage probability of a part being needed by an maintenance entity.
static java.util.Set<Part> getParts()
          Gets a set of all parts.
 boolean hasMaintenanceEntity(java.lang.String entityName)
          Checks if the part has a maintenance entity of a given name.
 
Methods inherited from class org.mars_sim.msp.simulation.resource.ItemResource
equals, findItemResource, getItemResources, getMassPerItem, getName, getTestResourceHammer, getTestResourcePipeWrench, getTestResourceSocketWrench, hashCode, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Part

public Part(java.lang.String name,
            double mass)
Constructor.

Parameters:
name - the name of the part.
mass - the mass of the part (kg)
Method Detail

hasMaintenanceEntity

public boolean hasMaintenanceEntity(java.lang.String entityName)
Checks if the part has a maintenance entity of a given name.

Parameters:
entityName - the name of the entity.
Returns:
true if part has the maintenance entity.

getMaintenanceProbability

public int getMaintenanceProbability(java.lang.String entityName)
Gets the percentage probability of a part being needed by an maintenance entity.

Parameters:
entityName - the name of the entity.
Returns:
percentage probability (0 - 100)

getMaintenanceMaximumNumber

public int getMaintenanceMaximumNumber(java.lang.String entityName)
Gets the maximum number of this part needed by a maintenance entity.

Parameters:
entityName - the name of the entity.
Returns:
maximum number of parts.

getParts

public static final java.util.Set<Part> getParts()
Gets a set of all parts.

Returns:
set of parts.