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

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
All Implemented Interfaces:
java.io.Serializable, java.lang.Comparable
Direct Known Subclasses:
CollectMinedMinerals, CollectResources, ExploreSite, MaintainGroundVehicleEVA, MaintenanceEVA, MineSite, RepairEVAMalfunction, ToggleResourceProcess

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

The EVAOperation class is an abstract task that involves an extra vehicular activity.

See Also:
Serialized Form

Field Summary
static double BASE_ACCIDENT_CHANCE
           
protected  Unit containerUnit
           
protected static java.lang.String ENTER_AIRLOCK
           
protected  boolean enteredAirlock
           
protected static java.lang.String EXIT_AIRLOCK
           
protected  boolean 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
EVAOperation(java.lang.String name, Person person)
          Constructor
 
Method Summary
protected  void checkForAccident(double time)
          Check for accident with EVA suit.
 void endEVA()
           
protected  double enterAirlock(double time, Airlock airlock)
          Perform the enter airlock phase of the task.
protected  double exitAirlock(double time, Airlock airlock)
          Perform the exit airlock phase of the task.
static Airlock getAvailableAirlock(Person person)
          Gets an available airlock for a person.
protected  boolean shouldEndEVAOperation()
          Checks if situation requires the EVA operation to end prematurely and the person should return to the airlock.
 
Methods inherited from class org.mars_sim.msp.simulation.person.ai.task.Task
addExperience, addPhase, compareTo, endTask, getAssociatedSkills, getCreateEvents, getCrowdingProbabilityModifier, getDescription, getDuration, getEffectiveSkillLevel, getName, getPhase, getProbability, getRelationshipModifier, getSubTask, getTeacher, getTeachingExperienceModifier, getTimeCompleted, getTopPhase, hasTeacher, isDone, isEffortDriven, performMappedPhase, 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
 

Field Detail

EXIT_AIRLOCK

protected static final java.lang.String EXIT_AIRLOCK
See Also:
Constant Field Values

ENTER_AIRLOCK

protected static final java.lang.String ENTER_AIRLOCK
See Also:
Constant Field Values

BASE_ACCIDENT_CHANCE

public static final double BASE_ACCIDENT_CHANCE
See Also:
Constant Field Values

exitedAirlock

protected boolean exitedAirlock

enteredAirlock

protected boolean enteredAirlock

containerUnit

protected Unit containerUnit
Constructor Detail

EVAOperation

public EVAOperation(java.lang.String name,
                    Person person)
             throws java.lang.Exception
Constructor

Parameters:
name - the name of the task
person - the person to perform the task
Throws:
java.lang.Exception - if task could not be constructed.
Method Detail

endEVA

public void endEVA()

exitAirlock

protected double exitAirlock(double time,
                             Airlock airlock)
                      throws java.lang.Exception
Perform the exit airlock phase of the task.

Parameters:
time - the time to perform this phase (in millisols)
airlock - the airlock
Returns:
the time remaining after performing this phase (in millisols)
Throws:
java.lang.Exception - if person cannot exit through the airlock.

enterAirlock

protected double enterAirlock(double time,
                              Airlock airlock)
                       throws java.lang.Exception
Perform the enter airlock phase of the task.

Parameters:
time - the time to perform this phase (in millisols)
airlock - the airlock
Returns:
the time remaining after performing this phase (in millisols)
Throws:
java.lang.Exception - if person cannot enter the airlock.

shouldEndEVAOperation

protected boolean shouldEndEVAOperation()
Checks if situation requires the EVA operation to end prematurely and the person should return to the airlock.

Returns:
true if EVA operation should end

checkForAccident

protected void checkForAccident(double time)
Check for accident with EVA suit.

Parameters:
time - the amount of time on EVA (in millisols)

getAvailableAirlock

public static Airlock getAvailableAirlock(Person person)
Gets an available airlock for a person.

Returns:
airlock or null if none available