2017-01-05 08:42:07 +01:00

2267 lines
45 KiB
HTML

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<link rel="stylesheet" href="stylesheet.css" type="text/css"/>
</head>
<body>
<div id="container">
<div id="product">
<div id="product_logo"></div>
<div id="product_name"><big><b></b></big></div>
<div id="product_description"></div>
</div>
<div id="main">
<div id="navigation">
<h2>Modules</h2>
<ul><li>
<a href="index.html">index</a>
</li></ul>
<ul>
<li><a href="AI_Balancer.html">AI_Balancer</a></li>
<li><a href="Account.html">Account</a></li>
<li><a href="Airbase.html">Airbase</a></li>
<li><a href="AirbasePolice.html">AirbasePolice</a></li>
<li><a href="Assign.html">Assign</a></li>
<li><a href="Base.html">Base</a></li>
<li><a href="Cargo.html">Cargo</a></li>
<li><a href="CleanUp.html">CleanUp</a></li>
<li><a href="Client.html">Client</a></li>
<li><a href="CommandCenter.html">CommandCenter</a></li>
<li><a href="Controllable.html">Controllable</a></li>
<li><a href="Database.html">Database</a></li>
<li><a href="Detection.html">Detection</a></li>
<li><a href="Escort.html">Escort</a></li>
<li><a href="Event.html">Event</a></li>
<li>Fsm</li>
<li><a href="Group.html">Group</a></li>
<li><a href="Identifiable.html">Identifiable</a></li>
<li><a href="MOVEMENT.html">MOVEMENT</a></li>
<li><a href="Menu.html">Menu</a></li>
<li><a href="Message.html">Message</a></li>
<li><a href="MissileTrainer.html">MissileTrainer</a></li>
<li><a href="Mission.html">Mission</a></li>
<li><a href="Object.html">Object</a></li>
<li><a href="Patrol.html">Patrol</a></li>
<li><a href="Point.html">Point</a></li>
<li><a href="Positionable.html">Positionable</a></li>
<li><a href="Process_JTAC.html">Process_JTAC</a></li>
<li><a href="Process_Pickup.html">Process_Pickup</a></li>
<li><a href="Route.html">Route</a></li>
<li><a href="ScheduleDispatcher.html">ScheduleDispatcher</a></li>
<li><a href="Scheduler.html">Scheduler</a></li>
<li><a href="Scoring.html">Scoring</a></li>
<li><a href="Sead.html">Sead</a></li>
<li><a href="Set.html">Set</a></li>
<li><a href="Smoke.html">Smoke</a></li>
<li><a href="Spawn.html">Spawn</a></li>
<li><a href="Static.html">Static</a></li>
<li><a href="Task.html">Task</a></li>
<li><a href="Task_A2G.html">Task_A2G</a></li>
<li><a href="Task_PICKUP.html">Task_PICKUP</a></li>
<li><a href="Task_SEAD.html">Task_SEAD</a></li>
<li><a href="Unit.html">Unit</a></li>
<li><a href="Utils.html">Utils</a></li>
<li><a href="Zone.html">Zone</a></li>
<li><a href="routines.html">routines</a></li>
</ul>
</div>
<div id="content">
<h1>Module <code>Fsm</code></h1>
<p>This module contains the FSM class and derived FSM_ classes.</p>
<p>This development is based on a state machine implementation made by Conroy Kyle.
The state machine can be found here: https://github.com/kyleconroy/lua-state-machine</p>
<p>I've taken the development and enhanced it (actually rewrote it) to make the state machine hierarchical...
It is a fantastic development, this module.</p>
<hr/>
<p><img src="..\Presentations\FSM\Dia1.jpg" alt="Banner Image"/></p>
<h1>1) <a href="Core.Fsm.html##(FSM)">Core.Fsm#FSM</a> class, extends <a href="Core.Base.html##(BASE)">Core.Base#BASE</a></h1>
<p>A Finite State Machine (FSM) defines the rules of transitioning between various States triggered by Events.</p>
<ul>
<li>A <strong>State</strong> defines a moment in the process.</li>
<li>An <strong>Event</strong> describes an action, that can be triggered both internally as externally in the FSM. </li>
</ul>
<h2>1.1) Event Handling</h2>
<p><img src="..\Presentations\FSM\Dia3.jpg" alt="Event Handlers"/></p>
<p>An FSM transitions in <strong>4 moments</strong> when an Event is being handled. <br/>
Each moment can be catched by handling methods defined by the mission designer, <br/>
that will be called by the FSM while executing the transition. <br/>
These methods define the flow of the FSM process; because in those methods the FSM Internal Events will be fired.</p>
<ul>
<li>To handle <strong>State</strong> moments, create methods starting with OnLeave or OnEnter concatenated with the State name.</li>
<li>To handle <strong>Event</strong> moments, create methods starting with OnBefore or OnAfter concatenated with the Event name.</li>
</ul>
<p><strong>The OnLeave and OnBefore transition methods may return false, which will cancel the transition.</strong></p>
<h2>1.2) Event Triggers</h2>
<p><img src="..\Presentations\FSM\Dia4.jpg" alt="Event Triggers"/></p>
<p>The FSM creates for each Event <strong>two Event Trigger methods</strong>. <br/>
There are two modes how Events can be triggered, which is <strong>embedded</strong> and <strong>delayed</strong>:</p>
<ul>
<li>The method <strong>FSM:Event()</strong> triggers an Event that will be processed <strong>embedded</strong> or <strong>immediately</strong>.</li>
<li>The method <strong>FSM:__Event( seconds )</strong> triggers an Event that will be processed <strong>delayed</strong> over time, waiting x seconds.</li>
</ul>
<h2>1.3) FSM Transition Rules</h2>
<p>The FSM has transition rules that it follows and validates, as it walks the process.
These rules define when an FSM can transition from a specific state towards an other specific state upon a triggered event.</p>
<p>The method <a href="##(FSM).AddTransition">FSM.AddTransition</a>() specifies a new possible Transition Rule for the FSM. </p>
<p>The initial state can be defined using the method <a href="##(FSM).SetStartState">FSM.SetStartState</a>(). The default start state of an FSM is "None".</p>
<h3>Example</h3>
<p>This example creates a new FsmDemo object from class FSM.
It will set the start state of FsmDemo to Green.
2 Transition Rules are created, where upon the event Switch,
the FsmDemo will transition from state Green to Red and vise versa.</p>
<pre><code> local FsmDemo = FSM:New() -- #FsmDemo
FsmDemo:SetStartState( "Green" )
FsmDemo:AddTransition( "Green", "Switch", "Red" )
FsmDemo:AddTransition( "Red", "Switch", "Green" )
</code></pre>
<p>In the above example, the FsmDemo could flare every 5 seconds a Green or a Red flare into the air.
The next code implements this through the event handling method <strong>OnAfterSwitch</strong>.</p>
<pre><code> function FsmDemo:OnAfterSwitch( From, Event, To, FsmUnit )
self:E( { From, Event, To, FsmUnit } )
if From == "Green" then
FsmUnit:Flare(FLARECOLOR.Green)
else
if From == "Red" then
FsmUnit:Flare(FLARECOLOR.Red)
end
end
FsmDemo:__Switch( 5, FsmUnit ) -- Trigger the next Switch event to happen in 5 seconds.
end
FsmDemo:__Switch( 5, FsmUnit ) -- Trigger the first Switch event to happen in 5 seconds.
</code></pre>
<p>The OnAfterSwitch implements a loop. The last line of the code fragment triggers the Switch Event within 5 seconds.
Upon the event execution (after 5 seconds), the OnAfterSwitch method is called of FsmDemo (cfr. the double point notation!!! ":").
The OnAfterSwitch method receives from the FSM the 3 transition parameter details ( From, Event, To ),
and one additional parameter that was given when the event was triggered, which is in this case the Unit that is used within OnSwitchAfter.</p>
<pre><code> function FsmDemo:OnAfterSwitch( From, Event, To, FsmUnit )
</code></pre>
<p>For debugging reasons the received parameters are traced within the DCS.log.</p>
<pre><code> self:E( { From, Event, To, FsmUnit } )
</code></pre>
<p>The method will check if the From state received is either "Green" or "Red" and will flare the respective color from the FsmUnit.</p>
<pre><code> if From == "Green" then
FsmUnit:Flare(FLARECOLOR.Green)
else
if From == "Red" then
FsmUnit:Flare(FLARECOLOR.Red)
end
end
</code></pre>
<p>It is important that the Switch event is again triggered, otherwise, the FsmDemo would stop working after having the first Event being handled.</p>
<pre><code> FsmDemo:__Switch( 5, FsmUnit ) -- Trigger the next Switch event to happen in 5 seconds.
</code></pre>
<p>This example is fully implemented in the MOOSE test mission on GITHUB: <a href="https://github.com/FlightControl-Master/MOOSE/blob/master/Moose%20Test%20Missions/FSM%20-%20Finite%20State%20Machine/FSM-100%20-%20Transition%20Explanation/FSM-100%20-%20Transition%20Explanation.lua">FSM-100 - Transition Explanation</a></p>
<h3>Some additional comments:</h3>
<p>Note that transition rules can be declared with a few variations:</p>
<ul>
<li>The From states can be a table of strings, indicating that the transition rule will be valid if the current state of the FSM will be one of the given From states.</li>
<li>The From state can be a "*", indicating that the transition rule will always be valid, regardless of the current state of the FSM.</li>
</ul>
<p>This transition will create a new FsmDemo object from class FSM.
It will set the start state of FsmDemo to Green.
A new event is added in addition to the above example.
The new event Stop will cancel the Switching process.
So, the transtion for event Stop can be executed if the current state of the FSM is either "Red" or "Green".</p>
<pre><code> local FsmDemo = FSM:New() -- #FsmDemo
FsmDemo:SetStartState( "Green" )
FsmDemo:AddTransition( "Green", "Switch", "Red" )
FsmDemo:AddTransition( "Red", "Switch", "Green" )
FsmDemo:AddTransition( { "Red", "Green" }, "Stop", "Stopped" )
</code></pre>
<p>The transition for event Stop can also be simplified, as any current state of the FSM is valid.</p>
<pre><code> FsmDemo:AddTransition( "*", "Stop", "Stopped" )
</code></pre>
<h2>1.4) FSM Process Rules</h2>
<p>The FSM can implement sub-processes that will execute and return multiple possible states. <br/>
Depending upon which state is returned, the main FSM can continue tiggering different events.</p>
<p>The method <a href="##(FSM).AddProcess">FSM.AddProcess</a>() adds a new Sub-Process FSM to the FSM. <br/>
A Sub-Process will start the Sub-Process of the FSM upon the defined triggered Event,
with multiple possible States as a result.</p>
<hr/>
<h1><strong>API CHANGE HISTORY</strong></h1>
<p>The underlying change log documents the API changes. Please read this carefully. The following notation is used:</p>
<ul>
<li><strong>Added</strong> parts are expressed in bold type face.</li>
<li><em>Removed</em> parts are expressed in italic type face.</li>
</ul>
<p>YYYY-MM-DD: CLASS:<strong>NewFunction</strong>( Params ) replaces CLASS:<em>OldFunction</em>( Params )
YYYY-MM-DD: CLASS:<strong>NewFunction( Params )</strong> added</p>
<p>Hereby the change log:</p>
<ul>
<li>2016-12-18: Released.</li>
</ul>
<hr/>
<h1><strong>AUTHORS and CONTRIBUTIONS</strong></h1>
<h3>Contributions:</h3>
<ul>
<li>None.</li>
</ul>
<h3>Authors:</h3>
<ul>
<li><strong>FlightControl</strong>: Design &amp; Programming</li>
</ul>
<h2>Global(s)</h2>
<table class="function_list">
<tr>
<td class="name" nowrap="nowrap"><a href="#FSM">FSM</a></td>
<td class="summary">
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="#FSM_CONTROLLABLE">FSM_CONTROLLABLE</a></td>
<td class="summary">
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="#FSM_PROCESS">FSM_PROCESS</a></td>
<td class="summary">
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="#FSM_SET">FSM_SET</a></td>
<td class="summary">
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="#FSM_TASK">FSM_TASK</a></td>
<td class="summary">
</td>
</tr>
</table>
<h2><a id="#(FSM)">Type <code>FSM</code></a></h2>
<table class="function_list">
<tr>
<td class="name" nowrap="nowrap"><a href="##(FSM).AddEndState">FSM:AddEndState(State)</a></td>
<td class="summary">
<p>Adds an End state.</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(FSM).AddProcess">FSM:AddProcess(From, Event, Process, ReturnEvents)</a></td>
<td class="summary">
<p>Set the default <a href="Process.html">Process</a> template with key ProcessName providing the ProcessClass and the process object when it is assigned to a <a href="Controllable.html">Controllable</a> by the task.</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(FSM).AddScore">FSM:AddScore(State, ScoreText, Score)</a></td>
<td class="summary">
<p>Adds a score for the FSM to be achieved.</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(FSM).AddScoreProcess">FSM:AddScoreProcess(From, Event, State, ScoreText, Score)</a></td>
<td class="summary">
<p>Adds a score for the FSM_PROCESS to be achieved.</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(FSM).AddTransition">FSM:AddTransition(From, Event, To)</a></td>
<td class="summary">
<p>Add a new transition rule to the FSM.</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(FSM).ClassName">FSM.ClassName</a></td>
<td class="summary">
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(FSM).GetEndStates">FSM:GetEndStates()</a></td>
<td class="summary">
<p>Returns the End states.</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(FSM).GetProcess">FSM:GetProcess(From, Event)</a></td>
<td class="summary">
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(FSM).GetProcesses">FSM:GetProcesses()</a></td>
<td class="summary">
<p>Returns a table of the SubFSM rules defined within the FSM.</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(FSM).GetScores">FSM:GetScores()</a></td>
<td class="summary">
<p>Returns a table with the scores defined.</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(FSM).GetStartState">FSM:GetStartState()</a></td>
<td class="summary">
<p>Returns the start state of the FSM.</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(FSM).GetState">FSM:GetState()</a></td>
<td class="summary">
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(FSM).GetSubs">FSM:GetSubs()</a></td>
<td class="summary">
<p>Returns a table with the Subs defined.</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(FSM).GetTransitions">FSM:GetTransitions()</a></td>
<td class="summary">
<p>Returns a table of the transition rules defined within the FSM.</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(FSM).Is">FSM:Is(State)</a></td>
<td class="summary">
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(FSM).LoadCallBacks">FSM:LoadCallBacks(CallBackTable)</a></td>
<td class="summary">
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(FSM).New">FSM:New(FsmT)</a></td>
<td class="summary">
<p>Creates a new FSM object.</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(FSM).SetStartState">FSM:SetStartState(State)</a></td>
<td class="summary">
<p>Sets the start state of the FSM.</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(FSM)._StartState">FSM._StartState</a></td>
<td class="summary">
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(FSM)._add_to_map">FSM:_add_to_map(Map, Event)</a></td>
<td class="summary">
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(FSM)._call_handler">FSM:_call_handler(handler, params)</a></td>
<td class="summary">
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(FSM)._create_transition">FSM:_create_transition(EventName)</a></td>
<td class="summary">
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(FSM)._delayed_transition">FSM:_delayed_transition(EventName)</a></td>
<td class="summary">
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(FSM)._eventmap">FSM:_eventmap(Events, EventStructure)</a></td>
<td class="summary">
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(FSM)._gosub">FSM:_gosub(ParentFrom, ParentEvent)</a></td>
<td class="summary">
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(FSM)._handler">FSM:_handler(EventName, ...)</a></td>
<td class="summary">
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(FSM)._isendstate">FSM:_isendstate(Current)</a></td>
<td class="summary">
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(FSM)._submap">FSM:_submap(subs, sub, name)</a></td>
<td class="summary">
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(FSM).can">FSM:can(e)</a></td>
<td class="summary">
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(FSM).cannot">FSM:cannot(e)</a></td>
<td class="summary">
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(FSM).current">FSM.current</a></td>
<td class="summary">
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(FSM).is">FSM:is(state)</a></td>
<td class="summary">
</td>
</tr>
</table>
<h2><a id="#(FSM_CONTROLLABLE)">Type <code>FSM_CONTROLLABLE</code></a></h2>
<table class="function_list">
<tr>
<td class="name" nowrap="nowrap"><a href="##(FSM_CONTROLLABLE).ClassName">FSM_CONTROLLABLE.ClassName</a></td>
<td class="summary">
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(FSM_CONTROLLABLE).Controllable">FSM_CONTROLLABLE.Controllable</a></td>
<td class="summary">
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(FSM_CONTROLLABLE).GetControllable">FSM_CONTROLLABLE:GetControllable()</a></td>
<td class="summary">
<p>Gets the CONTROLLABLE object that the FSM_CONTROLLABLE governs.</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(FSM_CONTROLLABLE).New">FSM_CONTROLLABLE:New(FSMT, Controllable)</a></td>
<td class="summary">
<p>Creates a new FSM_CONTROLLABLE object.</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(FSM_CONTROLLABLE).SetControllable">FSM_CONTROLLABLE:SetControllable(FSMControllable)</a></td>
<td class="summary">
<p>Sets the CONTROLLABLE object that the FSM_CONTROLLABLE governs.</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(FSM_CONTROLLABLE)._call_handler">FSM_CONTROLLABLE:_call_handler(handler, params)</a></td>
<td class="summary">
</td>
</tr>
</table>
<h2><a id="#(FSM_PROCESS)">Type <code>FSM_PROCESS</code></a></h2>
<table class="function_list">
<tr>
<td class="name" nowrap="nowrap"><a href="##(FSM_PROCESS).AddScore">FSM_PROCESS:AddScore(State, ScoreText, Score)</a></td>
<td class="summary">
<p>Adds a score for the FSM_PROCESS to be achieved.</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(FSM_PROCESS).Assign">FSM_PROCESS:Assign(Task, ProcessUnit)</a></td>
<td class="summary">
<p>Assign the process to a <a href="Unit.html">Unit</a> and activate the process.</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(FSM_PROCESS).ClassName">FSM_PROCESS.ClassName</a></td>
<td class="summary">
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(FSM_PROCESS).Copy">FSM_PROCESS:Copy(Controllable, Task)</a></td>
<td class="summary">
<p>Creates a new FSM<em>PROCESS object based on this FSM</em>PROCESS.</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(FSM_PROCESS).GetCommandCenter">FSM_PROCESS:GetCommandCenter()</a></td>
<td class="summary">
<p>Gets the mission of the process.</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(FSM_PROCESS).GetMission">FSM_PROCESS:GetMission()</a></td>
<td class="summary">
<p>Gets the mission of the process.</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(FSM_PROCESS).GetTask">FSM_PROCESS:GetTask()</a></td>
<td class="summary">
<p>Gets the task of the process.</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(FSM_PROCESS).Init">FSM_PROCESS:Init(FsmProcess)</a></td>
<td class="summary">
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(FSM_PROCESS).Message">FSM_PROCESS:Message(Message)</a></td>
<td class="summary">
<p>Send a message of the <a href="Task.html">Task</a> to the Group of the Unit.</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(FSM_PROCESS).New">FSM_PROCESS:New(Controllable, Task)</a></td>
<td class="summary">
<p>Creates a new FSM_PROCESS object.</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(FSM_PROCESS).SetTask">FSM_PROCESS:SetTask(Task)</a></td>
<td class="summary">
<p>Sets the task of the process.</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(FSM_PROCESS).Task">FSM_PROCESS.Task</a></td>
<td class="summary">
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(FSM_PROCESS).onenterAssigned">FSM_PROCESS:onenterAssigned(ProcessUnit)</a></td>
<td class="summary">
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(FSM_PROCESS).onenterFailed">FSM_PROCESS:onenterFailed(ProcessUnit)</a></td>
<td class="summary">
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(FSM_PROCESS).onenterSuccess">FSM_PROCESS:onenterSuccess(ProcessUnit)</a></td>
<td class="summary">
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(FSM_PROCESS).onstatechange">FSM_PROCESS:onstatechange(ProcessUnit, Event, From, To, Dummy)</a></td>
<td class="summary">
<p>StateMachine callback function for a FSM_PROCESS</p>
</td>
</tr>
</table>
<h2><a id="#(FSM_SET)">Type <code>FSM_SET</code></a></h2>
<table class="function_list">
<tr>
<td class="name" nowrap="nowrap"><a href="##(FSM_SET).ClassName">FSM_SET.ClassName</a></td>
<td class="summary">
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(FSM_SET).Get">FSM_SET:Get()</a></td>
<td class="summary">
<p>Gets the SET<em>BASE object that the FSM</em>SET governs.</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(FSM_SET).New">FSM_SET:New(FSMT, Set_SET_BASE, FSMSet)</a></td>
<td class="summary">
<p>Creates a new FSM_SET object.</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(FSM_SET).Set">FSM_SET.Set</a></td>
<td class="summary">
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(FSM_SET)._call_handler">FSM_SET:_call_handler(handler, params)</a></td>
<td class="summary">
</td>
</tr>
</table>
<h2><a id="#(FSM_TASK)">Type <code>FSM_TASK</code></a></h2>
<table class="function_list">
<tr>
<td class="name" nowrap="nowrap"><a href="##(FSM_TASK).ClassName">FSM_TASK.ClassName</a></td>
<td class="summary">
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(FSM_TASK).New">FSM_TASK:New(FSMT, Task, TaskUnit)</a></td>
<td class="summary">
<p>Creates a new FSM_TASK object.</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(FSM_TASK).Task">FSM_TASK.Task</a></td>
<td class="summary">
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(FSM_TASK)._call_handler">FSM_TASK:_call_handler(handler, params)</a></td>
<td class="summary">
</td>
</tr>
</table>
<h2>Global(s)</h2>
<dl class="function">
<dt>
<em><a href="##(FSM)">#FSM</a></em>
<a id="FSM" >
<strong>FSM</strong>
</a>
</dt>
<dd>
</dd>
</dl>
<dl class="function">
<dt>
<em><a href="##(FSM_CONTROLLABLE)">#FSM_CONTROLLABLE</a></em>
<a id="FSM_CONTROLLABLE" >
<strong>FSM_CONTROLLABLE</strong>
</a>
</dt>
<dd>
</dd>
</dl>
<dl class="function">
<dt>
<em><a href="##(FSM_PROCESS)">#FSM_PROCESS</a></em>
<a id="FSM_PROCESS" >
<strong>FSM_PROCESS</strong>
</a>
</dt>
<dd>
</dd>
</dl>
<dl class="function">
<dt>
<em><a href="##(FSM_SET)">#FSM_SET</a></em>
<a id="FSM_SET" >
<strong>FSM_SET</strong>
</a>
</dt>
<dd>
</dd>
</dl>
<dl class="function">
<dt>
<em><a href="##(FSM_TASK)">#FSM_TASK</a></em>
<a id="FSM_TASK" >
<strong>FSM_TASK</strong>
</a>
</dt>
<dd>
</dd>
</dl>
<h2><a id="#(Fsm)" >Type <code>Fsm</code></a></h2>
<h2><a id="#(FSM)" >Type <code>FSM</code></a></h2>
<p>FSM class</p>
<h3>Field(s)</h3>
<dl class="function">
<dt>
<a id="#(FSM).AddEndState" >
<strong>FSM:AddEndState(State)</strong>
</a>
</dt>
<dd>
<p>Adds an End state.</p>
<h3>Parameter</h3>
<ul>
<li>
<p><code><em> State </em></code>: </p>
</li>
</ul>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(FSM).AddProcess" >
<strong>FSM:AddProcess(From, Event, Process, ReturnEvents)</strong>
</a>
</dt>
<dd>
<p>Set the default <a href="Process.html">Process</a> template with key ProcessName providing the ProcessClass and the process object when it is assigned to a <a href="Controllable.html">Controllable</a> by the task.</p>
<h3>Parameters</h3>
<ul>
<li>
<p><code><em>#table From </em></code>:
Can contain a string indicating the From state or a table of strings containing multiple From states.</p>
</li>
<li>
<p><code><em>#string Event </em></code>:
The Event name.</p>
</li>
<li>
<p><code><em><a href="Core.Fsm.html##(FSM_PROCESS)">Core.Fsm#FSM_PROCESS</a> Process </em></code>:
An sub-process FSM.</p>
</li>
<li>
<p><code><em>#table ReturnEvents </em></code>:
A table indicating for which returned events of the SubFSM which Event must be triggered in the FSM.</p>
</li>
</ul>
<h3>Return value</h3>
<p><em><a href="Core.Fsm.html##(FSM_PROCESS)">Core.Fsm#FSM_PROCESS</a>:</em>
The SubFSM.</p>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(FSM).AddScore" >
<strong>FSM:AddScore(State, ScoreText, Score)</strong>
</a>
</dt>
<dd>
<p>Adds a score for the FSM to be achieved.</p>
<h3>Parameters</h3>
<ul>
<li>
<p><code><em>#string State </em></code>:
is the state of the process when the score needs to be given. (See the relevant state descriptions of the process).</p>
</li>
<li>
<p><code><em>#string ScoreText </em></code>:
is a text describing the score that is given according the status.</p>
</li>
<li>
<p><code><em>#number Score </em></code>:
is a number providing the score of the status.</p>
</li>
</ul>
<h3>Return value</h3>
<p><em><a href="##(FSM)">#FSM</a>:</em>
self</p>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(FSM).AddScoreProcess" >
<strong>FSM:AddScoreProcess(From, Event, State, ScoreText, Score)</strong>
</a>
</dt>
<dd>
<p>Adds a score for the FSM_PROCESS to be achieved.</p>
<h3>Parameters</h3>
<ul>
<li>
<p><code><em>#string From </em></code>:
is the From State of the main process.</p>
</li>
<li>
<p><code><em>#string Event </em></code>:
is the Event of the main process.</p>
</li>
<li>
<p><code><em>#string State </em></code>:
is the state of the process when the score needs to be given. (See the relevant state descriptions of the process).</p>
</li>
<li>
<p><code><em>#string ScoreText </em></code>:
is a text describing the score that is given according the status.</p>
</li>
<li>
<p><code><em>#number Score </em></code>:
is a number providing the score of the status.</p>
</li>
</ul>
<h3>Return value</h3>
<p><em><a href="##(FSM)">#FSM</a>:</em>
self</p>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(FSM).AddTransition" >
<strong>FSM:AddTransition(From, Event, To)</strong>
</a>
</dt>
<dd>
<p>Add a new transition rule to the FSM.</p>
<p>A transition rule defines when and if the FSM can transition from a state towards another state upon a triggered event.</p>
<h3>Parameters</h3>
<ul>
<li>
<p><code><em>#table From </em></code>:
Can contain a string indicating the From state or a table of strings containing multiple From states.</p>
</li>
<li>
<p><code><em>#string Event </em></code>:
The Event name.</p>
</li>
<li>
<p><code><em>#string To </em></code>:
The To state.</p>
</li>
</ul>
</dd>
</dl>
<dl class="function">
<dt>
<em>#string</em>
<a id="#(FSM).ClassName" >
<strong>FSM.ClassName</strong>
</a>
</dt>
<dd>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(FSM).GetEndStates" >
<strong>FSM:GetEndStates()</strong>
</a>
</dt>
<dd>
<p>Returns the End states.</p>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(FSM).GetProcess" >
<strong>FSM:GetProcess(From, Event)</strong>
</a>
</dt>
<dd>
<h3>Parameters</h3>
<ul>
<li>
<p><code><em> From </em></code>: </p>
</li>
<li>
<p><code><em> Event </em></code>: </p>
</li>
</ul>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(FSM).GetProcesses" >
<strong>FSM:GetProcesses()</strong>
</a>
</dt>
<dd>
<p>Returns a table of the SubFSM rules defined within the FSM.</p>
<h3>Return value</h3>
<p><em>#table:</em></p>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(FSM).GetScores" >
<strong>FSM:GetScores()</strong>
</a>
</dt>
<dd>
<p>Returns a table with the scores defined.</p>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(FSM).GetStartState" >
<strong>FSM:GetStartState()</strong>
</a>
</dt>
<dd>
<p>Returns the start state of the FSM.</p>
<h3>Return value</h3>
<p><em>#string:</em>
A string containing the start state.</p>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(FSM).GetState" >
<strong>FSM:GetState()</strong>
</a>
</dt>
<dd>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(FSM).GetSubs" >
<strong>FSM:GetSubs()</strong>
</a>
</dt>
<dd>
<p>Returns a table with the Subs defined.</p>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(FSM).GetTransitions" >
<strong>FSM:GetTransitions()</strong>
</a>
</dt>
<dd>
<p>Returns a table of the transition rules defined within the FSM.</p>
<h3>Return value</h3>
<p><em>#table:</em></p>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(FSM).Is" >
<strong>FSM:Is(State)</strong>
</a>
</dt>
<dd>
<h3>Parameter</h3>
<ul>
<li>
<p><code><em> State </em></code>: </p>
</li>
</ul>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(FSM).LoadCallBacks" >
<strong>FSM:LoadCallBacks(CallBackTable)</strong>
</a>
</dt>
<dd>
<h3>Parameter</h3>
<ul>
<li>
<p><code><em> CallBackTable </em></code>: </p>
</li>
</ul>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(FSM).New" >
<strong>FSM:New(FsmT)</strong>
</a>
</dt>
<dd>
<p>Creates a new FSM object.</p>
<h3>Parameter</h3>
<ul>
<li>
<p><code><em> FsmT </em></code>: </p>
</li>
</ul>
<h3>Return value</h3>
<p><em><a href="##(FSM)">#FSM</a>:</em></p>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(FSM).SetStartState" >
<strong>FSM:SetStartState(State)</strong>
</a>
</dt>
<dd>
<p>Sets the start state of the FSM.</p>
<h3>Parameter</h3>
<ul>
<li>
<p><code><em>#string State </em></code>:
A string defining the start state.</p>
</li>
</ul>
</dd>
</dl>
<dl class="function">
<dt>
<em></em>
<a id="#(FSM)._StartState" >
<strong>FSM._StartState</strong>
</a>
</dt>
<dd>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(FSM)._add_to_map" >
<strong>FSM:_add_to_map(Map, Event)</strong>
</a>
</dt>
<dd>
<h3>Parameters</h3>
<ul>
<li>
<p><code><em> Map </em></code>: </p>
</li>
<li>
<p><code><em> Event </em></code>: </p>
</li>
</ul>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(FSM)._call_handler" >
<strong>FSM:_call_handler(handler, params)</strong>
</a>
</dt>
<dd>
<h3>Parameters</h3>
<ul>
<li>
<p><code><em> handler </em></code>: </p>
</li>
<li>
<p><code><em> params </em></code>: </p>
</li>
</ul>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(FSM)._create_transition" >
<strong>FSM:_create_transition(EventName)</strong>
</a>
</dt>
<dd>
<h3>Parameter</h3>
<ul>
<li>
<p><code><em> EventName </em></code>: </p>
</li>
</ul>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(FSM)._delayed_transition" >
<strong>FSM:_delayed_transition(EventName)</strong>
</a>
</dt>
<dd>
<h3>Parameter</h3>
<ul>
<li>
<p><code><em> EventName </em></code>: </p>
</li>
</ul>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(FSM)._eventmap" >
<strong>FSM:_eventmap(Events, EventStructure)</strong>
</a>
</dt>
<dd>
<h3>Parameters</h3>
<ul>
<li>
<p><code><em> Events </em></code>: </p>
</li>
<li>
<p><code><em> EventStructure </em></code>: </p>
</li>
</ul>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(FSM)._gosub" >
<strong>FSM:_gosub(ParentFrom, ParentEvent)</strong>
</a>
</dt>
<dd>
<h3>Parameters</h3>
<ul>
<li>
<p><code><em> ParentFrom </em></code>: </p>
</li>
<li>
<p><code><em> ParentEvent </em></code>: </p>
</li>
</ul>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(FSM)._handler" >
<strong>FSM:_handler(EventName, ...)</strong>
</a>
</dt>
<dd>
<h3>Parameters</h3>
<ul>
<li>
<p><code><em> EventName </em></code>: </p>
</li>
<li>
<p><code><em> ... </em></code>: </p>
</li>
</ul>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(FSM)._isendstate" >
<strong>FSM:_isendstate(Current)</strong>
</a>
</dt>
<dd>
<h3>Parameter</h3>
<ul>
<li>
<p><code><em> Current </em></code>: </p>
</li>
</ul>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(FSM)._submap" >
<strong>FSM:_submap(subs, sub, name)</strong>
</a>
</dt>
<dd>
<h3>Parameters</h3>
<ul>
<li>
<p><code><em> subs </em></code>: </p>
</li>
<li>
<p><code><em> sub </em></code>: </p>
</li>
<li>
<p><code><em> name </em></code>: </p>
</li>
</ul>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(FSM).can" >
<strong>FSM:can(e)</strong>
</a>
</dt>
<dd>
<h3>Parameter</h3>
<ul>
<li>
<p><code><em> e </em></code>: </p>
</li>
</ul>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(FSM).cannot" >
<strong>FSM:cannot(e)</strong>
</a>
</dt>
<dd>
<h3>Parameter</h3>
<ul>
<li>
<p><code><em> e </em></code>: </p>
</li>
</ul>
</dd>
</dl>
<dl class="function">
<dt>
<em></em>
<a id="#(FSM).current" >
<strong>FSM.current</strong>
</a>
</dt>
<dd>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(FSM).is" >
<strong>FSM:is(state)</strong>
</a>
</dt>
<dd>
<h3>Parameter</h3>
<ul>
<li>
<p><code><em> state </em></code>: </p>
</li>
</ul>
</dd>
</dl>
<h2><a id="#(FSM_CONTROLLABLE)" >Type <code>FSM_CONTROLLABLE</code></a></h2>
<p>FSM_CONTROLLABLE class</p>
<h3>Field(s)</h3>
<dl class="function">
<dt>
<em>#string</em>
<a id="#(FSM_CONTROLLABLE).ClassName" >
<strong>FSM_CONTROLLABLE.ClassName</strong>
</a>
</dt>
<dd>
</dd>
</dl>
<dl class="function">
<dt>
<em><a href="Wrapper.Controllable.html##(CONTROLLABLE)">Wrapper.Controllable#CONTROLLABLE</a></em>
<a id="#(FSM_CONTROLLABLE).Controllable" >
<strong>FSM_CONTROLLABLE.Controllable</strong>
</a>
</dt>
<dd>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(FSM_CONTROLLABLE).GetControllable" >
<strong>FSM_CONTROLLABLE:GetControllable()</strong>
</a>
</dt>
<dd>
<p>Gets the CONTROLLABLE object that the FSM_CONTROLLABLE governs.</p>
<h3>Return value</h3>
<p><em><a href="Wrapper.Controllable.html##(CONTROLLABLE)">Wrapper.Controllable#CONTROLLABLE</a>:</em></p>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(FSM_CONTROLLABLE).New" >
<strong>FSM_CONTROLLABLE:New(FSMT, Controllable)</strong>
</a>
</dt>
<dd>
<p>Creates a new FSM_CONTROLLABLE object.</p>
<h3>Parameters</h3>
<ul>
<li>
<p><code><em>#table FSMT </em></code>:
Finite State Machine Table</p>
</li>
<li>
<p><code><em><a href="Wrapper.Controllable.html##(CONTROLLABLE)">Wrapper.Controllable#CONTROLLABLE</a> Controllable </em></code>:
(optional) The CONTROLLABLE object that the FSM_CONTROLLABLE governs.</p>
</li>
</ul>
<h3>Return value</h3>
<p><em><a href="##(FSM_CONTROLLABLE)">#FSM_CONTROLLABLE</a>:</em></p>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(FSM_CONTROLLABLE).SetControllable" >
<strong>FSM_CONTROLLABLE:SetControllable(FSMControllable)</strong>
</a>
</dt>
<dd>
<p>Sets the CONTROLLABLE object that the FSM_CONTROLLABLE governs.</p>
<h3>Parameter</h3>
<ul>
<li>
<p><code><em><a href="Wrapper.Controllable.html##(CONTROLLABLE)">Wrapper.Controllable#CONTROLLABLE</a> FSMControllable </em></code>: </p>
</li>
</ul>
<h3>Return value</h3>
<p><em><a href="##(FSM_CONTROLLABLE)">#FSM_CONTROLLABLE</a>:</em></p>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(FSM_CONTROLLABLE)._call_handler" >
<strong>FSM_CONTROLLABLE:_call_handler(handler, params)</strong>
</a>
</dt>
<dd>
<h3>Parameters</h3>
<ul>
<li>
<p><code><em> handler </em></code>: </p>
</li>
<li>
<p><code><em> params </em></code>: </p>
</li>
</ul>
</dd>
</dl>
<h2><a id="#(FSM_PROCESS)" >Type <code>FSM_PROCESS</code></a></h2>
<p>FSM_PROCESS class</p>
<h3>Field(s)</h3>
<dl class="function">
<dt>
<a id="#(FSM_PROCESS).AddScore" >
<strong>FSM_PROCESS:AddScore(State, ScoreText, Score)</strong>
</a>
</dt>
<dd>
<p>Adds a score for the FSM_PROCESS to be achieved.</p>
<h3>Parameters</h3>
<ul>
<li>
<p><code><em>#string State </em></code>:
is the state of the process when the score needs to be given. (See the relevant state descriptions of the process).</p>
</li>
<li>
<p><code><em>#string ScoreText </em></code>:
is a text describing the score that is given according the status.</p>
</li>
<li>
<p><code><em>#number Score </em></code>:
is a number providing the score of the status.</p>
</li>
</ul>
<h3>Return value</h3>
<p><em><a href="##(FSM_PROCESS)">#FSM_PROCESS</a>:</em>
self</p>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(FSM_PROCESS).Assign" >
<strong>FSM_PROCESS:Assign(Task, ProcessUnit)</strong>
</a>
</dt>
<dd>
<p>Assign the process to a <a href="Unit.html">Unit</a> and activate the process.</p>
<h3>Parameters</h3>
<ul>
<li>
<p><code><em><a href="Task.Tasking.html##(TASK)">Task.Tasking#TASK</a> Task </em></code>: </p>
</li>
<li>
<p><code><em><a href="Wrapper.Unit.html##(UNIT)">Wrapper.Unit#UNIT</a> ProcessUnit </em></code>: </p>
</li>
</ul>
<h3>Return value</h3>
<p><em><a href="##(FSM_PROCESS)">#FSM_PROCESS</a>:</em>
self</p>
</dd>
</dl>
<dl class="function">
<dt>
<em>#string</em>
<a id="#(FSM_PROCESS).ClassName" >
<strong>FSM_PROCESS.ClassName</strong>
</a>
</dt>
<dd>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(FSM_PROCESS).Copy" >
<strong>FSM_PROCESS:Copy(Controllable, Task)</strong>
</a>
</dt>
<dd>
<p>Creates a new FSM<em>PROCESS object based on this FSM</em>PROCESS.</p>
<h3>Parameters</h3>
<ul>
<li>
<p><code><em> Controllable </em></code>: </p>
</li>
<li>
<p><code><em> Task </em></code>: </p>
</li>
</ul>
<h3>Return value</h3>
<p><em><a href="##(FSM_PROCESS)">#FSM_PROCESS</a>:</em></p>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(FSM_PROCESS).GetCommandCenter" >
<strong>FSM_PROCESS:GetCommandCenter()</strong>
</a>
</dt>
<dd>
<p>Gets the mission of the process.</p>
<h3>Return value</h3>
<p><em><a href="Tasking.CommandCenter.html##(COMMANDCENTER)">Tasking.CommandCenter#COMMANDCENTER</a>:</em></p>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(FSM_PROCESS).GetMission" >
<strong>FSM_PROCESS:GetMission()</strong>
</a>
</dt>
<dd>
<p>Gets the mission of the process.</p>
<h3>Return value</h3>
<p><em><a href="Tasking.Mission.html##(MISSION)">Tasking.Mission#MISSION</a>:</em></p>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(FSM_PROCESS).GetTask" >
<strong>FSM_PROCESS:GetTask()</strong>
</a>
</dt>
<dd>
<p>Gets the task of the process.</p>
<h3>Return value</h3>
<p><em><a href="Tasking.Task.html##(TASK)">Tasking.Task#TASK</a>:</em></p>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(FSM_PROCESS).Init" >
<strong>FSM_PROCESS:Init(FsmProcess)</strong>
</a>
</dt>
<dd>
<h3>Parameter</h3>
<ul>
<li>
<p><code><em> FsmProcess </em></code>: </p>
</li>
</ul>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(FSM_PROCESS).Message" >
<strong>FSM_PROCESS:Message(Message)</strong>
</a>
</dt>
<dd>
<p>Send a message of the <a href="Task.html">Task</a> to the Group of the Unit.</p>
<h3>Parameter</h3>
<ul>
<li>
<p><code><em> Message </em></code>: </p>
</li>
</ul>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(FSM_PROCESS).New" >
<strong>FSM_PROCESS:New(Controllable, Task)</strong>
</a>
</dt>
<dd>
<p>Creates a new FSM_PROCESS object.</p>
<h3>Parameters</h3>
<ul>
<li>
<p><code><em> Controllable </em></code>: </p>
</li>
<li>
<p><code><em> Task </em></code>: </p>
</li>
</ul>
<h3>Return value</h3>
<p><em><a href="##(FSM_PROCESS)">#FSM_PROCESS</a>:</em></p>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(FSM_PROCESS).SetTask" >
<strong>FSM_PROCESS:SetTask(Task)</strong>
</a>
</dt>
<dd>
<p>Sets the task of the process.</p>
<h3>Parameter</h3>
<ul>
<li>
<p><code><em><a href="Tasking.Task.html##(TASK)">Tasking.Task#TASK</a> Task </em></code>: </p>
</li>
</ul>
<h3>Return value</h3>
<p><em><a href="##(FSM_PROCESS)">#FSM_PROCESS</a>:</em></p>
</dd>
</dl>
<dl class="function">
<dt>
<em><a href="Tasking.Task.html##(TASK)">Tasking.Task#TASK</a></em>
<a id="#(FSM_PROCESS).Task" >
<strong>FSM_PROCESS.Task</strong>
</a>
</dt>
<dd>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(FSM_PROCESS).onenterAssigned" >
<strong>FSM_PROCESS:onenterAssigned(ProcessUnit)</strong>
</a>
</dt>
<dd>
<h3>Parameter</h3>
<ul>
<li>
<p><code><em> ProcessUnit </em></code>: </p>
</li>
</ul>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(FSM_PROCESS).onenterFailed" >
<strong>FSM_PROCESS:onenterFailed(ProcessUnit)</strong>
</a>
</dt>
<dd>
<h3>Parameter</h3>
<ul>
<li>
<p><code><em> ProcessUnit </em></code>: </p>
</li>
</ul>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(FSM_PROCESS).onenterSuccess" >
<strong>FSM_PROCESS:onenterSuccess(ProcessUnit)</strong>
</a>
</dt>
<dd>
<h3>Parameter</h3>
<ul>
<li>
<p><code><em> ProcessUnit </em></code>: </p>
</li>
</ul>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(FSM_PROCESS).onstatechange" >
<strong>FSM_PROCESS:onstatechange(ProcessUnit, Event, From, To, Dummy)</strong>
</a>
</dt>
<dd>
<p>StateMachine callback function for a FSM_PROCESS</p>
<h3>Parameters</h3>
<ul>
<li>
<p><code><em><a href="Wrapper.Controllable.html##(CONTROLLABLE)">Wrapper.Controllable#CONTROLLABLE</a> ProcessUnit </em></code>: </p>
</li>
<li>
<p><code><em>#string Event </em></code>: </p>
</li>
<li>
<p><code><em>#string From </em></code>: </p>
</li>
<li>
<p><code><em>#string To </em></code>: </p>
</li>
<li>
<p><code><em> Dummy </em></code>: </p>
</li>
</ul>
</dd>
</dl>
<h2><a id="#(FSM_SET)" >Type <code>FSM_SET</code></a></h2>
<p>FSM_SET class</p>
<h3>Field(s)</h3>
<dl class="function">
<dt>
<em>#string</em>
<a id="#(FSM_SET).ClassName" >
<strong>FSM_SET.ClassName</strong>
</a>
</dt>
<dd>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(FSM_SET).Get" >
<strong>FSM_SET:Get()</strong>
</a>
</dt>
<dd>
<p>Gets the SET<em>BASE object that the FSM</em>SET governs.</p>
<h3>Return value</h3>
<p><em><a href="Core.Set.html##(SET_BASE)">Core.Set#SET_BASE</a>:</em></p>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(FSM_SET).New" >
<strong>FSM_SET:New(FSMT, Set_SET_BASE, FSMSet)</strong>
</a>
</dt>
<dd>
<p>Creates a new FSM_SET object.</p>
<h3>Parameters</h3>
<ul>
<li>
<p><code><em>#table FSMT </em></code>:
Finite State Machine Table</p>
</li>
<li>
<p><code><em> Set<em>SET</em>BASE </em></code>:
FSMSet (optional) The Set object that the FSM_SET governs.</p>
</li>
<li>
<p><code><em> FSMSet </em></code>: </p>
</li>
</ul>
<h3>Return value</h3>
<p><em><a href="##(FSM_SET)">#FSM_SET</a>:</em></p>
</dd>
</dl>
<dl class="function">
<dt>
<em><a href="Core.Set.html##(SET_BASE)">Core.Set#SET_BASE</a></em>
<a id="#(FSM_SET).Set" >
<strong>FSM_SET.Set</strong>
</a>
</dt>
<dd>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(FSM_SET)._call_handler" >
<strong>FSM_SET:_call_handler(handler, params)</strong>
</a>
</dt>
<dd>
<h3>Parameters</h3>
<ul>
<li>
<p><code><em> handler </em></code>: </p>
</li>
<li>
<p><code><em> params </em></code>: </p>
</li>
</ul>
</dd>
</dl>
<h2><a id="#(FSM_TASK)" >Type <code>FSM_TASK</code></a></h2>
<p>FSM_TASK class</p>
<h3>Field(s)</h3>
<dl class="function">
<dt>
<em>#string</em>
<a id="#(FSM_TASK).ClassName" >
<strong>FSM_TASK.ClassName</strong>
</a>
</dt>
<dd>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(FSM_TASK).New" >
<strong>FSM_TASK:New(FSMT, Task, TaskUnit)</strong>
</a>
</dt>
<dd>
<p>Creates a new FSM_TASK object.</p>
<h3>Parameters</h3>
<ul>
<li>
<p><code><em>#table FSMT </em></code>: </p>
</li>
<li>
<p><code><em><a href="Tasking.Task.html##(TASK)">Tasking.Task#TASK</a> Task </em></code>: </p>
</li>
<li>
<p><code><em><a href="Wrapper.Unit.html##(UNIT)">Wrapper.Unit#UNIT</a> TaskUnit </em></code>: </p>
</li>
</ul>
<h3>Return value</h3>
<p><em><a href="##(FSM_TASK)">#FSM_TASK</a>:</em></p>
</dd>
</dl>
<dl class="function">
<dt>
<em><a href="Tasking.Task.html##(TASK)">Tasking.Task#TASK</a></em>
<a id="#(FSM_TASK).Task" >
<strong>FSM_TASK.Task</strong>
</a>
</dt>
<dd>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(FSM_TASK)._call_handler" >
<strong>FSM_TASK:_call_handler(handler, params)</strong>
</a>
</dt>
<dd>
<h3>Parameters</h3>
<ul>
<li>
<p><code><em> handler </em></code>: </p>
</li>
<li>
<p><code><em> params </em></code>: </p>
</li>
</ul>
</dd>
</dl>
</div>
</div>
</body>
</html>