Banner Image

Module Tasking.Task_Manager

Tasking - This module contains the TASK_MANAGER class and derived classes.


1) Tasking.Task_Manager#TASK_MANAGER class, extends Core.Fsm#FSM

The Tasking.Task_Manager#TASK_MANAGER class defines the core functions to report tasks to groups. Reportings can be done in several manners, and it is up to the derived classes if TASK_MANAGER to model the reporting behaviour.

1.1) TASK_MANAGER constructor:

* Tasking.Task_Manager#TASK_MANAGER.New(): Create a new TASK_MANAGER instance.

1.2) TASK_MANAGER reporting:

Derived TASK_MANAGER classes will manage tasks using the method Tasking.Task_Manager#TASK_MANAGER.ManageTasks(). This method implements polymorphic behaviour.

The time interval in seconds of the task management can be changed using the methods Tasking.Task_Manager#TASK_MANAGER.SetRefreshTimeInterval(). To control how long a reporting message is displayed, use Tasking.Task_Manager#TASK_MANAGER.SetReportDisplayTime(). Derived classes need to implement the method Tasking.Task_Manager#TASK_MANAGER.GetReportDisplayTime() to use the correct display time for displayed messages during a report.

Task management can be started and stopped using the methods Tasking.Task_Manager#TASK_MANAGER.StartTasks() and Tasking.Task_Manager#TASK_MANAGER.StopTasks() respectively. If an ad-hoc report is requested, use the method Tasking.Task_Manager#TASK_MANAGER().

The default task management interval is every 60 seconds.

Developer Note

Note while this class still works, it is no longer supported as the original author stopped active development of MOOSE Therefore, this class is considered to be deprecated


Contributions: Mechanist, Prof_Hilactic, FlightControl - Concept & Testing

Author: FlightControl - Framework Design & Programming

Global(s)

Global TASK_MANAGER

Type(s)

Fields and Methods inherited from TASK_MANAGER Description

TASK_MANAGER.ClassName

TASK_MANAGER:ManageTasks()

Manages the tasks for the Core.Set#SET_GROUP.

TASK_MANAGER:New(SetGroup)

TASK_MANAGER constructor.

TASK_MANAGER:OnAfterAborted(From, Event, To, Task)

Aborted Handler OnAfter for TASK_MANAGER

TASK_MANAGER:OnAfterCancelled(From, Event, To, Task)

Cancelled Handler OnAfter for TASK_MANAGER

TASK_MANAGER:OnAfterFailed(From, Event, To, Task)

Failed Handler OnAfter for TASK_MANAGER

TASK_MANAGER:OnAfterStartTasks(From, Event, To)

StartTasks Handler OnAfter for TASK_MANAGER

TASK_MANAGER:OnAfterStopTasks(From, Event, To)

StopTasks Handler OnAfter for TASK_MANAGER

TASK_MANAGER:OnAfterSuccess(From, Event, To, Task)

Success Handler OnAfter for TASK_MANAGER

TASK_MANAGER:OnBeforeStartTasks(From, Event, To)

StartTasks Handler OnBefore for TASK_MANAGER

TASK_MANAGER:OnBeforeStopTasks(From, Event, To)

StopTasks Handler OnBefore for TASK_MANAGER

TASK_MANAGER.SetGroup

The set of group objects containing players for which tasks are managed.

TASK_MANAGER:SetRefreshTimeInterval(RefreshTimeInterval)

Set the refresh time interval in seconds when a new task management action needs to be done.

TASK_MANAGER:StartTasks()

StartTasks Trigger for TASK_MANAGER

TASK_MANAGER:StopTasks()

StopTasks Trigger for TASK_MANAGER

TASK_MANAGER._RefreshTimeInterval

TASK_MANAGER:__StartTasks(Delay)

StartTasks Asynchronous Trigger for TASK_MANAGER

TASK_MANAGER:__StopTasks(Delay)

StopTasks Asynchronous Trigger for TASK_MANAGER

TASK_MANAGER:onafterManage(From, Event, To)

TASK_MANAGER:onafterStartTasks(From, Event, To)

Fields and Methods inherited from FSM Description

TASK_MANAGER:AddEndState(State)

Adds an End state.

TASK_MANAGER:AddProcess(From, Event, Process, ReturnEvents)

Set the default #FSM_PROCESS template with key ProcessName providing the ProcessClass and the process object when it is assigned to a Wrapper.Controllable by the task.

TASK_MANAGER:AddScore(State, ScoreText, Score)

Adds a score for the FSM to be achieved.

TASK_MANAGER:AddScoreProcess(From, Event, State, ScoreText, Score)

Adds a score for the FSM_PROCESS to be achieved.

TASK_MANAGER:AddTransition(From, Event, To)

Add a new transition rule to the FSM.

TASK_MANAGER.CallScheduler

TASK_MANAGER.Events

TASK_MANAGER:GetCurrentState()

Get current state.

TASK_MANAGER:GetEndStates()

Returns the End states.

TASK_MANAGER:GetProcess(From, Event)

TASK_MANAGER:GetProcesses()

Returns a table of the SubFSM rules defined within the FSM.

TASK_MANAGER:GetScores()

Returns a table with the scores defined.

TASK_MANAGER:GetStartState()

Returns the start state of the FSM.

TASK_MANAGER:GetState()

Get current state.

TASK_MANAGER:GetSubs()

Returns a table with the Subs defined.

TASK_MANAGER:GetTransitions()

Returns a table of the transition rules defined within the FSM.

TASK_MANAGER:Is(State)

Check if FSM is in state.

TASK_MANAGER:LoadCallBacks(CallBackTable)

Load call backs.

TASK_MANAGER:New()

Creates a new FSM object.

TASK_MANAGER.Scores

TASK_MANAGER:SetProcess(From, Event, Fsm)

TASK_MANAGER:SetStartState(State)

Sets the start state of the FSM.

TASK_MANAGER._EndStates

TASK_MANAGER._EventSchedules

TASK_MANAGER._Processes

TASK_MANAGER._Scores

TASK_MANAGER._StartState

TASK_MANAGER._Transitions

TASK_MANAGER:_add_to_map(Map, Event)

Add to map.

TASK_MANAGER:_call_handler(step, trigger, params, EventName)

Call handler.

TASK_MANAGER:_create_transition(EventName)

Create transition.

TASK_MANAGER:_delayed_transition(EventName)

Delayed transition.

TASK_MANAGER:_eventmap(Events, EventStructure)

Event map.

TASK_MANAGER:_gosub(ParentFrom, ParentEvent)

Go sub.

TASK_MANAGER:_handler(EventName, ...)

Handler.

TASK_MANAGER:_isendstate(Current)

Is end state.

TASK_MANAGER:_submap(subs, sub, name)

Sub maps.

TASK_MANAGER:can(e)

Check if can do an event.

TASK_MANAGER:cannot(e)

Check if cannot do an event.

TASK_MANAGER.current

TASK_MANAGER.endstates

TASK_MANAGER:is(State, state)

Check if FSM is in state.

TASK_MANAGER.options

TASK_MANAGER.subs

TASK_MANAGER class.

Field(s)

Core.Set#SET_GROUP TASK_MANAGER.SetGroup

The set of group objects containing players for which tasks are managed.

Function(s)

Manages the tasks for the Core.Set#SET_GROUP.

Defined in:

TASK_MANAGER

Return value:

TASK_MANAGER constructor.

Defined in:

TASK_MANAGER

Parameter:

The set of group objects containing players for which tasks are managed.

Return value:

Aborted Handler OnAfter for TASK_MANAGER

Defined in:

TASK_MANAGER

Parameters:

#string From

#string Event

#string To

Cancelled Handler OnAfter for TASK_MANAGER

Defined in:

TASK_MANAGER

Parameters:

#string From

#string Event

#string To

Failed Handler OnAfter for TASK_MANAGER

Defined in:

TASK_MANAGER

Parameters:

#string From

#string Event

#string To

StartTasks Handler OnAfter for TASK_MANAGER

Defined in:

TASK_MANAGER

Parameters:

#string From

#string Event

#string To

StopTasks Handler OnAfter for TASK_MANAGER

Defined in:

TASK_MANAGER

Parameters:

#string From

#string Event

#string To

Success Handler OnAfter for TASK_MANAGER

Defined in:

TASK_MANAGER

Parameters:

#string From

#string Event

#string To

StartTasks Handler OnBefore for TASK_MANAGER

Defined in:

TASK_MANAGER

Parameters:

#string From

#string Event

#string To

Return value:

#boolean:

StopTasks Handler OnBefore for TASK_MANAGER

Defined in:

TASK_MANAGER

Parameters:

#string From

#string Event

#string To

Return value:

#boolean:

Set the refresh time interval in seconds when a new task management action needs to be done.

Defined in:

TASK_MANAGER

Parameter:

#number RefreshTimeInterval

The refresh time interval in seconds when a new task management action needs to be done.

Return value:

StartTasks Trigger for TASK_MANAGER

Defined in:

TASK_MANAGER

StopTasks Trigger for TASK_MANAGER

Defined in:

TASK_MANAGER

StartTasks Asynchronous Trigger for TASK_MANAGER

Defined in:

TASK_MANAGER

Parameter:

#number Delay

StopTasks Asynchronous Trigger for TASK_MANAGER

Defined in:

TASK_MANAGER

Parameter:

#number Delay

Defined in:

TASK_MANAGER

Parameters:

From

Event

To

Defined in:

TASK_MANAGER

Parameters:

From

Event

To

Field(s)

Core.Set#SET_GROUP TASK_MANAGER.SetGroup

The set of group objects containing players for which tasks are managed.

Function(s)

Adds an End state.

Defined in:

Parameter:

#string State

The FSM state.

Set the default #FSM_PROCESS template with key ProcessName providing the ProcessClass and the process object when it is assigned to a Wrapper.Controllable by the task.

Defined in:

Parameters:

#table From

Can contain a string indicating the From state or a table of strings containing multiple From states.

#string Event

The Event name.

An sub-process FSM.

#table ReturnEvents

A table indicating for which returned events of the SubFSM which Event must be triggered in the FSM.

Return value:

The SubFSM.

Adds a score for the FSM to be achieved.

Defined in:

Parameters:

#string State

is the state of the process when the score needs to be given. (See the relevant state descriptions of the process).

#string ScoreText

is a text describing the score that is given according the status.

#number Score

is a number providing the score of the status.

Return value:

#FSM:

self

Adds a score for the FSM_PROCESS to be achieved.

Defined in:

Parameters:

#string From

is the From State of the main process.

#string Event

is the Event of the main process.

#string State

is the state of the process when the score needs to be given. (See the relevant state descriptions of the process).

#string ScoreText

is a text describing the score that is given according the status.

#number Score

is a number providing the score of the status.

Return value:

#FSM:

self

Add a new transition rule to the FSM.

A transition rule defines when and if the FSM can transition from a state towards another state upon a triggered event.

Defined in:

Parameters:

#table From

Can contain a string indicating the From state or a table of strings containing multiple From states.

#string Event

The Event name.

#string To

The To state.

Get current state.

Defined in:

Return value:

#string:

Current FSM state.

Returns the End states.

Defined in:

Return value:

#table:

End states.

Defined in:

Parameters:

From

Event

Returns a table of the SubFSM rules defined within the FSM.

Defined in:

Return value:

#table:

Sub processes.

Returns a table with the scores defined.

Defined in:

Return value:

#table:

Scores.

Returns the start state of the FSM.

Defined in:

Return value:

#string:

A string containing the start state.

Get current state.

Defined in:

Return value:

#string:

Current FSM state.

Returns a table with the Subs defined.

Defined in:

Return value:

#table:

Sub processes.

Returns a table of the transition rules defined within the FSM.

Defined in:

Return value:

#table:

Transitions.

Check if FSM is in state.

Defined in:

Parameter:

#string State

State name.

Return value:

#boolean:

If true, FSM is in this state.

Load call backs.

Defined in:

Parameter:

#table CallBackTable

Table of call backs.

Creates a new FSM object.

Defined in:

Return value:

#FSM:

Defined in:

Parameters:

From

Event

Fsm

Sets the start state of the FSM.

Defined in:

Parameter:

#string State

A string defining the start state.

Add to map.

Defined in:

Parameters:

#table Map

Map.

#table Event

Event table.

Call handler.

Defined in:

Parameters:

#string step

Step "onafter", "onbefore", "onenter", "onleave".

#string trigger

Trigger.

#table params

Parameters.

#string EventName

Event name.

Return value:

Value.

Create transition.

Defined in:

Parameter:

#string EventName

Event name.

Return value:

#function:

Function.

Delayed transition.

Defined in:

Parameter:

#string EventName

Event name.

Return value:

#function:

Function.

Event map.

Defined in:

Parameters:

#table Events

Events.

#table EventStructure

Event structure.

Go sub.

Defined in:

Parameters:

#string ParentFrom

Parent from state.

#string ParentEvent

Parent event name.

Return value:

#table:

Subs.

Handler.

Defined in:

Parameters:

#string EventName

Event name.

...

Arguments.

Is end state.

Defined in:

Parameter:

#string Current

Current state name.

Return values:

#table:

FSM parent.

#string:

Event name.

Sub maps.

Defined in:

Parameters:

#table subs

Subs.

#table sub

Sub.

#string name

Name.

Check if can do an event.

Defined in:

Parameter:

#string e

Event name.

Return values:

#boolean:

If true, FSM can do the event.

#string:

To state.

Check if cannot do an event.

Defined in:

Parameter:

#string e

Event name.

Return value:

#boolean:

If true, FSM cannot do the event.

Check if FSM is in state.

Defined in:

Parameters:

#string State

State name.

state

Return value:

#boolean:

If true, FSM is in this state.