|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.mars_sim.msp.core.person.ai.mission.Mission
org.mars_sim.msp.core.person.ai.mission.TravelMission
org.mars_sim.msp.core.person.ai.mission.VehicleMission
org.mars_sim.msp.core.person.ai.mission.RoverMission
public abstract class RoverMission
A mission that involves driving a rover vehicle along a series of navpoints.
| Field Summary | |
|---|---|
protected static int |
MIN_PEOPLE
|
static String |
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 | |
|---|---|
protected |
RoverMission(String name,
Person startingPerson)
Constructor |
protected |
RoverMission(String name,
Person startingPerson,
int minPeople)
Constructor with min people |
protected |
RoverMission(String name,
Person startingPerson,
int minPeople,
Rover rover)
Constructor with min people and rover. |
| Method Summary | |
|---|---|
protected static boolean |
areVehiclesAvailable(Settlement settlement,
boolean allowMaintReserved)
Checks to see if any vehicles are available at a settlement. |
protected static boolean |
atLeastOnePersonRemainingAtSettlement(Settlement settlement,
Person person)
Checks to see if at least one inhabitant a settlement is remaining there. |
void |
destroy()
Prepare object for garbage collection. |
void |
endMission(String reason)
Finalizes the mission |
protected OperateVehicle |
getOperateVehicleTask(Person person,
String lastOperateVehicleTaskPhase)
Gets a new instance of an OperateVehicle task for the person. |
Map<Resource,Number> |
getResourcesNeededForTrip(boolean useBuffer,
double distance)
Gets the number and amounts of resources needed for a trip. |
Rover |
getRover()
Gets the mission's rover if there is one. |
Settlement |
getStartingSettlement()
Gets the starting settlement. |
protected static Vehicle |
getVehicleWithGreatestRange(Settlement settlement,
boolean allowMaintReserved)
Gets the available vehicle at the settlement with the greatest range. |
protected static boolean |
hasBackupRover(Settlement settlement)
Checks if there is an available backup rover at the settlement for the mission. |
protected boolean |
hasDangerousMedicalProblemAtAssociatedSettlement()
Checks if there is only one person at the associated settlement and he/she has a serious medical problem. |
protected boolean |
hasEmergency()
Checks if the mission has an emergency situation. |
protected static boolean |
hasEnoughBasicResources(Settlement settlement)
Checks if there are enough basic mission resources at the settlement to start mission. |
protected boolean |
isEveryoneInRover()
Checks that everyone in the mission is aboard the rover. |
protected boolean |
isNoOneInRover()
Checks that no one in the mission is aboard the rover. |
protected boolean |
isRoverInAGarage()
Checks if the rover is currently in a garage or not. |
protected boolean |
isUsableVehicle(Vehicle newVehicle)
Checks if vehicle is usable for this mission. |
protected static boolean |
minAvailablePeopleAtSettlement(Settlement settlement,
int minNum)
Checks to see if at least a minimum number of people are available for a mission at a settlement. |
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 |
setStartingSettlement(Settlement startingSettlement)
Sets the starting settlement. |
| 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 java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final String STARTING_SETTLEMENT_EVENT
protected static final int MIN_PEOPLE
| Constructor Detail |
|---|
protected RoverMission(String name,
Person startingPerson)
name - the name of the mission.startingPerson - the person starting the mission.
MissionException - if error constructing mission.
protected RoverMission(String name,
Person startingPerson,
int minPeople)
name - the name of the mission.startingPerson - the person starting the mission.minPeople - the minimum number of people required for mission.
MissionException - if error constructing mission.
protected RoverMission(String name,
Person startingPerson,
int minPeople,
Rover rover)
name - the name of the mission.startingPerson - the person starting the mission.minPeople - the minimum number of people required for mission.rover - the rover to use on the mission.
MissionException - if error constructing mission.| Method Detail |
|---|
public final Rover getRover()
protected final void setStartingSettlement(Settlement startingSettlement)
startingSettlement - the new starting settlementpublic final Settlement getStartingSettlement()
protected void performPhase(Person person)
performPhase in class VehicleMissionperson - the person performing the phase.
MissionException - if problem performing the phase.
protected static Vehicle getVehicleWithGreatestRange(Settlement settlement,
boolean allowMaintReserved)
settlement - the settlement to check.allowMaintReserved - allow vehicles that are reserved for maintenance.
Exception - if error finding vehicles.
protected static boolean areVehiclesAvailable(Settlement settlement,
boolean allowMaintReserved)
settlement - the settlement to check.allowMaintReserved - allow vehicles that are reserved for maintenance.
protected boolean isUsableVehicle(Vehicle newVehicle)
isUsableVehicle in class VehicleMissionnewVehicle - the vehicle to check
MissionException - if problem determining if vehicle is usable.protected final boolean isEveryoneInRover()
protected final boolean isNoOneInRover()
protected boolean isRoverInAGarage()
protected void performEmbarkFromSettlementPhase(Person person)
performEmbarkFromSettlementPhase in class VehicleMissionperson - the person currently performing the mission
MissionException - if error performing phase.
protected void performDisembarkToSettlementPhase(Person person,
Settlement disembarkSettlement)
performDisembarkToSettlementPhase in class VehicleMissionperson - the person currently performing the mission.disembarkSettlement - the settlement to be disembarked to.
MissionException - if error performing phase.
protected OperateVehicle getOperateVehicleTask(Person person,
String lastOperateVehicleTaskPhase)
getOperateVehicleTask in class VehicleMissionperson - the person operating the vehicle.
MissionException - if error creating OperateVehicle task.
protected static boolean atLeastOnePersonRemainingAtSettlement(Settlement settlement,
Person person)
settlement - the settlement to check.person - the person checking
protected static boolean minAvailablePeopleAtSettlement(Settlement settlement,
int minNum)
settlement - the settlement to check.minNum - minimum number of people required.
protected final boolean hasDangerousMedicalProblemAtAssociatedSettlement()
protected final boolean hasEmergency()
hasEmergency in class Mission
public Map<Resource,Number> getResourcesNeededForTrip(boolean useBuffer,
double distance)
VehicleMission
getResourcesNeededForTrip in class VehicleMissionuseBuffer - use time buffers in estimation if true.distance - the distance (km) of the trip.
public void endMission(String reason)
VehicleMission
endMission in class VehicleMissionreason - the reason of ending the mission.protected static boolean hasBackupRover(Settlement settlement)
settlement - the settlement to check.
protected static boolean hasEnoughBasicResources(Settlement settlement)
settlement - the starting settlement.
public void destroy()
Mission
destroy in class VehicleMission
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||