|
||||||||||
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.TaskManager
public class TaskManager
The TaskManager class keeps track of a person's current task and can randomly assign a new task to a person based on a list of possible tasks and that person's current situation. There is one instance of TaskManager per person.
Field Summary | |
---|---|
static java.lang.String |
TASK_EVENT
|
Constructor Summary | |
---|---|
TaskManager(Mind mind)
Constructor |
Method Summary | |
---|---|
void |
addTask(Task newTask)
Adds a task to the stack of tasks. |
void |
clearTask()
Sets the current task to null. |
Task |
getNewTask()
Gets a new task for the person based on tasks available. |
java.lang.String |
getPhase()
Returns the name of current task phase if there is one. |
Task |
getTask()
Returns the current task. |
java.lang.String |
getTaskDescription()
Returns a description of current task for UI purposes. |
java.lang.String |
getTaskName()
Returns the name of the current task for UI purposes. |
double |
getTotalTaskProbability()
Determines the total probability weight for available tasks. |
boolean |
hasActiveTask()
Returns true if person has an active task. |
boolean |
hasTask()
Returns true if perosn has a task (may be inactive). |
void |
performTask(double time,
double efficiency)
Perform the current task for a given amount of time. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String TASK_EVENT
Constructor Detail |
---|
public TaskManager(Mind mind)
mind
- the mind that uses this task manager.Method Detail |
---|
public boolean hasActiveTask()
public boolean hasTask()
public java.lang.String getTaskName()
public java.lang.String getTaskDescription()
public java.lang.String getPhase()
public Task getTask()
public void clearTask()
public void addTask(Task newTask)
newTask
- the task to be addedpublic void performTask(double time, double efficiency) throws java.lang.Exception
time
- amount of time to perform the actionefficiency
- The performance rating of person performance task.
java.lang.Exception
- if error in performing task.public Task getNewTask() throws java.lang.Exception
java.lang.Exception
- if new task could not be found.public double getTotalTaskProbability()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |