org.mars_sim.msp.simulation.person.ai.task
Class ResearchScience

java.lang.Object
  extended by org.mars_sim.msp.simulation.person.ai.task.Task
      extended by org.mars_sim.msp.simulation.person.ai.task.ResearchScience
All Implemented Interfaces:
java.io.Serializable, java.lang.Comparable
Direct Known Subclasses:
ResearchAreology, ResearchBotany, ResearchMaterialsScience, ResearchMedicine

public abstract class ResearchScience
extends Task
implements java.io.Serializable

The ResearchScience class is an abstract task for scientific research.

See Also:
Serialized Form

Field Summary
 
Fields inherited from class org.mars_sim.msp.simulation.person.ai.task.Task
effortDriven, hasDuration, person, phaseTimeCompleted, phaseTimeRequired, stressModifier, subTask, TASK_DESC_EVENT, TASK_ENDED_EVENT, TASK_NAME_EVENT, TASK_PHASE_EVENT, TASK_SUBTASK_EVENT
 
Constructor Summary
ResearchScience(java.lang.String science, Person person)
          Constructor
 
Method Summary
protected  void addExperience(double time)
          Adds experience to the person's skills used in this task.
 void endTask()
          Ends the task and performs any final actions.
 java.util.List<java.lang.String> getAssociatedSkills()
          Gets a list of the skills associated with this task.
 int getEffectiveSkillLevel()
          Gets the effective skill level a person has at this task.
protected static Lab getLocalLab(Person person, java.lang.String science)
          Gets a local lab for a particular science research.
protected  double performMappedPhase(double time)
          Performs the method mapped to the task's current phase.
protected  double researchingPhase(double time)
          Performs the researching phase.
 
Methods inherited from class org.mars_sim.msp.simulation.person.ai.task.Task
addPhase, compareTo, getCreateEvents, getCrowdingProbabilityModifier, getDescription, getDuration, getName, getPhase, getProbability, getRelationshipModifier, getSubTask, getTeacher, getTeachingExperienceModifier, getTimeCompleted, getTopPhase, hasTeacher, isDone, isEffortDriven, setCreateEvents, setDescription, setDuration, setName, setPhase, setStressModifier, setTeacher, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ResearchScience

public ResearchScience(java.lang.String science,
                       Person person)
                throws java.lang.Exception
Constructor

Parameters:
science - the science the person is researching.
person - the person doing the research.
Throws:
java.lang.Exception - if error constructing task.
Method Detail

performMappedPhase

protected double performMappedPhase(double time)
                             throws java.lang.Exception
Performs the method mapped to the task's current phase.

Specified by:
performMappedPhase in class Task
Parameters:
time - the amount of time (millisol) the phase is to be performed.
Returns:
the remaining time (millisol) after the phase has been performed.
Throws:
java.lang.Exception - if error in performing phase or if phase cannot be found.

researchingPhase

protected double researchingPhase(double time)
                           throws java.lang.Exception
Performs the researching phase.

Parameters:
time - the amount of time (millisols) to perform the phase.
Returns:
the amount of time (millisols) left over after performing the phase.
Throws:
java.lang.Exception - if error performing the phase.

addExperience

protected void addExperience(double time)
Adds experience to the person's skills used in this task.

Specified by:
addExperience in class Task
Parameters:
time - the amount of time (ms) the person performed this task.

endTask

public void endTask()
Ends the task and performs any final actions.

Overrides:
endTask in class Task

getLocalLab

protected static Lab getLocalLab(Person person,
                                 java.lang.String science)
                          throws java.lang.Exception
Gets a local lab for a particular science research.

Parameters:
person - the person checking for the lab.
science - the science to research.
Returns:
laboratory found or null if none.
Throws:
java.lang.Exception - if error getting a lab.

getEffectiveSkillLevel

public int getEffectiveSkillLevel()
Description copied from class: Task
Gets the effective skill level a person has at this task.

Specified by:
getEffectiveSkillLevel in class Task
Returns:
effective skill level

getAssociatedSkills

public java.util.List<java.lang.String> getAssociatedSkills()
Description copied from class: Task
Gets a list of the skills associated with this task. May be empty list if no associated skills.

Specified by:
getAssociatedSkills in class Task
Returns:
list of skills as strings