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

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.MineSite
All Implemented Interfaces:
java.io.Serializable, java.lang.Comparable

public class MineSite
extends EVAOperation
implements java.io.Serializable

Task for mining minerals at a site.

See Also:
Serialized Form

Field Summary
static double BASE_LUV_ACCIDENT_CHANCE
           
 
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
MineSite(Person person, Coordinates site, Rover rover, LightUtilityVehicle luv)
          Constructor
 
Method Summary
protected  void addExperience(double time)
          Adds experience to the person's skills used in this task.
static boolean canMineSite(Person person, Rover rover)
          Checks if a person can mine a site.
protected  void checkForAccident(double time)
          Check for accident with EVA suit.
 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  double performMappedPhase(double time)
          Performs the method mapped to the task's current phase.
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.EVAOperation
endEVA, enterAirlock, exitAirlock, getAvailableAirlock
 
Methods inherited from class org.mars_sim.msp.simulation.person.ai.task.Task
addPhase, compareTo, endTask, 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
 

Field Detail

BASE_LUV_ACCIDENT_CHANCE

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

MineSite

public MineSite(Person person,
                Coordinates site,
                Rover rover,
                LightUtilityVehicle luv)
         throws java.lang.Exception
Constructor

Parameters:
person - the person performing the task.
site - the explored site to mine.
rover - the rover used for the EVA operation.
luv - the light utility vehicle used for mining.
Throws:
java.lang.Exception - if error creating task.
Method Detail

canMineSite

public static boolean canMineSite(Person person,
                                  Rover rover)
Checks if a person can mine a site.

Parameters:
person - the person
rover - the rover
Returns:
true if person can mine a site.

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

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)
                             throws java.lang.Exception
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.
Throws:
java.lang.Exception - if error in performing phase or if phase cannot be found.

checkForAccident

protected void checkForAccident(double time)
Description copied from class: EVAOperation
Check for accident with EVA suit.

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

shouldEndEVAOperation

protected boolean shouldEndEVAOperation()
Description copied from class: EVAOperation
Checks if situation requires the EVA operation to end prematurely and the person should return to the airlock.

Overrides:
shouldEndEVAOperation in class EVAOperation
Returns:
true if EVA operation should end