|
||||||||||
| 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.task.Task
org.mars_sim.msp.simulation.person.ai.task.OperateVehicle
org.mars_sim.msp.simulation.person.ai.task.DriveGroundVehicle
public class DriveGroundVehicle
The Drive Ground Vehicle class is a task for driving a ground vehicle to a destination.
| Field Summary | |
|---|---|
static java.lang.String |
AVOID_OBSTACLE
|
static java.lang.String |
WINCH_VEHICLE
|
| Fields inherited from class org.mars_sim.msp.simulation.person.ai.task.OperateVehicle |
|---|
backingUpDistance, BASE_ACCIDENT_CHANCE, isBackingUp, MOBILIZE |
| 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 | |
|---|---|
DriveGroundVehicle(Person person,
GroundVehicle vehicle,
Coordinates destination,
MarsClock startTripTime,
double startTripDistance)
Default Constructor |
|
DriveGroundVehicle(Person person,
GroundVehicle vehicle,
Coordinates destination,
MarsClock startTripTime,
double startTripDistance,
java.lang.String startingPhase)
Constructs with a given starting phase. |
|
| Method Summary | |
|---|---|
protected void |
addExperience(double time)
Adds experience to the person's skills used in this task. |
protected void |
checkForAccident(double time)
Check if vehicle has had an accident. |
void |
endTask()
Ends the task and performs any final actions. |
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 |
getSpeed(Direction direction)
Determine vehicle speed for a given direction. |
protected double |
getSpeedLightConditionModifier()
Gets the lighting condition speed modifier. |
protected double |
getTerrainModifier()
Gets the terrain speed modifier. |
protected double |
mobilizeVehicle(double time)
Move the vehicle in its direction at its speed for the amount of time given. |
protected double |
performMappedPhase(double time)
Performs the method mapped to the task's current phase. |
protected void |
updateVehicleElevationAltitude()
Update vehicle with its current elevation or altitude. |
| Methods inherited from class org.mars_sim.msp.simulation.person.ai.task.OperateVehicle |
|---|
getAverageVehicleSpeed, getDestination, getDistanceToDestination, getETA, getSpeedSkillModifier, getStartTripDistance, getStartTripTime, getVehicle, getVehicleElevation, mobilizeVehiclePhase, setDestination |
| Methods inherited from class org.mars_sim.msp.simulation.person.ai.task.Task |
|---|
addPhase, compareTo, 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 |
|---|
public static final java.lang.String AVOID_OBSTACLE
public static final java.lang.String WINCH_VEHICLE
| Constructor Detail |
|---|
public DriveGroundVehicle(Person person,
GroundVehicle vehicle,
Coordinates destination,
MarsClock startTripTime,
double startTripDistance)
throws java.lang.Exception
person - the person to perform the taskvehicle - the vehicle to be drivendestination - location to be driven tostartTripTime - the starting time of the tripstartTripDistance - the starting distance to destination for the trip
java.lang.Exception - if task cannot be constructed.
public DriveGroundVehicle(Person person,
GroundVehicle vehicle,
Coordinates destination,
MarsClock startTripTime,
double startTripDistance,
java.lang.String startingPhase)
throws java.lang.Exception
person - the person to perform the taskvehicle - the vehicle to be drivendestination - location to be driven tostartTripTime - the starting time of the tripstartTripDistance - the starting distance to destination for the tripstartingPhase - the starting phase for the task
java.lang.Exception - if task cannot be constructed.| Method Detail |
|---|
protected double performMappedPhase(double time)
throws java.lang.Exception
performMappedPhase in class OperateVehicletime - the amount of time the phase is to be performed.
java.lang.Exception - if error in performing phase or if phase cannot be found.
protected double mobilizeVehicle(double time)
throws java.lang.Exception
mobilizeVehicle in class OperateVehicletime - the amount of time (ms) to drive.
java.lang.Exception - of error mobilizing vehicle.protected void updateVehicleElevationAltitude()
updateVehicleElevationAltitude in class OperateVehicleprotected double getSpeed(Direction direction)
getSpeed in class OperateVehicledirection - the direction of travel
protected double getSpeedLightConditionModifier()
protected double getTerrainModifier()
protected void checkForAccident(double time)
checkForAccident in class OperateVehicletime - the amount of time vehicle is driven (millisols)public int getEffectiveSkillLevel()
getEffectiveSkillLevel in class Taskpublic java.util.List<java.lang.String> getAssociatedSkills()
getAssociatedSkills in class Taskprotected void addExperience(double time)
addExperience in class Tasktime - the amount of time (ms) the person performed this task.public void endTask()
endTask in class OperateVehicle
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||