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

java.lang.Object
  extended by org.mars_sim.msp.simulation.person.ai.task.Task
      extended by org.mars_sim.msp.simulation.person.ai.task.EVAOperation
          extended by org.mars_sim.msp.simulation.person.ai.task.MaintenanceEVA
All Implemented Interfaces:
java.io.Serializable, java.lang.Comparable

public class MaintenanceEVA
extends EVAOperation
implements java.io.Serializable

The Maintenance class is a task for performing preventive maintenance on malfunctionable entities outdoors.

See Also:
Serialized Form

Field Summary
 
Fields inherited from class org.mars_sim.msp.simulation.person.ai.task.EVAOperation
BASE_ACCIDENT_CHANCE, containerUnit, ENTER_AIRLOCK, enteredAirlock, EXIT_AIRLOCK, exitedAirlock
 
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
MaintenanceEVA(Person person)
          Constructor
 
Method Summary
protected  void addExperience(double time)
          Adds experience to the person's skills used in this task.
protected  void checkForAccident(double time)
          Check for accident with entity during maintenance phase.
 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.
static double getProbability(Person person)
          Returns the weighted probability that a person might perform this task.
protected  double performMappedPhase(double time)
          Performs the method mapped to the task's current phase.
 
Methods inherited from class org.mars_sim.msp.simulation.person.ai.task.EVAOperation
endEVA, enterAirlock, exitAirlock, getAvailableAirlock, shouldEndEVAOperation
 
Methods inherited from class org.mars_sim.msp.simulation.person.ai.task.Task
addPhase, compareTo, endTask, 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

MaintenanceEVA

public MaintenanceEVA(Person person)
               throws java.lang.Exception
Constructor

Parameters:
person - the person to perform the task
Throws:
java.lang.Exception - if error constructing task.
Method Detail

getProbability

public static double getProbability(Person person)
Returns the weighted probability that a person might perform this task. It should return a 0 if there is no chance to perform this task given the person and his/her situation.

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

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 the phase is to be performed.
Returns:
the remaining time after the phase has been performed.
Throws:
java.lang.Exception - if error in performing phase or if phase cannot be found.

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.

checkForAccident

protected void checkForAccident(double time)
Check for accident with entity during maintenance phase.

Overrides:
checkForAccident in class EVAOperation
Parameters:
time - the amount of time (in millisols)

getEffectiveSkillLevel

public int getEffectiveSkillLevel()
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()
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