mirror of
https://github.com/FlightControl-Master/MOOSE.git
synced 2025-08-15 10:47:21 +00:00
689 lines
23 KiB
HTML
689 lines
23 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_A2A.html">AI_A2A</a></li>
|
|
<li><a href="AI_A2A_Cap.html">AI_A2A_Cap</a></li>
|
|
<li><a href="AI_A2A_Dispatcher.html">AI_A2A_Dispatcher</a></li>
|
|
<li><a href="AI_A2A_GCI.html">AI_A2A_GCI</a></li>
|
|
<li><a href="AI_A2A_Patrol.html">AI_A2A_Patrol</a></li>
|
|
<li><a href="AI_Bai.html">AI_Bai</a></li>
|
|
<li><a href="AI_Balancer.html">AI_Balancer</a></li>
|
|
<li><a href="AI_Cap.html">AI_Cap</a></li>
|
|
<li><a href="AI_Cas.html">AI_Cas</a></li>
|
|
<li><a href="AI_Formation.html">AI_Formation</a></li>
|
|
<li><a href="AI_Patrol.html">AI_Patrol</a></li>
|
|
<li><a href="ATC_Ground.html">ATC_Ground</a></li>
|
|
<li><a href="Account.html">Account</a></li>
|
|
<li><a href="Airbase.html">Airbase</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="DCSAirbase.html">DCSAirbase</a></li>
|
|
<li><a href="DCSCoalitionObject.html">DCSCoalitionObject</a></li>
|
|
<li><a href="DCSCommand.html">DCSCommand</a></li>
|
|
<li><a href="DCSController.html">DCSController</a></li>
|
|
<li><a href="DCSGroup.html">DCSGroup</a></li>
|
|
<li><a href="DCSObject.html">DCSObject</a></li>
|
|
<li><a href="DCSTask.html">DCSTask</a></li>
|
|
<li><a href="DCSTypes.html">DCSTypes</a></li>
|
|
<li><a href="DCSUnit.html">DCSUnit</a></li>
|
|
<li><a href="DCSVec3.html">DCSVec3</a></li>
|
|
<li><a href="DCSWorld.html">DCSWorld</a></li>
|
|
<li><a href="DCSZone.html">DCSZone</a></li>
|
|
<li><a href="DCScountry.html">DCScountry</a></li>
|
|
<li><a href="DCStimer.html">DCStimer</a></li>
|
|
<li><a href="DCStrigger.html">DCStrigger</a></li>
|
|
<li><a href="Database.html">Database</a></li>
|
|
<li><a href="Designate.html">Designate</a></li>
|
|
<li><a href="Detection.html">Detection</a></li>
|
|
<li><a href="DetectionManager.html">DetectionManager</a></li>
|
|
<li><a href="Escort.html">Escort</a></li>
|
|
<li><a href="Event.html">Event</a></li>
|
|
<li><a href="Fsm.html">Fsm</a></li>
|
|
<li><a href="Goal.html">Goal</a></li>
|
|
<li><a href="Group.html">Group</a></li>
|
|
<li><a href="Identifiable.html">Identifiable</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="Movement.html">Movement</a></li>
|
|
<li><a href="Object.html">Object</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="Protect.html">Protect</a></li>
|
|
<li><a href="Radio.html">Radio</a></li>
|
|
<li><a href="Rat.html">Rat</a></li>
|
|
<li><a href="Route.html">Route</a></li>
|
|
<li><a href="Scenery.html">Scenery</a></li>
|
|
<li><a href="ScheduleDispatcher.html">ScheduleDispatcher</a></li>
|
|
<li>Scheduler</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="Settings.html">Settings</a></li>
|
|
<li><a href="Smoke.html">Smoke</a></li>
|
|
<li><a href="Spawn.html">Spawn</a></li>
|
|
<li><a href="SpawnStatic.html">SpawnStatic</a></li>
|
|
<li><a href="Spot.html">Spot</a></li>
|
|
<li><a href="Static.html">Static</a></li>
|
|
<li><a href="StaticObject.html">StaticObject</a></li>
|
|
<li><a href="Task.html">Task</a></li>
|
|
<li><a href="TaskZoneCapture.html">TaskZoneCapture</a></li>
|
|
<li><a href="Task_A2A.html">Task_A2A</a></li>
|
|
<li><a href="Task_A2A_Dispatcher.html">Task_A2A_Dispatcher</a></li>
|
|
<li><a href="Task_A2G.html">Task_A2G</a></li>
|
|
<li><a href="Task_A2G_Dispatcher.html">Task_A2G_Dispatcher</a></li>
|
|
<li><a href="Task_Cargo.html">Task_Cargo</a></li>
|
|
<li><a href="Task_PICKUP.html">Task_PICKUP</a></li>
|
|
<li><a href="Unit.html">Unit</a></li>
|
|
<li><a href="UserFlag.html">UserFlag</a></li>
|
|
<li><a href="UserSound.html">UserSound</a></li>
|
|
<li><a href="Utils.html">Utils</a></li>
|
|
<li><a href="Velocity.html">Velocity</a></li>
|
|
<li><a href="Zone.html">Zone</a></li>
|
|
<li><a href="ZoneCaptureCoalition.html">ZoneCaptureCoalition</a></li>
|
|
<li><a href="ZoneGoal.html">ZoneGoal</a></li>
|
|
<li><a href="ZoneGoalCargo.html">ZoneGoalCargo</a></li>
|
|
<li><a href="ZoneGoalCoalition.html">ZoneGoalCoalition</a></li>
|
|
<li><a href="env.html">env</a></li>
|
|
<li><a href="land.html">land</a></li>
|
|
<li><a href="routines.html">routines</a></li>
|
|
</ul>
|
|
</div>
|
|
<div id="content">
|
|
<h1>Module <code>Scheduler</code></h1>
|
|
|
|
<p><strong>Core</strong> -- SCHEDULER prepares and handles the <strong>execution of functions over scheduled time (intervals)</strong>.</p>
|
|
|
|
|
|
|
|
<p><img src="..\Presentations\SCHEDULER\Dia1.JPG" alt="Banner Image"/></p>
|
|
|
|
<hr/>
|
|
|
|
<p>SCHEDULER manages the <strong>scheduling of functions</strong>:</p>
|
|
|
|
<ul>
|
|
<li>optionally in an optional specified time interval, </li>
|
|
<li>optionally <strong>repeating</strong> with a specified time repeat interval, </li>
|
|
<li>optionally <strong>randomizing</strong> with a specified time interval randomization factor, </li>
|
|
<li>optionally <strong>stop</strong> the repeating after a specified time interval. </li>
|
|
</ul>
|
|
|
|
<hr/>
|
|
|
|
<h1>Demo Missions</h1>
|
|
|
|
<h3><a href="https://github.com/FlightControl-Master/MOOSE_MISSIONS/tree/master-release/SCH%20-%20Scheduler">SCHEDULER Demo Missions source code</a></h3>
|
|
|
|
<h3><a href="https://github.com/FlightControl-Master/MOOSE_MISSIONS/tree/master/SCH%20-%20Scheduler">SCHEDULER Demo Missions, only for beta testers</a></h3>
|
|
|
|
<h3><a href="https://github.com/FlightControl-Master/MOOSE_MISSIONS/releases">ALL Demo Missions pack of the last release</a></h3>
|
|
|
|
<hr/>
|
|
|
|
<h1>YouTube Channel</h1>
|
|
|
|
<h3><a href="">SCHEDULER YouTube Channel (none)</a></h3>
|
|
|
|
<hr/>
|
|
|
|
<h3>Contributions:</h3>
|
|
|
|
<ul>
|
|
<li>FlightControl : Concept & Testing</li>
|
|
</ul>
|
|
|
|
<h3>Authors:</h3>
|
|
|
|
<ul>
|
|
<li>FlightControl : Design & Programming</li>
|
|
</ul>
|
|
|
|
<hr/>
|
|
|
|
|
|
<h2>Global(s)</h2>
|
|
<table class="function_list">
|
|
<tr>
|
|
<td class="name" nowrap="nowrap"><a href="#SCHEDULER">SCHEDULER</a></td>
|
|
<td class="summary">
|
|
<h1>SCHEDULER class, extends <a href="Base.html##(BASE)">Base#BASE</a></h1>
|
|
|
|
<p>The SCHEDULER class creates schedule.</p>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
<h2><a id="#(SCHEDULER)">Type <code>SCHEDULER</code></a></h2>
|
|
<table class="function_list">
|
|
<tr>
|
|
<td class="name" nowrap="nowrap"><a href="##(SCHEDULER).Clear">SCHEDULER:Clear()</a></td>
|
|
<td class="summary">
|
|
<p>Clears all pending schedules.</p>
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="name" nowrap="nowrap"><a href="##(SCHEDULER).MasterObject">SCHEDULER.MasterObject</a></td>
|
|
<td class="summary">
|
|
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="name" nowrap="nowrap"><a href="##(SCHEDULER).New">SCHEDULER:New(SchedulerObject, SchedulerFunction, SchedulerArguments, Start, Repeat, RandomizeFactor, Stop)</a></td>
|
|
<td class="summary">
|
|
<p>SCHEDULER constructor.</p>
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="name" nowrap="nowrap"><a href="##(SCHEDULER).Remove">SCHEDULER:Remove(ScheduleID)</a></td>
|
|
<td class="summary">
|
|
<p>Removes a specific schedule if a valid ScheduleID is provided.</p>
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="name" nowrap="nowrap"><a href="##(SCHEDULER).Schedule">SCHEDULER:Schedule(SchedulerObject, SchedulerFunction, SchedulerArguments, Start, Repeat, RandomizeFactor, Stop)</a></td>
|
|
<td class="summary">
|
|
<p>Schedule a new time event.</p>
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="name" nowrap="nowrap"><a href="##(SCHEDULER).ScheduleID">SCHEDULER.ScheduleID</a></td>
|
|
<td class="summary">
|
|
<p>the ID of the scheduler.</p>
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="name" nowrap="nowrap"><a href="##(SCHEDULER).SchedulerObject">SCHEDULER.SchedulerObject</a></td>
|
|
<td class="summary">
|
|
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="name" nowrap="nowrap"><a href="##(SCHEDULER).Start">SCHEDULER:Start(ScheduleID)</a></td>
|
|
<td class="summary">
|
|
<p>(Re-)Starts the schedules or a specific schedule if a valid ScheduleID is provided.</p>
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td class="name" nowrap="nowrap"><a href="##(SCHEDULER).Stop">SCHEDULER:Stop(ScheduleID)</a></td>
|
|
<td class="summary">
|
|
<p>Stops the schedules or a specific schedule if a valid ScheduleID is provided.</p>
|
|
</td>
|
|
</tr>
|
|
</table>
|
|
|
|
<h2>Global(s)</h2>
|
|
<dl class="function">
|
|
<dt>
|
|
|
|
<em><a href="##(SCHEDULER)">#SCHEDULER</a></em>
|
|
<a id="SCHEDULER" >
|
|
<strong>SCHEDULER</strong>
|
|
</a>
|
|
</dt>
|
|
<dd>
|
|
|
|
<h1>SCHEDULER class, extends <a href="Base.html##(BASE)">Base#BASE</a></h1>
|
|
|
|
<p>The SCHEDULER class creates schedule.</p>
|
|
|
|
|
|
|
|
<p>A SCHEDULER can manage <strong>multiple</strong> (repeating) schedules. Each planned or executing schedule has a unique <strong>ScheduleID</strong>.
|
|
The ScheduleID is returned when the method <a href="##(SCHEDULER).Schedule">SCHEDULER.Schedule</a>() is called.
|
|
It is recommended to store the ScheduleID in a variable, as it is used in the methods <a href="SCHEDULER.Start.html">SCHEDULER.Start</a>() and <a href="SCHEDULER.Stop.html">SCHEDULER.Stop</a>(),
|
|
which can start and stop specific repeating schedules respectively within a SCHEDULER object.</p>
|
|
|
|
<h2>SCHEDULER constructor</h2>
|
|
|
|
<p>The SCHEDULER class is quite easy to use, but note that the New constructor has variable parameters:</p>
|
|
|
|
<p>The <a href="##(SCHEDULER).New">SCHEDULER.New</a>() method returns 2 variables:</p>
|
|
|
|
<ol>
|
|
<li>The SCHEDULER object reference.</li>
|
|
<li>The first schedule planned in the SCHEDULER object.</li>
|
|
</ol>
|
|
|
|
<p>To clarify the different appliances, lets have a look at the following examples: </p>
|
|
|
|
<h3>Construct a SCHEDULER object without a persistent schedule.</h3>
|
|
|
|
<ul>
|
|
<li><p><a href="##(SCHEDULER).New">SCHEDULER.New</a>( nil ): Setup a new SCHEDULER object, which is persistently executed after garbage collection.</p>
|
|
|
|
<p>SchedulerObject = SCHEDULER:New()
|
|
SchedulerID = SchedulerObject:Schedule( nil, ScheduleFunction, {} )</p></li>
|
|
</ul>
|
|
|
|
<p>The above example creates a new SchedulerObject, but does not schedule anything.
|
|
A separate schedule is created by using the SchedulerObject using the method :Schedule..., which returns a ScheduleID</p>
|
|
|
|
<h3>Construct a SCHEDULER object without a volatile schedule, but volatile to the Object existence...</h3>
|
|
|
|
<ul>
|
|
<li><p><a href="##(SCHEDULER).New">SCHEDULER.New</a>( Object ): Setup a new SCHEDULER object, which is linked to the Object. When the Object is nillified or destroyed, the SCHEDULER object will also be destroyed and stopped after garbage collection.</p>
|
|
|
|
<p>ZoneObject = ZONE:New( "ZoneName" )
|
|
SchedulerObject = SCHEDULER:New( ZoneObject )
|
|
SchedulerID = SchedulerObject:Schedule( ZoneObject, ScheduleFunction, {} )
|
|
...
|
|
ZoneObject = nil
|
|
garbagecollect()</p></li>
|
|
</ul>
|
|
|
|
<p>The above example creates a new SchedulerObject, but does not schedule anything, and is bound to the existence of ZoneObject, which is a ZONE.
|
|
A separate schedule is created by using the SchedulerObject using the method :Schedule()..., which returns a ScheduleID
|
|
Later in the logic, the ZoneObject is put to nil, and garbage is collected.
|
|
As a result, the ScheduleObject will cancel any planned schedule.</p>
|
|
|
|
<h3>Construct a SCHEDULER object with a persistent schedule.</h3>
|
|
|
|
<ul>
|
|
<li><p><a href="##(SCHEDULER).New">SCHEDULER.New</a>( nil, Function, FunctionArguments, Start, ... ): Setup a new persistent SCHEDULER object, and start a new schedule for the Function with the defined FunctionArguments according the Start and sequent parameters.</p>
|
|
|
|
<p>SchedulerObject, SchedulerID = SCHEDULER:New( nil, ScheduleFunction, {} )</p></li>
|
|
</ul>
|
|
|
|
<p>The above example creates a new SchedulerObject, and does schedule the first schedule as part of the call.
|
|
Note that 2 variables are returned here: SchedulerObject, ScheduleID...</p>
|
|
|
|
<h3>Construct a SCHEDULER object without a schedule, but volatile to the Object existence...</h3>
|
|
|
|
<ul>
|
|
<li><p><a href="##(SCHEDULER).New">SCHEDULER.New</a>( Object, Function, FunctionArguments, Start, ... ): Setup a new SCHEDULER object, linked to Object, and start a new schedule for the Function with the defined FunctionArguments according the Start and sequent parameters.</p>
|
|
|
|
<p>ZoneObject = ZONE:New( "ZoneName" )
|
|
SchedulerObject, SchedulerID = SCHEDULER:New( ZoneObject, ScheduleFunction, {} )
|
|
SchedulerID = SchedulerObject:Schedule( ZoneObject, ScheduleFunction, {} )
|
|
...
|
|
ZoneObject = nil
|
|
garbagecollect()</p></li>
|
|
</ul>
|
|
|
|
<p>The above example creates a new SchedulerObject, and schedules a method call (ScheduleFunction),
|
|
and is bound to the existence of ZoneObject, which is a ZONE object (ZoneObject).
|
|
Both a ScheduleObject and a SchedulerID variable are returned.
|
|
Later in the logic, the ZoneObject is put to nil, and garbage is collected.
|
|
As a result, the ScheduleObject will cancel the planned schedule.</p>
|
|
|
|
<h2>SCHEDULER timer stopping and (re-)starting.</h2>
|
|
|
|
<p>The SCHEDULER can be stopped and restarted with the following methods:</p>
|
|
|
|
<ul>
|
|
<li><p><a href="##(SCHEDULER).Start">SCHEDULER.Start</a>(): (Re-)Start the schedules within the SCHEDULER object. If a CallID is provided to :Start(), only the schedule referenced by CallID will be (re-)started.</p></li>
|
|
<li><p><a href="##(SCHEDULER).Stop">SCHEDULER.Stop</a>(): Stop the schedules within the SCHEDULER object. If a CallID is provided to :Stop(), then only the schedule referenced by CallID will be stopped.</p>
|
|
|
|
<p>ZoneObject = ZONE:New( "ZoneName" )
|
|
SchedulerObject, SchedulerID = SCHEDULER:New( ZoneObject, ScheduleFunction, {} )
|
|
SchedulerID = SchedulerObject:Schedule( ZoneObject, ScheduleFunction, {}, 10, 10 )
|
|
...
|
|
SchedulerObject:Stop( SchedulerID )
|
|
...
|
|
SchedulerObject:Start( SchedulerID )</p></li>
|
|
</ul>
|
|
|
|
<p>The above example creates a new SchedulerObject, and does schedule the first schedule as part of the call.
|
|
Note that 2 variables are returned here: SchedulerObject, ScheduleID... <br/>
|
|
Later in the logic, the repeating schedule with SchedulerID is stopped. <br/>
|
|
A bit later, the repeating schedule with SchedulerId is (re)-started. </p>
|
|
|
|
<h2>Create a new schedule</h2>
|
|
|
|
<p>With the method <a href="##(SCHEDULER).Schedule">SCHEDULER.Schedule</a>() a new time event can be scheduled.
|
|
This method is used by the :New() constructor when a new schedule is planned.</p>
|
|
|
|
<p>Consider the following code fragment of the SCHEDULER object creation.</p>
|
|
|
|
<pre><code>ZoneObject = ZONE:New( "ZoneName" )
|
|
SchedulerObject = SCHEDULER:New( ZoneObject )
|
|
</code></pre>
|
|
|
|
<p>Several parameters can be specified that influence the behaviour of a Schedule.</p>
|
|
|
|
<h3>A single schedule, immediately executed</h3>
|
|
|
|
<pre><code>SchedulerID = SchedulerObject:Schedule( ZoneObject, ScheduleFunction, {} )
|
|
</code></pre>
|
|
|
|
<p>The above example schedules a new ScheduleFunction call to be executed asynchronously, within milleseconds ...</p>
|
|
|
|
<h3>A single schedule, planned over time</h3>
|
|
|
|
<pre><code>SchedulerID = SchedulerObject:Schedule( ZoneObject, ScheduleFunction, {}, 10 )
|
|
</code></pre>
|
|
|
|
<p>The above example schedules a new ScheduleFunction call to be executed asynchronously, within 10 seconds ...</p>
|
|
|
|
<h3>A schedule with a repeating time interval, planned over time</h3>
|
|
|
|
<pre><code>SchedulerID = SchedulerObject:Schedule( ZoneObject, ScheduleFunction, {}, 10, 60 )
|
|
</code></pre>
|
|
|
|
<p>The above example schedules a new ScheduleFunction call to be executed asynchronously, within 10 seconds,
|
|
and repeating 60 every seconds ...</p>
|
|
|
|
<h3>A schedule with a repeating time interval, planned over time, with time interval randomization</h3>
|
|
|
|
<pre><code>SchedulerID = SchedulerObject:Schedule( ZoneObject, ScheduleFunction, {}, 10, 60, 0.5 )
|
|
</code></pre>
|
|
|
|
<p>The above example schedules a new ScheduleFunction call to be executed asynchronously, within 10 seconds,
|
|
and repeating 60 seconds, with a 50% time interval randomization ...
|
|
So the repeating time interval will be randomized using the <strong>0.5</strong>, <br/>
|
|
and will calculate between <strong>60 - ( 60 * 0.5 )</strong> and <strong>60 + ( 60 * 0.5 )</strong> for each repeat,
|
|
which is in this example between <strong>30</strong> and <strong>90</strong> seconds.</p>
|
|
|
|
<h3>A schedule with a repeating time interval, planned over time, with time interval randomization, and stop after a time interval</h3>
|
|
|
|
<pre><code>SchedulerID = SchedulerObject:Schedule( ZoneObject, ScheduleFunction, {}, 10, 60, 0.5, 300 )
|
|
</code></pre>
|
|
|
|
<p>The above example schedules a new ScheduleFunction call to be executed asynchronously, within 10 seconds,
|
|
The schedule will repeat every 60 seconds.
|
|
So the repeating time interval will be randomized using the <strong>0.5</strong>, <br/>
|
|
and will calculate between <strong>60 - ( 60 * 0.5 )</strong> and <strong>60 + ( 60 * 0.5 )</strong> for each repeat,
|
|
which is in this example between <strong>30</strong> and <strong>90</strong> seconds.
|
|
The schedule will stop after <strong>300</strong> seconds.</p>
|
|
|
|
|
|
</dd>
|
|
</dl>
|
|
<h2><a id="#(Scheduler)" >Type <code>Scheduler</code></a></h2>
|
|
|
|
<h2><a id="#(SCHEDULER)" >Type <code>SCHEDULER</code></a></h2>
|
|
|
|
<p>The SCHEDULER class</p>
|
|
|
|
<h3>Field(s)</h3>
|
|
<dl class="function">
|
|
<dt>
|
|
|
|
<a id="#(SCHEDULER).Clear" >
|
|
<strong>SCHEDULER:Clear()</strong>
|
|
</a>
|
|
</dt>
|
|
<dd>
|
|
|
|
<p>Clears all pending schedules.</p>
|
|
|
|
</dd>
|
|
</dl>
|
|
<dl class="function">
|
|
<dt>
|
|
|
|
<em></em>
|
|
<a id="#(SCHEDULER).MasterObject" >
|
|
<strong>SCHEDULER.MasterObject</strong>
|
|
</a>
|
|
</dt>
|
|
<dd>
|
|
|
|
|
|
|
|
</dd>
|
|
</dl>
|
|
<dl class="function">
|
|
<dt>
|
|
|
|
<a id="#(SCHEDULER).New" >
|
|
<strong>SCHEDULER:New(SchedulerObject, SchedulerFunction, SchedulerArguments, Start, Repeat, RandomizeFactor, Stop)</strong>
|
|
</a>
|
|
</dt>
|
|
<dd>
|
|
|
|
<p>SCHEDULER constructor.</p>
|
|
|
|
<h3>Parameters</h3>
|
|
<ul>
|
|
<li>
|
|
|
|
<p><code><em>#table SchedulerObject </em></code>:
|
|
Specified for which Moose object the timer is setup. If a value of nil is provided, a scheduler will be setup without an object reference.</p>
|
|
|
|
</li>
|
|
<li>
|
|
|
|
<p><code><em>#function SchedulerFunction </em></code>:
|
|
The event function to be called when a timer event occurs. The event function needs to accept the parameters specified in SchedulerArguments.</p>
|
|
|
|
</li>
|
|
<li>
|
|
|
|
<p><code><em>#table SchedulerArguments </em></code>:
|
|
Optional arguments that can be given as part of scheduler. The arguments need to be given as a table { param1, param 2, ... }.</p>
|
|
|
|
</li>
|
|
<li>
|
|
|
|
<p><code><em>#number Start </em></code>:
|
|
Specifies the amount of seconds that will be waited before the scheduling is started, and the event function is called.</p>
|
|
|
|
</li>
|
|
<li>
|
|
|
|
<p><code><em>#number Repeat </em></code>:
|
|
Specifies the interval in seconds when the scheduler will call the event function.</p>
|
|
|
|
</li>
|
|
<li>
|
|
|
|
<p><code><em>#number RandomizeFactor </em></code>:
|
|
Specifies a randomization factor between 0 and 1 to randomize the Repeat.</p>
|
|
|
|
</li>
|
|
<li>
|
|
|
|
<p><code><em>#number Stop </em></code>:
|
|
Specifies the amount of seconds when the scheduler will be stopped.</p>
|
|
|
|
</li>
|
|
</ul>
|
|
<h3>Return values</h3>
|
|
<ol>
|
|
<li>
|
|
|
|
<p><em><a href="##(SCHEDULER)">#SCHEDULER</a>:</em>
|
|
self.</p>
|
|
|
|
</li>
|
|
<li>
|
|
|
|
<p><em>#number:</em>
|
|
The ScheduleID of the planned schedule.</p>
|
|
|
|
</li>
|
|
</ol>
|
|
</dd>
|
|
</dl>
|
|
<dl class="function">
|
|
<dt>
|
|
|
|
<a id="#(SCHEDULER).Remove" >
|
|
<strong>SCHEDULER:Remove(ScheduleID)</strong>
|
|
</a>
|
|
</dt>
|
|
<dd>
|
|
|
|
<p>Removes a specific schedule if a valid ScheduleID is provided.</p>
|
|
|
|
<h3>Parameter</h3>
|
|
<ul>
|
|
<li>
|
|
|
|
<p><code><em>#number ScheduleID </em></code>:
|
|
(optional) The ScheduleID of the planned (repeating) schedule.</p>
|
|
|
|
</li>
|
|
</ul>
|
|
</dd>
|
|
</dl>
|
|
<dl class="function">
|
|
<dt>
|
|
|
|
<a id="#(SCHEDULER).Schedule" >
|
|
<strong>SCHEDULER:Schedule(SchedulerObject, SchedulerFunction, SchedulerArguments, Start, Repeat, RandomizeFactor, Stop)</strong>
|
|
</a>
|
|
</dt>
|
|
<dd>
|
|
|
|
<p>Schedule a new time event.</p>
|
|
|
|
|
|
<p>Note that the schedule will only take place if the scheduler is <em>started</em>. Even for a single schedule event, the scheduler needs to be started also.</p>
|
|
|
|
<h3>Parameters</h3>
|
|
<ul>
|
|
<li>
|
|
|
|
<p><code><em>#table SchedulerObject </em></code>:
|
|
Specified for which Moose object the timer is setup. If a value of nil is provided, a scheduler will be setup without an object reference.</p>
|
|
|
|
</li>
|
|
<li>
|
|
|
|
<p><code><em>#function SchedulerFunction </em></code>:
|
|
The event function to be called when a timer event occurs. The event function needs to accept the parameters specified in SchedulerArguments.</p>
|
|
|
|
</li>
|
|
<li>
|
|
|
|
<p><code><em>#table SchedulerArguments </em></code>:
|
|
Optional arguments that can be given as part of scheduler. The arguments need to be given as a table { param1, param 2, ... }.</p>
|
|
|
|
</li>
|
|
<li>
|
|
|
|
<p><code><em>#number Start </em></code>:
|
|
Specifies the amount of seconds that will be waited before the scheduling is started, and the event function is called.</p>
|
|
|
|
</li>
|
|
<li>
|
|
|
|
<p><code><em>#number Repeat </em></code>:
|
|
Specifies the interval in seconds when the scheduler will call the event function.</p>
|
|
|
|
</li>
|
|
<li>
|
|
|
|
<p><code><em>#number RandomizeFactor </em></code>:
|
|
Specifies a randomization factor between 0 and 1 to randomize the Repeat.</p>
|
|
|
|
</li>
|
|
<li>
|
|
|
|
<p><code><em>#number Stop </em></code>:
|
|
Specifies the amount of seconds when the scheduler will be stopped.</p>
|
|
|
|
</li>
|
|
</ul>
|
|
<h3>Return value</h3>
|
|
|
|
<p><em>#number:</em>
|
|
The ScheduleID of the planned schedule.</p>
|
|
|
|
</dd>
|
|
</dl>
|
|
<dl class="function">
|
|
<dt>
|
|
|
|
<em>#number</em>
|
|
<a id="#(SCHEDULER).ScheduleID" >
|
|
<strong>SCHEDULER.ScheduleID</strong>
|
|
</a>
|
|
</dt>
|
|
<dd>
|
|
|
|
<p>the ID of the scheduler.</p>
|
|
|
|
</dd>
|
|
</dl>
|
|
<dl class="function">
|
|
<dt>
|
|
|
|
<em></em>
|
|
<a id="#(SCHEDULER).SchedulerObject" >
|
|
<strong>SCHEDULER.SchedulerObject</strong>
|
|
</a>
|
|
</dt>
|
|
<dd>
|
|
|
|
|
|
|
|
</dd>
|
|
</dl>
|
|
<dl class="function">
|
|
<dt>
|
|
|
|
<a id="#(SCHEDULER).Start" >
|
|
<strong>SCHEDULER:Start(ScheduleID)</strong>
|
|
</a>
|
|
</dt>
|
|
<dd>
|
|
|
|
<p>(Re-)Starts the schedules or a specific schedule if a valid ScheduleID is provided.</p>
|
|
|
|
<h3>Parameter</h3>
|
|
<ul>
|
|
<li>
|
|
|
|
<p><code><em>#number ScheduleID </em></code>:
|
|
(optional) The ScheduleID of the planned (repeating) schedule.</p>
|
|
|
|
</li>
|
|
</ul>
|
|
</dd>
|
|
</dl>
|
|
<dl class="function">
|
|
<dt>
|
|
|
|
<a id="#(SCHEDULER).Stop" >
|
|
<strong>SCHEDULER:Stop(ScheduleID)</strong>
|
|
</a>
|
|
</dt>
|
|
<dd>
|
|
|
|
<p>Stops the schedules or a specific schedule if a valid ScheduleID is provided.</p>
|
|
|
|
<h3>Parameter</h3>
|
|
<ul>
|
|
<li>
|
|
|
|
<p><code><em>#number ScheduleID </em></code>:
|
|
(optional) The ScheduleID of the planned (repeating) schedule.</p>
|
|
|
|
</li>
|
|
</ul>
|
|
</dd>
|
|
</dl>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
</body>
|
|
</html>
|