MOOSE/docs/Documentation/AI_A2A_Patrol.html
FlightControl 5a7551d312 Progress
2017-06-13 13:17:17 +02:00

1094 lines
31 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>AI_A2A_Patrol</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="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="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="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="Radio.html">Radio</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><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="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="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="Utils.html">Utils</a></li>
<li><a href="Zone.html">Zone</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>AI_A2A_Patrol</code></h1>
<p><strong>AI</strong> -- <strong>Air Patrolling or Staging.</strong></p>
<p><img src="..\Presentations\AI_PATROL\Dia1.JPG" alt="Banner Image"/></p>
<hr/>
<p>AI PATROL classes makes AI Controllables execute an Patrol.</p>
<p>There are the following types of PATROL classes defined:</p>
<ul>
<li><a href="##(AI_A2A_PATROL)">#AI<em>A2A</em>PATROL</a>: Perform a PATROL in a zone.</li>
</ul>
<hr/>
<h1>Demo Missions</h1>
<h3><a href="https://github.com/FlightControl-Master/MOOSE_MISSIONS/tree/master-release/PAT%20-%20Patrolling">AI_PATROL Demo Missions source code</a></h3>
<h3><a href="https://github.com/FlightControl-Master/MOOSE_MISSIONS/tree/master/PAT%20-%20Patrolling">AI_PATROL 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="https://www.youtube.com/playlist?list=PL7ZUrU4zZUl35HvYZKA6G22WMt7iI3zky">AI_PATROL YouTube Channel</a></h3>
<hr/>
<h3>Author: <strong>Sven Van de Velde (FlightControl)</strong></h3>
<h3>Contributions:</h3>
<ul>
<li><strong><a href="https://forums.eagle.ru/member.php?u=112075">Dutch_Baron</a></strong>: Working together with James has resulted in the creation of the AI_BALANCER class. James has shared his ideas on balancing AI with air units, and together we made a first design which you can use now :-)</li>
<li><strong><a href="https://forums.eagle.ru/member.php?u=62835">Pikey</a></strong>: Testing and API concept review.</li>
</ul>
<hr/>
<h2>Global(s)</h2>
<table class="function_list">
<tr>
<td class="name" nowrap="nowrap"><a href="#AI_A2A_PATROL">AI_A2A_PATROL</a></td>
<td class="summary">
<h1>AI<em>A2A</em>PATROL class, extends <a href="Fsm.html##(FSM_CONTROLLABLE)">Fsm#FSM_CONTROLLABLE</a></h1>
<p>The AI<em>A2A</em>PATROL class implements the core functions to patrol a <a href="Zone.html">Zone</a> by an AI <a href="Controllable.html">Controllable</a> or <a href="Group.html">Group</a>.</p>
</td>
</tr>
</table>
<h2><a id="#(AI_A2A_PATROL)">Type <code>AI_A2A_PATROL</code></a></h2>
<table class="function_list">
<tr>
<td class="name" nowrap="nowrap"><a href="##(AI_A2A_PATROL).New">AI_A2A_PATROL:New(AIGroup, PatrolZone, PatrolFloorAltitude, PatrolCeilingAltitude, PatrolMinSpeed, PatrolMaxSpeed, PatrolAltType)</a></td>
<td class="summary">
<p>Creates a new AI<em>A2A</em>PATROL object</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(AI_A2A_PATROL).OnAfterPatrol">AI_A2A_PATROL:OnAfterPatrol(Controllable, From, Event, To)</a></td>
<td class="summary">
<p>OnAfter Transition Handler for Event Patrol.</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(AI_A2A_PATROL).OnAfterRoute">AI_A2A_PATROL:OnAfterRoute(Controllable, From, Event, To)</a></td>
<td class="summary">
<p>OnAfter Transition Handler for Event Route.</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(AI_A2A_PATROL).OnBeforePatrol">AI_A2A_PATROL:OnBeforePatrol(Controllable, From, Event, To)</a></td>
<td class="summary">
<p>OnBefore Transition Handler for Event Patrol.</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(AI_A2A_PATROL).OnBeforeRoute">AI_A2A_PATROL:OnBeforeRoute(Controllable, From, Event, To)</a></td>
<td class="summary">
<p>OnBefore Transition Handler for Event Route.</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(AI_A2A_PATROL).OnEnterPatrolling">AI_A2A_PATROL:OnEnterPatrolling(Controllable, From, Event, To)</a></td>
<td class="summary">
<p>OnEnter Transition Handler for State Patrolling.</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(AI_A2A_PATROL).OnLeavePatrolling">AI_A2A_PATROL:OnLeavePatrolling(Controllable, From, Event, To)</a></td>
<td class="summary">
<p>OnLeave Transition Handler for State Patrolling.</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(AI_A2A_PATROL).Patrol">AI_A2A_PATROL:Patrol()</a></td>
<td class="summary">
<p>Synchronous Event Trigger for Event Patrol.</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(AI_A2A_PATROL).PatrolAltType">AI_A2A_PATROL.PatrolAltType</a></td>
<td class="summary">
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(AI_A2A_PATROL).PatrolCeilingAltitude">AI_A2A_PATROL.PatrolCeilingAltitude</a></td>
<td class="summary">
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(AI_A2A_PATROL).PatrolFloorAltitude">AI_A2A_PATROL.PatrolFloorAltitude</a></td>
<td class="summary">
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(AI_A2A_PATROL).PatrolMaxSpeed">AI_A2A_PATROL.PatrolMaxSpeed</a></td>
<td class="summary">
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(AI_A2A_PATROL).PatrolMinSpeed">AI_A2A_PATROL.PatrolMinSpeed</a></td>
<td class="summary">
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(AI_A2A_PATROL).PatrolRoute">AI_A2A_PATROL.PatrolRoute(AIGroup)</a></td>
<td class="summary">
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(AI_A2A_PATROL).PatrolZone">AI_A2A_PATROL.PatrolZone</a></td>
<td class="summary">
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(AI_A2A_PATROL).Route">AI_A2A_PATROL:Route()</a></td>
<td class="summary">
<p>Synchronous Event Trigger for Event Route.</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(AI_A2A_PATROL).SetAltitude">AI_A2A_PATROL:SetAltitude(PatrolFloorAltitude, PatrolCeilingAltitude)</a></td>
<td class="summary">
<p>Sets the floor and ceiling altitude of the patrol.</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(AI_A2A_PATROL).SetSpeed">AI_A2A_PATROL:SetSpeed(PatrolMinSpeed, PatrolMaxSpeed)</a></td>
<td class="summary">
<p>Sets (modifies) the minimum and maximum speed of the patrol.</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(AI_A2A_PATROL).__Patrol">AI_A2A_PATROL:__Patrol(Delay)</a></td>
<td class="summary">
<p>Asynchronous Event Trigger for Event Patrol.</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(AI_A2A_PATROL).__Route">AI_A2A_PATROL:__Route(Delay)</a></td>
<td class="summary">
<p>Asynchronous Event Trigger for Event Route.</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(AI_A2A_PATROL).onafterPatrol">AI_A2A_PATROL:onafterPatrol(Controllable, From, Event, To)</a></td>
<td class="summary">
<p>Defines a new patrol route using the <a href="Process_PatrolZone.html">Process_PatrolZone</a> parameters and settings.</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(AI_A2A_PATROL).onafterRoute">AI_A2A_PATROL:onafterRoute(AIGroup, From, Event, To)</a></td>
<td class="summary">
<p>Defines a new patrol route using the <a href="Process_PatrolZone.html">Process_PatrolZone</a> parameters and settings.</p>
</td>
</tr>
</table>
<h2>Global(s)</h2>
<dl class="function">
<dt>
<em><a href="##(AI_A2A_PATROL)">#AI_A2A_PATROL</a></em>
<a id="AI_A2A_PATROL" >
<strong>AI_A2A_PATROL</strong>
</a>
</dt>
<dd>
<h1>AI<em>A2A</em>PATROL class, extends <a href="Fsm.html##(FSM_CONTROLLABLE)">Fsm#FSM_CONTROLLABLE</a></h1>
<p>The AI<em>A2A</em>PATROL class implements the core functions to patrol a <a href="Zone.html">Zone</a> by an AI <a href="Controllable.html">Controllable</a> or <a href="Group.html">Group</a>.</p>
<p><img src="..\Presentations\AI_PATROL\Dia3.JPG" alt="Process"/></p>
<p>The AI<em>A2A</em>PATROL is assigned a <a href="Group.html">Group</a> and this must be done before the AI<em>A2A</em>PATROL process can be started using the <strong>Start</strong> event.</p>
<p><img src="..\Presentations\AI_PATROL\Dia4.JPG" alt="Process"/></p>
<p>The AI will fly towards the random 3D point within the patrol zone, using a random speed within the given altitude and speed limits.
Upon arrival at the 3D point, a new random 3D point will be selected within the patrol zone using the given limits.</p>
<p><img src="..\Presentations\AI_PATROL\Dia5.JPG" alt="Process"/></p>
<p>This cycle will continue.</p>
<p><img src="..\Presentations\AI_PATROL\Dia6.JPG" alt="Process"/></p>
<p>During the patrol, the AI will detect enemy targets, which are reported through the <strong>Detected</strong> event.</p>
<p><img src="..\Presentations\AI_PATROL\Dia9.JPG" alt="Process"/></p>
<p>-- Note that the enemy is not engaged! To model enemy engagement, either tailor the <strong>Detected</strong> event, or
use derived AI_ classes to model AI offensive or defensive behaviour.</p>
<p><img src="..\Presentations\AI_PATROL\Dia10.JPG" alt="Process"/></p>
<p>Until a fuel or damage treshold has been reached by the AI, or when the AI is commanded to RTB.
When the fuel treshold has been reached, the airplane will fly towards the nearest friendly airbase and will land.</p>
<p><img src="..\Presentations\AI_PATROL\Dia11.JPG" alt="Process"/></p>
<h2>1. AI<em>A2A</em>PATROL constructor</h2>
<ul>
<li><a href="##(AI_A2A_PATROL).New">AI<em>A2A</em>PATROL.New</a>(): Creates a new AI<em>A2A</em>PATROL object.</li>
</ul>
<h2>2. AI<em>A2A</em>PATROL is a FSM</h2>
<p><img src="..\Presentations\AI_PATROL\Dia2.JPG" alt="Process"/></p>
<h3>2.1. AI<em>A2A</em>PATROL States</h3>
<ul>
<li><strong>None</strong> ( Group ): The process is not started yet.</li>
<li><strong>Patrolling</strong> ( Group ): The AI is patrolling the Patrol Zone.</li>
<li><strong>Returning</strong> ( Group ): The AI is returning to Base.</li>
<li><strong>Stopped</strong> ( Group ): The process is stopped.</li>
<li><strong>Crashed</strong> ( Group ): The AI has crashed or is dead.</li>
</ul>
<h3>2.2. AI<em>A2A</em>PATROL Events</h3>
<ul>
<li><strong>Start</strong> ( Group ): Start the process.</li>
<li><strong>Stop</strong> ( Group ): Stop the process.</li>
<li><strong>Route</strong> ( Group ): Route the AI to a new random 3D point within the Patrol Zone.</li>
<li><strong>RTB</strong> ( Group ): Route the AI to the home base.</li>
<li><strong>Detect</strong> ( Group ): The AI is detecting targets.</li>
<li><strong>Detected</strong> ( Group ): The AI has detected new targets.</li>
<li><strong>Status</strong> ( Group ): The AI is checking status (fuel and damage). When the tresholds have been reached, the AI will RTB.</li>
</ul>
<h2>3. Set or Get the AI controllable</h2>
<ul>
<li><a href="##(AI_A2A_PATROL).SetControllable">AI<em>A2A</em>PATROL.SetControllable</a>(): Set the AIControllable.</li>
<li><a href="##(AI_A2A_PATROL).GetControllable">AI<em>A2A</em>PATROL.GetControllable</a>(): Get the AIControllable.</li>
</ul>
<h2>4. Set the Speed and Altitude boundaries of the AI controllable</h2>
<ul>
<li><a href="##(AI_A2A_PATROL).SetSpeed">AI<em>A2A</em>PATROL.SetSpeed</a>(): Set the patrol speed boundaries of the AI, for the next patrol.</li>
<li><a href="##(AI_A2A_PATROL).SetAltitude">AI<em>A2A</em>PATROL.SetAltitude</a>(): Set altitude boundaries of the AI, for the next patrol.</li>
</ul>
<h2>5. Manage the detection process of the AI controllable</h2>
<p>The detection process of the AI controllable can be manipulated.
Detection requires an amount of CPU power, which has an impact on your mission performance.
Only put detection on when absolutely necessary, and the frequency of the detection can also be set.</p>
<ul>
<li><a href="##(AI_A2A_PATROL).SetDetectionOn">AI<em>A2A</em>PATROL.SetDetectionOn</a>(): Set the detection on. The AI will detect for targets.</li>
<li><a href="##(AI_A2A_PATROL).SetDetectionOff">AI<em>A2A</em>PATROL.SetDetectionOff</a>(): Set the detection off, the AI will not detect for targets. The existing target list will NOT be erased.</li>
</ul>
<p>The detection frequency can be set with <a href="##(AI_A2A_PATROL).SetDetectionInterval">AI<em>A2A</em>PATROL.SetDetectionInterval</a>( seconds ), where the amount of seconds specify how much seconds will be waited before the next detection.
Use the method <a href="##(AI_A2A_PATROL).GetDetectedUnits">AI<em>A2A</em>PATROL.GetDetectedUnits</a>() to obtain a list of the <a href="Unit.html">Unit</a>s detected by the AI.</p>
<p>The detection can be filtered to potential targets in a specific zone.
Use the method <a href="##(AI_A2A_PATROL).SetDetectionZone">AI<em>A2A</em>PATROL.SetDetectionZone</a>() to set the zone where targets need to be detected.
Note that when the zone is too far away, or the AI is not heading towards the zone, or the AI is too high, no targets may be detected
according the weather conditions.</p>
<h2>6. Manage the "out of fuel" in the AI<em>A2A</em>PATROL</h2>
<p>When the AI is out of fuel, it is required that a new AI is started, before the old AI can return to the home base.
Therefore, with a parameter and a calculation of the distance to the home base, the fuel treshold is calculated.
When the fuel treshold is reached, the AI will continue for a given time its patrol task in orbit,
while a new AI is targetted to the AI<em>A2A</em>PATROL.
Once the time is finished, the old AI will return to the base.
Use the method <a href="##(AI_A2A_PATROL).ManageFuel">AI<em>A2A</em>PATROL.ManageFuel</a>() to have this proces in place.</p>
<h2>7. Manage "damage" behaviour of the AI in the AI<em>A2A</em>PATROL</h2>
<p>When the AI is damaged, it is required that a new AIControllable is started. However, damage cannon be foreseen early on.
Therefore, when the damage treshold is reached, the AI will return immediately to the home base (RTB).
Use the method <a href="##(AI_A2A_PATROL).ManageDamage">AI<em>A2A</em>PATROL.ManageDamage</a>() to have this proces in place.</p>
<hr/>
</dd>
</dl>
<h2><a id="#(AI_A2A_Patrol)" >Type <code>AI_A2A_Patrol</code></a></h2>
<h2><a id="#(AI_A2A_PATROL)" >Type <code>AI_A2A_PATROL</code></a></h2>
<h3>Field(s)</h3>
<dl class="function">
<dt>
<a id="#(AI_A2A_PATROL).New" >
<strong>AI_A2A_PATROL:New(AIGroup, PatrolZone, PatrolFloorAltitude, PatrolCeilingAltitude, PatrolMinSpeed, PatrolMaxSpeed, PatrolAltType)</strong>
</a>
</dt>
<dd>
<p>Creates a new AI<em>A2A</em>PATROL object</p>
<h3>Parameters</h3>
<ul>
<li>
<p><code><em><a href="Wrapper.Group.html##(GROUP)">Wrapper.Group#GROUP</a> AIGroup </em></code>: </p>
</li>
<li>
<p><code><em><a href="Core.Zone.html##(ZONE_BASE)">Core.Zone#ZONE_BASE</a> PatrolZone </em></code>:
The <a href="Zone.html">Zone</a> where the patrol needs to be executed.</p>
</li>
<li>
<p><code><em><a href="Dcs.DCSTypes.html##(Altitude)">Dcs.DCSTypes#Altitude</a> PatrolFloorAltitude </em></code>:
The lowest altitude in meters where to execute the patrol.</p>
</li>
<li>
<p><code><em><a href="Dcs.DCSTypes.html##(Altitude)">Dcs.DCSTypes#Altitude</a> PatrolCeilingAltitude </em></code>:
The highest altitude in meters where to execute the patrol.</p>
</li>
<li>
<p><code><em><a href="Dcs.DCSTypes.html##(Speed)">Dcs.DCSTypes#Speed</a> PatrolMinSpeed </em></code>:
The minimum speed of the <a href="Controllable.html">Controllable</a> in km/h.</p>
</li>
<li>
<p><code><em><a href="Dcs.DCSTypes.html##(Speed)">Dcs.DCSTypes#Speed</a> PatrolMaxSpeed </em></code>:
The maximum speed of the <a href="Controllable.html">Controllable</a> in km/h.</p>
</li>
<li>
<p><code><em><a href="Dcs.DCSTypes.html##(AltitudeType)">Dcs.DCSTypes#AltitudeType</a> PatrolAltType </em></code>:
The altitude type ("RADIO"=="AGL", "BARO"=="ASL"). Defaults to RADIO</p>
</li>
</ul>
<h3>Return value</h3>
<p><em><a href="##(AI_A2A_PATROL)">#AI<em>A2A</em>PATROL</a>:</em>
self</p>
<h3>Usage:</h3>
<pre class="example"><code>-- Define a new AI_A2A_PATROL Object. This PatrolArea will patrol an AIControllable within PatrolZone between 3000 and 6000 meters, with a variying speed between 600 and 900 km/h.
PatrolZone = ZONE:New( 'PatrolZone' )
PatrolSpawn = SPAWN:New( 'Patrol Group' )
PatrolArea = AI_A2A_PATROL:New( PatrolZone, 3000, 6000, 600, 900 )</code></pre>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(AI_A2A_PATROL).OnAfterPatrol" >
<strong>AI_A2A_PATROL:OnAfterPatrol(Controllable, From, Event, To)</strong>
</a>
</dt>
<dd>
<p>OnAfter Transition Handler for Event Patrol.</p>
<h3>Parameters</h3>
<ul>
<li>
<p><code><em><a href="Wrapper.Controllable.html##(CONTROLLABLE)">Wrapper.Controllable#CONTROLLABLE</a> Controllable </em></code>:
The Controllable Object managed by the FSM.</p>
</li>
<li>
<p><code><em>#string From </em></code>:
The From State string.</p>
</li>
<li>
<p><code><em>#string Event </em></code>:
The Event string.</p>
</li>
<li>
<p><code><em>#string To </em></code>:
The To State string.</p>
</li>
</ul>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(AI_A2A_PATROL).OnAfterRoute" >
<strong>AI_A2A_PATROL:OnAfterRoute(Controllable, From, Event, To)</strong>
</a>
</dt>
<dd>
<p>OnAfter Transition Handler for Event Route.</p>
<h3>Parameters</h3>
<ul>
<li>
<p><code><em><a href="Wrapper.Controllable.html##(CONTROLLABLE)">Wrapper.Controllable#CONTROLLABLE</a> Controllable </em></code>:
The Controllable Object managed by the FSM.</p>
</li>
<li>
<p><code><em>#string From </em></code>:
The From State string.</p>
</li>
<li>
<p><code><em>#string Event </em></code>:
The Event string.</p>
</li>
<li>
<p><code><em>#string To </em></code>:
The To State string.</p>
</li>
</ul>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(AI_A2A_PATROL).OnBeforePatrol" >
<strong>AI_A2A_PATROL:OnBeforePatrol(Controllable, From, Event, To)</strong>
</a>
</dt>
<dd>
<p>OnBefore Transition Handler for Event Patrol.</p>
<h3>Parameters</h3>
<ul>
<li>
<p><code><em><a href="Wrapper.Controllable.html##(CONTROLLABLE)">Wrapper.Controllable#CONTROLLABLE</a> Controllable </em></code>:
The Controllable Object managed by the FSM.</p>
</li>
<li>
<p><code><em>#string From </em></code>:
The From State string.</p>
</li>
<li>
<p><code><em>#string Event </em></code>:
The Event string.</p>
</li>
<li>
<p><code><em>#string To </em></code>:
The To State string.</p>
</li>
</ul>
<h3>Return value</h3>
<p><em>#boolean:</em>
Return false to cancel Transition.</p>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(AI_A2A_PATROL).OnBeforeRoute" >
<strong>AI_A2A_PATROL:OnBeforeRoute(Controllable, From, Event, To)</strong>
</a>
</dt>
<dd>
<p>OnBefore Transition Handler for Event Route.</p>
<h3>Parameters</h3>
<ul>
<li>
<p><code><em><a href="Wrapper.Controllable.html##(CONTROLLABLE)">Wrapper.Controllable#CONTROLLABLE</a> Controllable </em></code>:
The Controllable Object managed by the FSM.</p>
</li>
<li>
<p><code><em>#string From </em></code>:
The From State string.</p>
</li>
<li>
<p><code><em>#string Event </em></code>:
The Event string.</p>
</li>
<li>
<p><code><em>#string To </em></code>:
The To State string.</p>
</li>
</ul>
<h3>Return value</h3>
<p><em>#boolean:</em>
Return false to cancel Transition.</p>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(AI_A2A_PATROL).OnEnterPatrolling" >
<strong>AI_A2A_PATROL:OnEnterPatrolling(Controllable, From, Event, To)</strong>
</a>
</dt>
<dd>
<p>OnEnter Transition Handler for State Patrolling.</p>
<h3>Parameters</h3>
<ul>
<li>
<p><code><em><a href="Wrapper.Controllable.html##(CONTROLLABLE)">Wrapper.Controllable#CONTROLLABLE</a> Controllable </em></code>:
The Controllable Object managed by the FSM.</p>
</li>
<li>
<p><code><em>#string From </em></code>:
The From State string.</p>
</li>
<li>
<p><code><em>#string Event </em></code>:
The Event string.</p>
</li>
<li>
<p><code><em>#string To </em></code>:
The To State string.</p>
</li>
</ul>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(AI_A2A_PATROL).OnLeavePatrolling" >
<strong>AI_A2A_PATROL:OnLeavePatrolling(Controllable, From, Event, To)</strong>
</a>
</dt>
<dd>
<p>OnLeave Transition Handler for State Patrolling.</p>
<h3>Parameters</h3>
<ul>
<li>
<p><code><em><a href="Wrapper.Controllable.html##(CONTROLLABLE)">Wrapper.Controllable#CONTROLLABLE</a> Controllable </em></code>:
The Controllable Object managed by the FSM.</p>
</li>
<li>
<p><code><em>#string From </em></code>:
The From State string.</p>
</li>
<li>
<p><code><em>#string Event </em></code>:
The Event string.</p>
</li>
<li>
<p><code><em>#string To </em></code>:
The To State string.</p>
</li>
</ul>
<h3>Return value</h3>
<p><em>#boolean:</em>
Return false to cancel Transition.</p>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(AI_A2A_PATROL).Patrol" >
<strong>AI_A2A_PATROL:Patrol()</strong>
</a>
</dt>
<dd>
<p>Synchronous Event Trigger for Event Patrol.</p>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(AI_A2A_PATROL).PatrolAltType" >
<strong>AI_A2A_PATROL.PatrolAltType</strong>
</a>
</dt>
<dd>
<p> defafult PatrolAltType to "RADIO" if not specified</p>
</dd>
</dl>
<dl class="function">
<dt>
<em></em>
<a id="#(AI_A2A_PATROL).PatrolCeilingAltitude" >
<strong>AI_A2A_PATROL.PatrolCeilingAltitude</strong>
</a>
</dt>
<dd>
</dd>
</dl>
<dl class="function">
<dt>
<em></em>
<a id="#(AI_A2A_PATROL).PatrolFloorAltitude" >
<strong>AI_A2A_PATROL.PatrolFloorAltitude</strong>
</a>
</dt>
<dd>
</dd>
</dl>
<dl class="function">
<dt>
<em></em>
<a id="#(AI_A2A_PATROL).PatrolMaxSpeed" >
<strong>AI_A2A_PATROL.PatrolMaxSpeed</strong>
</a>
</dt>
<dd>
</dd>
</dl>
<dl class="function">
<dt>
<em></em>
<a id="#(AI_A2A_PATROL).PatrolMinSpeed" >
<strong>AI_A2A_PATROL.PatrolMinSpeed</strong>
</a>
</dt>
<dd>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(AI_A2A_PATROL).PatrolRoute" >
<strong>AI_A2A_PATROL.PatrolRoute(AIGroup)</strong>
</a>
</dt>
<dd>
<h3>Parameter</h3>
<ul>
<li>
<p><code><em><a href="Wrapper.Group.html##(GROUP)">Wrapper.Group#GROUP</a> AIGroup </em></code>:
This statis method is called from the route path within the last task at the last waaypoint of the Controllable.
Note that this method is required, as triggers the next route when patrolling for the Controllable.</p>
</li>
</ul>
</dd>
</dl>
<dl class="function">
<dt>
<em></em>
<a id="#(AI_A2A_PATROL).PatrolZone" >
<strong>AI_A2A_PATROL.PatrolZone</strong>
</a>
</dt>
<dd>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(AI_A2A_PATROL).Route" >
<strong>AI_A2A_PATROL:Route()</strong>
</a>
</dt>
<dd>
<p>Synchronous Event Trigger for Event Route.</p>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(AI_A2A_PATROL).SetAltitude" >
<strong>AI_A2A_PATROL:SetAltitude(PatrolFloorAltitude, PatrolCeilingAltitude)</strong>
</a>
</dt>
<dd>
<p>Sets the floor and ceiling altitude of the patrol.</p>
<h3>Parameters</h3>
<ul>
<li>
<p><code><em><a href="Dcs.DCSTypes.html##(Altitude)">Dcs.DCSTypes#Altitude</a> PatrolFloorAltitude </em></code>:
The lowest altitude in meters where to execute the patrol.</p>
</li>
<li>
<p><code><em><a href="Dcs.DCSTypes.html##(Altitude)">Dcs.DCSTypes#Altitude</a> PatrolCeilingAltitude </em></code>:
The highest altitude in meters where to execute the patrol.</p>
</li>
</ul>
<h3>Return value</h3>
<p><em><a href="##(AI_A2A_PATROL)">#AI<em>A2A</em>PATROL</a>:</em>
self</p>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(AI_A2A_PATROL).SetSpeed" >
<strong>AI_A2A_PATROL:SetSpeed(PatrolMinSpeed, PatrolMaxSpeed)</strong>
</a>
</dt>
<dd>
<p>Sets (modifies) the minimum and maximum speed of the patrol.</p>
<h3>Parameters</h3>
<ul>
<li>
<p><code><em><a href="Dcs.DCSTypes.html##(Speed)">Dcs.DCSTypes#Speed</a> PatrolMinSpeed </em></code>:
The minimum speed of the <a href="Controllable.html">Controllable</a> in km/h.</p>
</li>
<li>
<p><code><em><a href="Dcs.DCSTypes.html##(Speed)">Dcs.DCSTypes#Speed</a> PatrolMaxSpeed </em></code>:
The maximum speed of the <a href="Controllable.html">Controllable</a> in km/h.</p>
</li>
</ul>
<h3>Return value</h3>
<p><em><a href="##(AI_A2A_PATROL)">#AI<em>A2A</em>PATROL</a>:</em>
self</p>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(AI_A2A_PATROL).__Patrol" >
<strong>AI_A2A_PATROL:__Patrol(Delay)</strong>
</a>
</dt>
<dd>
<p>Asynchronous Event Trigger for Event Patrol.</p>
<h3>Parameter</h3>
<ul>
<li>
<p><code><em>#number Delay </em></code>:
The delay in seconds.</p>
</li>
</ul>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(AI_A2A_PATROL).__Route" >
<strong>AI_A2A_PATROL:__Route(Delay)</strong>
</a>
</dt>
<dd>
<p>Asynchronous Event Trigger for Event Route.</p>
<h3>Parameter</h3>
<ul>
<li>
<p><code><em>#number Delay </em></code>:
The delay in seconds.</p>
</li>
</ul>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(AI_A2A_PATROL).onafterPatrol" >
<strong>AI_A2A_PATROL:onafterPatrol(Controllable, From, Event, To)</strong>
</a>
</dt>
<dd>
<p>Defines a new patrol route using the <a href="Process_PatrolZone.html">Process_PatrolZone</a> parameters and settings.</p>
<h3>Parameters</h3>
<ul>
<li>
<p><code><em><a href="Wrapper.Controllable.html##(CONTROLLABLE)">Wrapper.Controllable#CONTROLLABLE</a> Controllable </em></code>:
The Controllable Object managed by the FSM.</p>
</li>
<li>
<p><code><em>#string From </em></code>:
The From State string.</p>
</li>
<li>
<p><code><em>#string Event </em></code>:
The Event string.</p>
</li>
<li>
<p><code><em>#string To </em></code>:
The To State string.</p>
</li>
</ul>
<h3>Return value</h3>
<p><em><a href="##(AI_A2A_PATROL)">#AI<em>A2A</em>PATROL</a>:</em>
self</p>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(AI_A2A_PATROL).onafterRoute" >
<strong>AI_A2A_PATROL:onafterRoute(AIGroup, From, Event, To)</strong>
</a>
</dt>
<dd>
<p>Defines a new patrol route using the <a href="Process_PatrolZone.html">Process_PatrolZone</a> parameters and settings.</p>
<h3>Parameters</h3>
<ul>
<li>
<p><code><em><a href="Wrapper.Group.html##(GROUP)">Wrapper.Group#GROUP</a> AIGroup </em></code>:
The AIGroup managed by the FSM.</p>
</li>
<li>
<p><code><em>#string From </em></code>:
The From State string.</p>
</li>
<li>
<p><code><em>#string Event </em></code>:
The Event string.</p>
</li>
<li>
<p><code><em>#string To </em></code>:
The To State string.</p>
</li>
</ul>
</dd>
</dl>
</div>
</div>
</body>
</html>