org.mars_sim.msp.simulation.structure.building.function
Class Research

java.lang.Object
  extended by org.mars_sim.msp.simulation.structure.building.function.Function
      extended by org.mars_sim.msp.simulation.structure.building.function.Research
All Implemented Interfaces:
java.io.Serializable, Lab

public class Research
extends Function
implements Lab, java.io.Serializable

The Resource class is a building function for research.

See Also:
Serialized Form

Field Summary
static java.lang.String NAME
           
 
Constructor Summary
Research(Building building)
          Constructor
 
Method Summary
 void addResearcher()
          Adds a researcher to the laboratory.
 double getFullPowerRequired()
          Gets the amount of power required when function is at full power.
 int getLaboratorySize()
          Gets the number of researchers who can use the laboratory at once.
 double getPowerDownPowerRequired()
          Gets the amount of power required when function is at power down level.
 int getResearcherNum()
          Gets the number of people currently researching in the laboratory.
 int getTechnologyLevel()
          Gets the research tech level of this building.
 java.lang.String[] getTechSpecialities()
          Gets an array of the building's research tech specialities.
 boolean hasSpeciality(java.lang.String speciality)
          Checks to see if the laboratory has a given tech speciality.
 void removeResearcher()
          Removes a researcher from the laboratory.
 void timePassing(double time)
          Time passing for the building.
 
Methods inherited from class org.mars_sim.msp.simulation.structure.building.function.Function
getBuilding, getName
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NAME

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

Research

public Research(Building building)
         throws BuildingException
Constructor

Parameters:
building - the building this function is for.
Throws:
BuildingException - if function could not be constructed.
Method Detail

getTechnologyLevel

public int getTechnologyLevel()
Gets the research tech level of this building.

Specified by:
getTechnologyLevel in interface Lab
Returns:
tech level

getLaboratorySize

public int getLaboratorySize()
Gets the number of researchers who can use the laboratory at once.

Specified by:
getLaboratorySize in interface Lab
Returns:
capacity

getTechSpecialities

public java.lang.String[] getTechSpecialities()
Gets an array of the building's research tech specialities.

Specified by:
getTechSpecialities in interface Lab
Returns:
array of specialities as strings.

hasSpeciality

public boolean hasSpeciality(java.lang.String speciality)
Checks to see if the laboratory has a given tech speciality.

Specified by:
hasSpeciality in interface Lab
Returns:
true if lab has tech speciality

getResearcherNum

public int getResearcherNum()
Gets the number of people currently researching in the laboratory.

Specified by:
getResearcherNum in interface Lab
Returns:
number of researchers

addResearcher

public void addResearcher()
                   throws java.lang.Exception
Adds a researcher to the laboratory.

Specified by:
addResearcher in interface Lab
Throws:
java.lang.Exception - if person cannot be added.

removeResearcher

public void removeResearcher()
                      throws java.lang.Exception
Removes a researcher from the laboratory.

Specified by:
removeResearcher in interface Lab
Throws:
java.lang.Exception - if person cannot be removed.

timePassing

public void timePassing(double time)
                 throws BuildingException
Time passing for the building.

Specified by:
timePassing in class Function
Parameters:
time - amount of time passing (in millisols)
Throws:
BuildingException - if error occurs.

getFullPowerRequired

public double getFullPowerRequired()
Gets the amount of power required when function is at full power.

Specified by:
getFullPowerRequired in class Function
Returns:
power (kW)

getPowerDownPowerRequired

public double getPowerDownPowerRequired()
Gets the amount of power required when function is at power down level.

Specified by:
getPowerDownPowerRequired in class Function
Returns:
power (kW)