|
||||||||||
| 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.LoadVehicle
public class LoadVehicle
The LoadVehicle class is a task for loading a vehicle with fuel and supplies.
| Field Summary |
|---|
| 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 | |
|---|---|
LoadVehicle(Person person)
Constructor |
|
LoadVehicle(Person person,
Vehicle vehicle,
java.util.Map<Resource,java.lang.Number> resources,
java.util.Map<java.lang.Class,java.lang.Integer> equipment)
Constructor |
|
| Method Summary | |
|---|---|
protected void |
addExperience(double time)
Adds experience to the person's skills used in this task. |
static boolean |
enoughCapacityForSupplies(java.util.Map<Resource,java.lang.Number> resources,
java.util.Map<java.lang.Class,java.lang.Integer> equipment,
Vehicle vehicle,
Settlement settlement)
Checks if a vehicle has enough storage capacity for the supplies needed on the trip. |
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. |
static double |
getProbability(Person person)
Returns the weighted probability that a person might perform this task. |
static boolean |
hasEnoughSupplies(Settlement settlement,
Vehicle vehicle,
java.util.Map<Resource,java.lang.Number> resources,
java.util.Map<java.lang.Class,java.lang.Integer> equipment,
int vehicleCrewNum,
double tripTime)
Checks if there are enough supplies in the settlement's stores to supply trip. |
static boolean |
isFullyLoaded(java.util.Map<Resource,java.lang.Number> resources,
java.util.Map<java.lang.Class,java.lang.Integer> equipment,
Vehicle vehicle)
Checks if the vehicle is fully loaded with supplies. |
protected double |
performMappedPhase(double time)
Performs the method mapped to the task's current phase. |
| Methods inherited from class org.mars_sim.msp.simulation.person.ai.task.Task |
|---|
addPhase, compareTo, endTask, getCreateEvents, getCrowdingProbabilityModifier, getDescription, getDuration, getName, getPhase, 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 |
| Constructor Detail |
|---|
public LoadVehicle(Person person)
throws java.lang.Exception
person - the person performing the task.
java.lang.Exception - if error creating task.
public LoadVehicle(Person person,
Vehicle vehicle,
java.util.Map<Resource,java.lang.Number> resources,
java.util.Map<java.lang.Class,java.lang.Integer> equipment)
throws java.lang.Exception
person - the person performing the task.vehicle - the vehicle to be loaded.resources - a map of resources to be loaded.equipment - a map of equipment to be loaded.
java.lang.Exception - if error creating task.| Method Detail |
|---|
public static double getProbability(Person person)
person - the person to perform the task
protected double performMappedPhase(double time)
throws java.lang.Exception
performMappedPhase in class Tasktime - the amount of time (millisol) the phase is to be performed.
java.lang.Exception - if error in performing phase or if phase cannot be found.protected void addExperience(double time)
addExperience in class Tasktime - the amount of time (ms) the person performed this task.
public static boolean hasEnoughSupplies(Settlement settlement,
Vehicle vehicle,
java.util.Map<Resource,java.lang.Number> resources,
java.util.Map<java.lang.Class,java.lang.Integer> equipment,
int vehicleCrewNum,
double tripTime)
throws java.lang.Exception
settlement - the settlement the vehicle is at.resources - a map of resources required for the trip.equipment - a map of equipment required for the trip.vehicleCrewNum - the number of people in the vehicle crew.tripTime - the estimated time for the trip (millisols).
java.lang.Exception - if error checking supplies.
public static boolean enoughCapacityForSupplies(java.util.Map<Resource,java.lang.Number> resources,
java.util.Map<java.lang.Class,java.lang.Integer> equipment,
Vehicle vehicle,
Settlement settlement)
throws java.lang.Exception
resources - a map of the resources required.equipment - a map of the equipment types and numbers needed.vehicle - the vehicle to check.settlement - the settlement to disembark from.
java.lang.Exception - if error
public static final boolean isFullyLoaded(java.util.Map<Resource,java.lang.Number> resources,
java.util.Map<java.lang.Class,java.lang.Integer> equipment,
Vehicle vehicle)
throws java.lang.Exception
java.lang.Exception - if error checking supplies.public int getEffectiveSkillLevel()
getEffectiveSkillLevel in class Taskpublic java.util.List<java.lang.String> getAssociatedSkills()
getAssociatedSkills in class Task
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||