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

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

public class Cooking
extends Function
implements java.io.Serializable

The Cooking class is a building function for cooking meals.

See Also:
Serialized Form

Field Summary
static double COOKED_MEAL_WORK_REQUIRED
           
static java.lang.String NAME
           
 
Constructor Summary
Cooking(Building building)
          Constructor
 
Method Summary
 void addWork(double workTime)
          Adds cooking work to this facility.
 void cleanup()
          Cleanup kitchen after mealtime.
 int getBestCookSkill()
          Gets the skill level of the best cook using this facility.
 int getBestMealQuality()
          Gets the quality of the best quality meal at the facility.
 int getCookCapacity()
          Get the maximum number of cooks supported by this facility.
 CookedMeal getCookedMeal()
          Gets a cooked meal from this facility.
 double getFullPowerRequired()
          Gets the amount of power required when function is at full power.
 int getNumberOfCookedMeals()
          Gets the number of cooked meals in this facility.
 int getNumCooks()
          Get the current number of cooks using this facility.
 double getPowerDownPowerRequired()
          Gets the amount of power required when function is at power down level.
 boolean hasCookedMeal()
          Checks if there are any cooked meals in this facility.
 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

COOKED_MEAL_WORK_REQUIRED

public static final double COOKED_MEAL_WORK_REQUIRED
See Also:
Constant Field Values
Constructor Detail

Cooking

public Cooking(Building building)
        throws BuildingException
Constructor

Parameters:
building - the building this function is for.
Throws:
BuildingException - if error in constructing function.
Method Detail

getCookCapacity

public int getCookCapacity()
Get the maximum number of cooks supported by this facility.

Returns:
max number of cooks

getNumCooks

public int getNumCooks()
Get the current number of cooks using this facility.

Returns:
number of cooks

getBestCookSkill

public int getBestCookSkill()
Gets the skill level of the best cook using this facility.

Returns:
skill level.

hasCookedMeal

public boolean hasCookedMeal()
Checks if there are any cooked meals in this facility.

Returns:
true if cooked meals

getNumberOfCookedMeals

public int getNumberOfCookedMeals()
Gets the number of cooked meals in this facility.

Returns:
number of meals

getCookedMeal

public CookedMeal getCookedMeal()
Gets a cooked meal from this facility.

Returns:
the meal

getBestMealQuality

public int getBestMealQuality()
Gets the quality of the best quality meal at the facility.

Returns:
quality

cleanup

public void cleanup()
Cleanup kitchen after mealtime.


addWork

public void addWork(double workTime)
             throws BuildingException
Adds cooking work to this facility. The amount of work is dependent upon the person's cooking skill.

Parameters:
workTime - work time (millisols)
Throws:
BuildingException

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)