org.mars_sim.msp.core.person.ai.task
Class ObserveAstronomicalObjects

java.lang.Object
  extended by org.mars_sim.msp.core.person.ai.task.Task
      extended by org.mars_sim.msp.core.person.ai.task.ObserveAstronomicalObjects
All Implemented Interfaces:
Serializable, Comparable<Task>, ResearchScientificStudy

public class ObserveAstronomicalObjects
extends Task
implements ResearchScientificStudy, Serializable

A task for observing the night sky with an astronomical observatory.

See Also:
Serialized Form

Field Summary
 
Fields inherited from class org.mars_sim.msp.core.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
ObserveAstronomicalObjects(Person person)
          Constructor
 
Method Summary
protected  void addExperience(double time)
          Adds experience to the person's skills used in this task.
 void destroy()
          Prepare object for garbage collection.
 void endTask()
          Ends the task and performs any final actions.
 List<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.
static double getProbability(Person person)
          Returns the weighted probability that a person might perform this task.
 Person getResearchAssistant()
          Gets the research assistant.
 Person getResearcher()
          Gets the researcher who is being assisted.
 Science getResearchScience()
          Gets the scientific field that is being researched for the study.
 boolean hasResearchAssistant()
          Checks if there is a research assistant.
protected  double observingPhase(double time)
          Performs the observing phase.
protected  double performMappedPhase(double time)
          Performs the method mapped to the task's current phase.
 void setResearchAssistant(Person researchAssistant)
          Sets the research assistant.
 
Methods inherited from class org.mars_sim.msp.core.person.ai.task.Task
addPhase, compareTo, getCreateEvents, getCrowdingProbabilityModifier, getDescription, getDuration, getName, getPhase, 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

ObserveAstronomicalObjects

public ObserveAstronomicalObjects(Person person)
Constructor

Parameters:
person - the person performing the task.
Throws:
Exception - if error constructing the task.
Method Detail

getProbability

public static double getProbability(Person person)
Returns the weighted probability that a person might perform this task.

Parameters:
person - the person to perform the task
Returns:
the weighted probability that a person might perform this task

addExperience

protected void addExperience(double time)
Description copied from class: Task
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.

getAssociatedSkills

public List<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

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

performMappedPhase

protected double performMappedPhase(double time)
Description copied from class: Task
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.

observingPhase

protected double observingPhase(double time)
Performs the observing 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:
Exception - if error performing the phase.

endTask

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

Overrides:
endTask in class Task

getResearchScience

public Science getResearchScience()
Gets the scientific field that is being researched for the study.

Specified by:
getResearchScience in interface ResearchScientificStudy
Returns:
scientific field.

getResearcher

public Person getResearcher()
Gets the researcher who is being assisted.

Specified by:
getResearcher in interface ResearchScientificStudy
Returns:
researcher.

hasResearchAssistant

public boolean hasResearchAssistant()
Checks if there is a research assistant.

Specified by:
hasResearchAssistant in interface ResearchScientificStudy
Returns:
research assistant.

getResearchAssistant

public Person getResearchAssistant()
Gets the research assistant.

Specified by:
getResearchAssistant in interface ResearchScientificStudy
Returns:
research assistant or null if none.

setResearchAssistant

public void setResearchAssistant(Person researchAssistant)
Sets the research assistant.

Specified by:
setResearchAssistant in interface ResearchScientificStudy
Parameters:
researchAssistant - the research assistant.

destroy

public void destroy()
Description copied from class: Task
Prepare object for garbage collection.

Overrides:
destroy in class Task


Copyright © 2009-2013. All Rights Reserved.