|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.mars_sim.msp.simulation.person.ai.mission.Mission
org.mars_sim.msp.simulation.person.ai.mission.TravelMission
public abstract class TravelMission
A mission that involves traveling along a series of navpoints.
Field Summary | |
---|---|
static java.lang.String |
AT_NAVPOINT
|
static java.lang.String |
DISTANCE_EVENT
|
static java.lang.String |
NAVPOINTS_EVENT
|
static java.lang.String |
TRAVEL_STATUS_EVENT
|
static java.lang.String |
TRAVEL_TO_NAVPOINT
|
Fields inherited from class org.mars_sim.msp.simulation.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 |
TravelMission(java.lang.String name,
Person startingPerson,
int minPeople)
Constructor (note: The constructor handles setting the initial nav point.) |
Method Summary | |
---|---|
void |
addNavpoint(NavPoint navPoint)
Adds a navpoint to the mission. |
void |
clearRemainingNavpoints()
Clears out any unreached nav points. |
double |
getCurrentLegDistance()
Gets the distance of the current leg of the mission, or 0 if not in the travelling phase. |
double |
getCurrentLegRemainingDistance()
Gets the remaining distance for the current leg of the mission. |
protected MarsClock |
getCurrentLegStartingTime()
Gets the starting time of the current leg of the mission. |
NavPoint |
getCurrentNavpoint()
Gets the current navpoint the mission is stopped at. |
int |
getCurrentNavpointIndex()
Gets the index of the current navpoint the mission is stopped at. |
abstract double |
getEstimatedRemainingMissionTime(boolean useBuffer)
Gets the estimated time remaining for the mission. |
abstract double |
getEstimatedTripTime(boolean useBuffer,
double distance)
Gets the estimated time for a trip. |
abstract MarsClock |
getLegETA()
Gets the estimated time of arrival (ETA) for the current leg of the mission. |
NavPoint |
getNavpoint(int index)
Gets the navpoint at an index value. |
int |
getNavpointIndex(NavPoint navpoint)
Gets the index of a navpoint. |
NavPoint |
getNextNavpoint()
Gets the mission's next navpoint. |
int |
getNextNavpointIndex()
Gets the mission's next navpoint index. |
int |
getNumberOfNavpoints()
Gets the number of navpoints on the trip. |
NavPoint |
getPreviousNavpoint()
Gets the last navpoint reached. |
double |
getTotalDistance()
Gets the total distance of the trip. |
abstract double |
getTotalDistanceTravelled()
Gets the total distance travelled during the mission so far. |
double |
getTotalRemainingDistance()
Gets the total remaining distance to travel in the mission. |
java.lang.String |
getTravelStatus()
Get the travel mission's current status. |
protected abstract void |
performTravelPhase(Person person)
Performs the travel phase of the mission. |
protected void |
reachedNextNode()
The mission has reached the next navpoint. |
protected void |
setNavpoint(int index,
NavPoint navPoint)
Sets a nav point for the mission. |
void |
setNextNavpointIndex(int newNavIndex)
Set the next navpoint index. |
protected void |
startTravelToNextNode()
Starts travel to the next navpoint in the mission. |
abstract void |
updateTravelDestination()
Update mission to the next navpoint destination. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String TRAVEL_STATUS_EVENT
public static final java.lang.String NAVPOINTS_EVENT
public static final java.lang.String DISTANCE_EVENT
public static final java.lang.String AT_NAVPOINT
public static final java.lang.String TRAVEL_TO_NAVPOINT
Constructor Detail |
---|
protected TravelMission(java.lang.String name, Person startingPerson, int minPeople) throws MissionException
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.Method Detail |
---|
public final void addNavpoint(NavPoint navPoint)
navPoint
- the new nav point location to be added.
java.lang.IllegalArgumentException
- if location is null.protected final void setNavpoint(int index, NavPoint navPoint)
index
- the index in the list of nav points.navPoint
- the new navpoint
java.lang.IllegalArgumentException
- if location is null or index < 0.public final void clearRemainingNavpoints()
public final NavPoint getPreviousNavpoint()
public final NavPoint getNextNavpoint()
public final int getNextNavpointIndex()
public final void setNextNavpointIndex(int newNavIndex) throws MissionException
newNavIndex
- the next navpoint index.
MissionException
- if the new navpoint is out of range.public final NavPoint getNavpoint(int index)
index
- the index value
IllegaArgumentException
- if no navpoint at that index.public final int getNavpointIndex(NavPoint navpoint)
navpoint
- the navpoint
public final int getNumberOfNavpoints()
public final NavPoint getCurrentNavpoint()
public final int getCurrentNavpointIndex()
public final java.lang.String getTravelStatus()
protected final void startTravelToNextNode() throws MissionException
MissionException
- if no more navpoints.protected final void reachedNextNode() throws MissionException
MisisonException
- if error determining mission location.
MissionException
protected abstract void performTravelPhase(Person person) throws MissionException
person
- the person currently performing the mission.
MissionException
- if error performing travel phase.protected final MarsClock getCurrentLegStartingTime()
public final double getCurrentLegDistance()
public final double getCurrentLegRemainingDistance() throws MissionException
MissionException
- if error determining distance.public final double getTotalDistance()
public final double getTotalRemainingDistance() throws MissionException
MissionException
- if error determining distance.public abstract double getTotalDistanceTravelled()
public abstract MarsClock getLegETA()
public abstract double getEstimatedRemainingMissionTime(boolean useBuffer) throws MissionException
useBuffer
- use a time buffer in estimation if true.
MissionException
public abstract double getEstimatedTripTime(boolean useBuffer, double distance) throws MissionException
useBuffer
- use time buffers in estimation if true.distance
- the distance of the trip.
MissionException
public abstract void updateTravelDestination()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |