org.mars_sim.msp.core.person.ai.mission
Class Mining

java.lang.Object
  extended by org.mars_sim.msp.core.person.ai.mission.Mission
      extended by org.mars_sim.msp.core.person.ai.mission.TravelMission
          extended by org.mars_sim.msp.core.person.ai.mission.VehicleMission
              extended by org.mars_sim.msp.core.person.ai.mission.RoverMission
                  extended by org.mars_sim.msp.core.person.ai.mission.Mining
All Implemented Interfaces:
Serializable, UnitListener

public class Mining
extends RoverMission

Mission for mining mineral concentrations at an explored site.

See Also:
Serialized Form

Field Summary
static String BACKHOE
           
static String COLLECT_MINERALS_EVENT
           
static String DEFAULT_DESCRIPTION
           
static String EXCAVATE_MINERALS_EVENT
           
static String MINING_SITE
           
static String PNEUMATIC_DRILL
           
 
Fields inherited from class org.mars_sim.msp.core.person.ai.mission.RoverMission
MIN_PEOPLE, STARTING_SETTLEMENT_EVENT
 
Fields inherited from class org.mars_sim.msp.core.person.ai.mission.VehicleMission
DISEMBARKING, EMBARKING, equipmentNeededCache, loadedFlag, OPERATOR_EVENT, TRAVELLING, VEHICLE_EVENT
 
Fields inherited from class org.mars_sim.msp.core.person.ai.mission.TravelMission
AT_NAVPOINT, DISTANCE_EVENT, NAVPOINTS_EVENT, TRAVEL_STATUS_EVENT, TRAVEL_TO_NAVPOINT
 
Fields inherited from class org.mars_sim.msp.core.person.ai.mission.Mission
ADD_MEMBER_EVENT, ASSOCIATED_SETTLEMENT_EVENT, CAPACITY_EVENT, DESCRIPTION_EVENT, END_MISSION_EVENT, MIN_PEOPLE_EVENT, NAME_EVENT, PHASE_DESCRIPTION_EVENT, PHASE_EVENT, REMOVE_MEMBER_EVENT
 
Constructor Summary
Mining(Collection<Person> members, Settlement startingSettlement, ExploredLocation miningSite, Rover rover, LightUtilityVehicle luv, String description)
          Constructor with explicit data.
Mining(Person startingPerson)
          Constructor
 
Method Summary
 void collectMineral(AmountResource mineral, double amount)
          Collects an amount of a mineral.
 void destroy()
          Prepare object for garbage collection.
protected  void determineNewPhase()
          Determines a new phase for the mission when the current phase has ended.
 void endMiningAtSite()
          Ends mining at a site.
 void endMission(String reason)
          Finalizes the mission
 void excavateMineral(AmountResource mineral, double amount)
          Excavates an amount of a mineral.
 Settlement getAssociatedSettlement()
          Gets the settlement associated with the mission.
 Map<Class,Integer> getEquipmentNeededForRemainingMission(boolean useBuffer)
          Gets the number and types of equipment needed for the mission.
 double getEstimatedRemainingMissionTime(boolean useBuffer)
          Gets the estimated time remaining for the mission.
 LightUtilityVehicle getLightUtilityVehicle()
          Gets the mission's light utility vehicle.
 double getMineralExcavationAmount(AmountResource mineral)
          Gets the amount of a mineral currently excavated.
 ExploredLocation getMiningSite()
          Gets the mission mining site.
static double getNewMissionProbability(Person person)
          Gets the weighted probability that a given person would start this mission.
 Map<Resource,Number> getResourcesNeededForRemainingMission(boolean useBuffer)
          Gets the number and amounts of resources needed for the mission.
 double getTotalMineralExcavatedAmount(AmountResource mineral)
          Gets the total amount of a mineral that has been excavated so far.
protected  boolean isCapableOfMission(Person person)
          Checks to see if a person is capable of joining a mission.
protected  void performDisembarkToSettlementPhase(Person person, Settlement disembarkSettlement)
          Performs the disembark to settlement phase of the mission.
protected  void performEmbarkFromSettlementPhase(Person person)
          Performs the embark from settlement phase of the mission.
protected  void performPhase(Person person)
          The person performs the current phase of the mission.
protected  void recruitPeopleForMission(Person startingPerson)
          Recruits new people into the mission.
 
Methods inherited from class org.mars_sim.msp.core.person.ai.mission.RoverMission
areVehiclesAvailable, atLeastOnePersonRemainingAtSettlement, getOperateVehicleTask, getResourcesNeededForTrip, getRover, getStartingSettlement, getVehicleWithGreatestRange, hasBackupRover, hasDangerousMedicalProblemAtAssociatedSettlement, hasEmergency, hasEnoughBasicResources, isEveryoneInRover, isNoOneInRover, isRoverInAGarage, isUsableVehicle, minAvailablePeopleAtSettlement, setStartingSettlement
 
Methods inherited from class org.mars_sim.msp.core.person.ai.mission.VehicleMission
compareVehicles, determineEmergencyDestination, findClosestSettlement, getAverageVehicleSpeedForOperators, getEstimatedTripTime, getFuelNeededForTrip, getLegETA, getOptionalEquipmentToLoad, getOptionalResourcesToLoad, getPartsNeededForTrip, getRequiredEquipmentToLoad, getRequiredResourcesToLoad, getTotalDistanceTravelled, getVehicle, hasEmbarkingMissions, hasEnoughResourcesForRemainingMission, hasVehicle, isVehicleLoadable, isVehicleLoaded, leaveVehicle, performTravelPhase, reserveVehicle, setEmergencyBeacon, setVehicle, timePassing, unitUpdate, updateTravelDestination
 
Methods inherited from class org.mars_sim.msp.core.person.ai.mission.TravelMission
addNavpoint, clearRemainingNavpoints, getCurrentLegDistance, getCurrentLegRemainingDistance, getCurrentLegStartingTime, getCurrentNavpoint, getCurrentNavpointIndex, getNavpoint, getNavpointIndex, getNextNavpoint, getNextNavpointIndex, getNumberOfNavpoints, getPreviousNavpoint, getTotalDistance, getTotalRemainingDistance, getTravelStatus, reachedNextNode, setNavpoint, setNextNavpointIndex, startTravelToNextNode
 
Methods inherited from class org.mars_sim.msp.core.person.ai.mission.Mission
addMissionListener, addPerson, addPhase, assignTask, associateAllMembersWithSettlement, fireMissionUpdate, fireMissionUpdate, getCurrentMissionLocation, getDescription, getMinPeople, getMissionCapacity, getMissionQualification, getName, getPeople, getPeopleNumber, getPhase, getPhaseDescription, getPhaseEnded, hasDangerousMedicalProblems, hasDangerousMedicalProblemsAllCrew, hasEmergencyAllCrew, hasPerson, isDone, performMission, removeMissionListener, removePerson, setDescription, setMinPeople, setMissionCapacity, setName, setPhase, setPhaseDescription, setPhaseEnded, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

DEFAULT_DESCRIPTION

public static final String DEFAULT_DESCRIPTION
See Also:
Constant Field Values

MINING_SITE

public static final String MINING_SITE
See Also:
Constant Field Values

EXCAVATE_MINERALS_EVENT

public static final String EXCAVATE_MINERALS_EVENT
See Also:
Constant Field Values

COLLECT_MINERALS_EVENT

public static final String COLLECT_MINERALS_EVENT
See Also:
Constant Field Values

PNEUMATIC_DRILL

public static final String PNEUMATIC_DRILL
See Also:
Constant Field Values

BACKHOE

public static final String BACKHOE
See Also:
Constant Field Values
Constructor Detail

Mining

public Mining(Person startingPerson)
Constructor

Parameters:
startingPerson - the person starting the mission.
Throws:
MissionException - if error creating mission.

Mining

public Mining(Collection<Person> members,
              Settlement startingSettlement,
              ExploredLocation miningSite,
              Rover rover,
              LightUtilityVehicle luv,
              String description)
Constructor with explicit data.

Parameters:
members - collection of mission members.
startingSettlement - the starting settlement.
miningSite - the site to mine.
rover - the rover to use.
description - the mission's description.
Throws:
MissionException - if error constructing mission.
Method Detail

getNewMissionProbability

public static double getNewMissionProbability(Person person)
Gets the weighted probability that a given person would start this mission.

Parameters:
person - the given person
Returns:
the weighted probability

determineNewPhase

protected void determineNewPhase()
Description copied from class: VehicleMission
Determines a new phase for the mission when the current phase has ended.

Overrides:
determineNewPhase in class VehicleMission

performPhase

protected void performPhase(Person person)
Description copied from class: RoverMission
The person performs the current phase of the mission.

Overrides:
performPhase in class RoverMission
Parameters:
person - the person performing the phase.

performEmbarkFromSettlementPhase

protected void performEmbarkFromSettlementPhase(Person person)
Description copied from class: RoverMission
Performs the embark from settlement phase of the mission.

Overrides:
performEmbarkFromSettlementPhase in class RoverMission
Parameters:
person - the person currently performing the mission

performDisembarkToSettlementPhase

protected void performDisembarkToSettlementPhase(Person person,
                                                 Settlement disembarkSettlement)
Description copied from class: RoverMission
Performs the disembark to settlement phase of the mission.

Overrides:
performDisembarkToSettlementPhase in class RoverMission
Parameters:
person - the person currently performing the mission.
disembarkSettlement - the settlement to be disembarked to.

endMiningAtSite

public void endMiningAtSite()
Ends mining at a site.


getEquipmentNeededForRemainingMission

public Map<Class,Integer> getEquipmentNeededForRemainingMission(boolean useBuffer)
Description copied from class: Mission
Gets the number and types of equipment needed for the mission.

Specified by:
getEquipmentNeededForRemainingMission in class Mission
Parameters:
useBuffer - use time buffers in estimation if true.
Returns:
map of equipment class and Integer number.

getAssociatedSettlement

public Settlement getAssociatedSettlement()
Description copied from class: Mission
Gets the settlement associated with the mission.

Specified by:
getAssociatedSettlement in class Mission
Returns:
settlement or null if none.

isCapableOfMission

protected boolean isCapableOfMission(Person person)
Description copied from class: Mission
Checks to see if a person is capable of joining a mission.

Overrides:
isCapableOfMission in class Mission
Parameters:
person - the person to check.
Returns:
true if person could join mission.

recruitPeopleForMission

protected void recruitPeopleForMission(Person startingPerson)
Description copied from class: Mission
Recruits new people into the mission.

Overrides:
recruitPeopleForMission in class Mission
Parameters:
startingPerson - the person starting the mission.

getEstimatedRemainingMissionTime

public double getEstimatedRemainingMissionTime(boolean useBuffer)
Description copied from class: VehicleMission
Gets the estimated time remaining for the mission.

Overrides:
getEstimatedRemainingMissionTime in class VehicleMission
Parameters:
useBuffer - Use time buffer in estimations if true.
Returns:
time (millisols)

getResourcesNeededForRemainingMission

public Map<Resource,Number> getResourcesNeededForRemainingMission(boolean useBuffer)
Description copied from class: VehicleMission
Gets the number and amounts of resources needed for the mission.

Overrides:
getResourcesNeededForRemainingMission in class VehicleMission
Parameters:
useBuffer - use time buffers in estimation if true.
Returns:
map of amount and item resources and their Double amount or Integer number.

getMiningSite

public ExploredLocation getMiningSite()
Gets the mission mining site.

Returns:
mining site.

endMission

public void endMission(String reason)
Description copied from class: VehicleMission
Finalizes the mission

Overrides:
endMission in class RoverMission
Parameters:
reason - the reason of ending the mission.

getLightUtilityVehicle

public LightUtilityVehicle getLightUtilityVehicle()
Gets the mission's light utility vehicle.

Returns:
light utility vehicle.

getMineralExcavationAmount

public double getMineralExcavationAmount(AmountResource mineral)
Gets the amount of a mineral currently excavated.

Parameters:
mineral - the mineral resource.
Returns:
amount (kg)

getTotalMineralExcavatedAmount

public double getTotalMineralExcavatedAmount(AmountResource mineral)
Gets the total amount of a mineral that has been excavated so far.

Parameters:
mineral - the mineral resource.
Returns:
amount (kg)

excavateMineral

public void excavateMineral(AmountResource mineral,
                            double amount)
Excavates an amount of a mineral.

Parameters:
mineral - the mineral resource.
amount - the amount (kg)

collectMineral

public void collectMineral(AmountResource mineral,
                           double amount)
Collects an amount of a mineral.

Parameters:
mineral - the mineral resource.
amount - the amount (kg)
Throws:
Exception - if error collecting mineral.

destroy

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

Overrides:
destroy in class RoverMission


Copyright © 2009-2013. All Rights Reserved.