First working version

This commit is contained in:
FlightControl_Master 2017-07-31 12:04:27 +02:00
parent 87634969b3
commit 85bd3a1c33
10 changed files with 476 additions and 61 deletions

View File

@ -72,6 +72,7 @@ function AI_A2A:New( AIGroup )
self:SetFuelThreshold( .2, 60 )
self:SetDamageThreshold( 0.4 )
self:SetDisengageRadius( 70000 )
self:SetStartState( "Stopped" )
@ -295,6 +296,15 @@ function AI_A2A:SetHomeAirbase( HomeAirbase )
end
--- Sets the disengage range, that when engaging a target beyond the specified range, the engagement will be cancelled and the plane will RTB.
-- @param #AI_A2A self
-- @param #number DisengageRadius The disengage range.
-- @return #AI_A2A self
function AI_A2A:SetDisengageRadius( DisengageRadius )
self:F2( { DisengageRadius } )
self.DisengageRadius = DisengageRadius
end
--- Set the status checking off.
-- @param #AI_A2A self
@ -378,6 +388,16 @@ function AI_A2A:onafterStatus()
local RTB = false
local DistanceFromHomeBase = self.HomeAirbase:GetCoordinate():Get2DDistance( self.Controllable:GetCoordinate() )
self:F({DistanceFromHomeBase=DistanceFromHomeBase})
if DistanceFromHomeBase > self.DisengageRadius then
self:E( self.Controllable:GetName() .. " is too far from home base, RTB!" )
self:Home()
RTB = true
end
local Fuel = self.Controllable:GetUnit(1):GetFuel()
self:F({Fuel=Fuel})
if Fuel < self.PatrolFuelThresholdPercentage then

View File

@ -641,7 +641,9 @@ do -- AI_A2A_DISPATCHER
--
-- Use the method @{#AI_A2A_DISPATCHER.SetDefaultDamageThreshold}() to set the **default damage treshold** of spawned airplanes for all squadrons.
--
-- ## 10.7. Default CAP Time Interval.
-- ## 10.7. Default settings for CAP.
--
-- ### 10.7.1. Default CAP Time Interval.
--
-- CAP is time driven, and will evaluate in random time intervals if a new CAP needs to be spawned.
-- The **default CAP time interval** is between **180** and **600** seconds.
@ -649,7 +651,7 @@ do -- AI_A2A_DISPATCHER
-- Use the method @{#AI_A2A_DISPATCHER.SetDefaultCapTimeInterval}() to set the **default CAP time interval** of spawned airplanes for all squadrons.
-- Note that you can still change the CAP limit and CAP time intervals for each CAP individually using the @{#AI_A2A_DISPATCHER.SetSquadronCapTimeInterval}() method.
--
-- ## 10.8. Default CAP limit.
-- ### 10.7.2. Default CAP limit.
--
-- Multiple CAP can be airborne at the same time for one squadron, which is controlled by the **CAP limit**.
-- The **default CAP limit** is 1 CAP per squadron to be airborne at the same time.
@ -659,6 +661,27 @@ do -- AI_A2A_DISPATCHER
-- Use the method @{#AI_A2A_DISPATCHER.SetDefaultCapTimeInterval}() to set the **default CAP time interval** of spawned airplanes for all squadrons.
-- Note that you can still change the CAP limit and CAP time intervals for each CAP individually using the @{#AI_A2A_DISPATCHER.SetSquadronCapTimeInterval}() method.
--
-- ## 10.8. Default settings for GCI.
--
-- ## 10.8.1. Optimal intercept point.
--
-- When intruders are detected, the intrusion path of the attackers can be monitored by the EWR.
-- Although defender planes might be on standby at the airbase, it can still take some time to get the defenses up in the air if there aren't any defenses airborne.
-- This time can easily take 2 to 3 minutes, and even then the defenders still need to fly towards the target, which takes also time.
--
-- Therefore, an optimal **intercept point** is calculated which takes a couple of parameters:
--
-- * The average bearing of the intruders for an amount of seconds.
-- * The average speed of the intruders for an amount of seconds.
-- * The altitude of the intruders.
-- * An assumed time it takes to get planes operational at the airbase.
-- * The intercept speed, which is given as a parameter for each squadron or set by default for all squadrons.
--
-- The **intercept point** will determine:
--
-- * If there are any friendlies close to engage the target. These can be defenders performing CAP or defenders in RTB.
-- * The optimal airbase from where defenders will takeoff for gci.
--
-- ## 11. Q & A:
--
-- ### 11.1. Which countries will be selected for each coalition?
@ -751,6 +774,8 @@ do -- AI_A2A_DISPATCHER
self:SetDefaultDamageThreshold( 0.4 ) -- When 40% of damage, go RTB.
self:SetDefaultCapTimeInterval( 180, 600 ) -- Between 180 and 600 seconds.
self:SetDefaultCapLimit( 1 ) -- Maximum one CAP per squadron.
self:SetIntercept( 300 ) -- A default intercept delay time of 300 seconds.
self:SetDisengageRadius( 100000 ) -- The default disengage radius is 100 km.
self:AddTransition( "Started", "Assign", "Started" )
@ -939,6 +964,26 @@ do -- AI_A2A_DISPATCHER
return self
end
--- Define the radius to disengage any target when the distance to the home base is larger than the specified meters.
-- @param #AI_A2A_DISPATCHER self
-- @param #number DisengageRadius (Optional, Default = 100000) The radius to disengage a target when too far from the home base.
-- @return #AI_A2A_DISPATCHER
-- @usage
--
-- -- Set 50km as the disengage radius.
-- Dispatcher:SetDisengageRadius( 50000 )
--
-- -- Set 100km as the disengage radius.
-- Dispatcher:SetDisngageRadius() -- 100000 is the default value.
--
function AI_A2A_DISPATCHER:SetDisengageRadius( DisengageRadius )
self.DisengageRadius = DisengageRadius
return self
end
--- Define the radius to check if a target can be engaged by an ground controlled intercept.
-- So, if there is a target area detected and reported,
@ -1092,7 +1137,7 @@ do -- AI_A2A_DISPATCHER
self.DefenderDefault.CapMaxSeconds = CapMaxSeconds
return self
end
end
--- Set the default CAP limit for squadrons, which will be used to determine how many CAP can be airborne at the same time for the squadron.
@ -1116,13 +1161,24 @@ do -- AI_A2A_DISPATCHER
end
function AI_A2A_DISPATCHER:SetIntercept( InterceptDelay )
self.DefenderDefault.InterceptDelay = InterceptDelay
local Detection = self.Detection -- Functional.Detection#DETECTION_AREAS
Detection:SetIntercept( true, InterceptDelay )
return self
end
--- Calculates which AI friendlies are nearby the area
-- @param #AI_A2A_DISPATCHER self
-- @param DetectedItem
-- @return #number, Core.CommandCenter#REPORT
function AI_A2A_DISPATCHER:GetAIFriendliesNearBy( DetectedItem )
local FriendliesNearBy = self.Detection:GetFriendliesDistance( DetectedItem )
local FriendliesNearBy = self.Detection:GetFriendliesNearBy( DetectedItem )
return FriendliesNearBy
end
@ -2270,6 +2326,7 @@ do -- AI_A2A_DISPATCHER
Fsm:SetHomeAirbase( DefenderSquadron.Airbase )
Fsm:SetFuelThreshold( self.DefenderDefault.FuelThreshold, 60 )
Fsm:SetDamageThreshold( self.DefenderDefault.DamageThreshold )
Fsm:SetDisengageRadius( self.DisengageRadius )
Fsm:Start()
Fsm:__Patrol( 2 )
@ -2322,17 +2379,18 @@ do -- AI_A2A_DISPATCHER
---
-- @param #AI_A2A_DISPATCHER self
function AI_A2A_DISPATCHER:onafterGCI( From, Event, To, Target, DefendersMissing, AIGroups )
function AI_A2A_DISPATCHER:onafterGCI( From, Event, To, DetectedItem, DefendersMissing, Friendlies )
local AttackerCount = Target.Set:Count()
local AttackerSet = DetectedItem.Set
local AttackerCount = AttackerSet:Count()
local DefendersCount = 0
for AIGroupID, AIGroup in pairs( AIGroups or {} ) do
for DefenderID, AIGroup in pairs( Friendlies or {} ) do
local Fsm = self:GetDefenderTaskFsm( AIGroup )
Fsm:__Engage( 1, Target.Set ) -- Engage on the TargetSetUnit
Fsm:__Engage( 1, AttackerSet ) -- Engage on the TargetSetUnit
self:SetDefenderTaskTarget( AIGroup, Target )
self:SetDefenderTaskTarget( AIGroup, DetectedItem )
DefendersCount = DefendersCount + AIGroup:GetSize()
end
@ -2349,9 +2407,11 @@ do -- AI_A2A_DISPATCHER
self:E( { DefenderSquadron } )
local SpawnCoord = DefenderSquadron.Airbase:GetCoordinate() -- Core.Point#COORDINATE
local TargetCoord = Target.Set:GetFirst():GetCoordinate()
--local TargetCoord = AttackerSet:GetFirst():GetCoordinate()
local TargetCoord = DetectedItem.InterceptCoord
if TargetCoord then
local Distance = SpawnCoord:Get2DDistance( TargetCoord )
self:F( { Distance = Distance, TargetCoord = TargetCoord } )
if ClosestDistance == 0 or Distance < ClosestDistance then
@ -2402,11 +2462,12 @@ do -- AI_A2A_DISPATCHER
Fsm:SetHomeAirbase( DefenderSquadron.Airbase )
Fsm:SetFuelThreshold( self.DefenderDefault.FuelThreshold, 60 )
Fsm:SetDamageThreshold( self.DefenderDefault.DamageThreshold )
Fsm:SetDisengageRadius( self.DisengageRadius )
Fsm:Start()
Fsm:__Engage( 2, Target.Set ) -- Engage on the TargetSetUnit
Fsm:__Engage( 2, DetectedItem.Set ) -- Engage on the TargetSetUnit
self:SetDefenderTask( DefenderGCI, "GCI", Fsm, Target )
self:SetDefenderTask( DefenderGCI, "GCI", Fsm, DetectedItem )
function Fsm:onafterRTB( Defender, From, Event, To )
@ -2475,20 +2536,20 @@ do -- AI_A2A_DISPATCHER
-- @param Functional.Detection#DETECTION_BASE.DetectedItem DetectedItem
-- @return Set#SET_UNIT TargetSetUnit: The target set of units.
-- @return #nil If there are no targets to be set.
function AI_A2A_DISPATCHER:EvaluateGCI( Target )
self:F( { Target.ItemID } )
function AI_A2A_DISPATCHER:EvaluateGCI( DetectedItem )
self:F( { DetectedItem.ItemID } )
local AttackerSet = Target.Set
local AttackerSet = DetectedItem.Set
local AttackerCount = AttackerSet:Count()
-- First, count the active AIGroups Units, targetting the DetectedSet
local DefenderCount = self:CountDefendersEngaged( Target )
local DefenderCount = self:CountDefendersEngaged( DetectedItem )
local DefendersMissing = AttackerCount - DefenderCount
self:F( { AttackerCount = AttackerCount, DefenderCount = DefenderCount, DefendersMissing = DefendersMissing } )
local Friendlies = self:CountDefendersToBeEngaged( Target, DefenderCount )
local Friendlies = self:CountDefendersToBeEngaged( DetectedItem, DefenderCount )
if Target.IsDetected == true then
if DetectedItem.IsDetected == true then
return DefendersMissing, Friendlies
end

View File

@ -940,6 +940,24 @@ do -- DETECTION_BASE
end
do -- Intercept Point
--- Set the parameters to calculate to optimal intercept point.
-- @param #DETECTION_BASE self
-- @param #boolean Intercept Intercept is true if an intercept point is calculated. Intercept is false if it is disabled. The default Intercept is false.
-- @param #number IntereptDelay If Intercept is true, then InterceptDelay is the average time it takes to get airplanes airborne.
-- @return #DETECTION_BASE self
function DETECTION_BASE:SetIntercept( Intercept, InterceptDelay )
self:F2()
self.Intercept = Intercept
self.InterceptDelay = InterceptDelay
return self
end
end
do -- Accept / Reject detected units
--- Accept detections if within a range in meters.
@ -1130,9 +1148,9 @@ do -- DETECTION_BASE
return DetectedItem.FriendliesNearBy
end
--- Returns friendly units nearby the FAC units sorted per distance ...
--- Returns the distance used to identify friendlies near the deteted item ...
-- @param #DETECTION_BASE self
-- @return #map<#number,Wrapper.Unit#UNIT> The map of Friendly UNITs.
-- @return #number The distance.
function DETECTION_BASE:GetFriendliesDistance( DetectedItem )
return DetectedItem.FriendliesDistance
@ -1161,7 +1179,8 @@ do -- DETECTION_BASE
local DetectedItem = ReportGroupData.DetectedItem -- Functional.Detection#DETECTION_BASE.DetectedItem
local DetectedSet = ReportGroupData.DetectedItem.Set
local DetectedUnit = DetectedSet:GetFirst()
local DetectedUnit = DetectedSet:GetFirst() -- Wrapper.Unit#UNIT
local InterceptCoord = ReportGroupData.InterceptCoord or DetectedUnit:GetCoordinate()
DetectedItem.FriendliesNearBy = nil
@ -1171,7 +1190,7 @@ do -- DETECTION_BASE
local SphereSearch = {
id = world.VolumeType.SPHERE,
params = {
point = DetectedUnit:GetVec3(),
point = InterceptCoord:GetVec3(),
radius = self.FriendliesRange,
}
@ -1185,7 +1204,8 @@ do -- DETECTION_BASE
local DetectedItem = ReportGroupData.DetectedItem -- Functional.Detection#DETECTION_BASE.DetectedItem
local DetectedSet = ReportGroupData.DetectedItem.Set
local DetectedUnit = DetectedSet:GetFirst() -- Wrapper.Unit#UNIT
local CenterCoord = DetectedUnit:GetCoordinate()
local InterceptCoord = ReportGroupData.InterceptCoord or DetectedUnit:GetCoordinate()
local DetectedUnitCoord = DetectedUnit:GetCoordinate()
local ReportSetGroup = ReportGroupData.ReportSetGroup
local EnemyCoalition = DetectedUnit:GetCoalition()
@ -1203,7 +1223,7 @@ do -- DETECTION_BASE
local FriendlyUnit = UNIT:Find( FoundDCSUnit )
local FriendlyUnitName = FriendlyUnit:GetName()
DetectedItem.FriendliesNearBy[FriendlyUnitName] = FriendlyUnit
local Distance = CenterCoord:Get2DDistance( FriendlyUnit:GetCoordinate() )
local Distance = InterceptCoord:Get2DDistance( FriendlyUnit:GetCoordinate() )
DetectedItem.FriendliesDistance = DetectedItem.FriendliesDistance or {}
DetectedItem.FriendliesDistance[Distance] = FriendlyUnit
return true
@ -1233,8 +1253,8 @@ do -- DETECTION_BASE
DetectedItem.FriendliesNearBy = DetectedItem.FriendliesNearBy or {}
DetectedItem.FriendliesNearBy[PlayerUnitName] = PlayerUnit
local CenterCoord = DetectedUnit:GetCoordinate()
local Distance = CenterCoord:Get2DDistance( PlayerUnit:GetCoordinate() )
--local CenterCoord = DetectedUnit:GetCoordinate()
local Distance = InterceptCoord:Get2DDistance( PlayerUnit:GetCoordinate() )
DetectedItem.FriendliesDistance = DetectedItem.FriendliesDistance or {}
DetectedItem.FriendliesDistance[Distance] = PlayerUnit
end
@ -2287,6 +2307,30 @@ do -- DETECTION_AREAS
end
--- Calculate the optimal intercept point of the DetectedItem.
-- @param #DETECTION_AREAS self
-- @param #DETECTION_BASE.DetectedItem DetectedItem
function DETECTION_AREAS:CalculateIntercept( DetectedItem )
if self.Intercept then
local DetectedSet = DetectedItem.Set
local DetectedUnit = DetectedSet:GetFirst() -- Wrapper.Unit#UNIT
local UnitSpeed = DetectedUnit:GetVelocityMPS()
local UnitHeading = DetectedUnit:GetHeading()
local UnitCoord = DetectedUnit:GetCoordinate()
local TranslateDistance = UnitSpeed * self.InterceptDelay
local InterceptCoord = UnitCoord:Translate( TranslateDistance, UnitHeading )
DetectedItem.InterceptCoord = InterceptCoord
else
DetectedItem.InterceptCoord = nil
end
end
--- Find the nearest FAC of the DetectedItem.
-- @param #DETECTION_AREAS self
-- @param #DETECTION_BASE.DetectedItem DetectedItem
@ -2605,6 +2649,8 @@ do -- DETECTION_AREAS
local DetectedItem = DetectedItemData -- #DETECTION_BASE.DetectedItem
local DetectedSet = DetectedItem.Set
local DetectedZone = DetectedItem.Zone
self:CalculateIntercept( DetectedItem )
self:ReportFriendliesNearBy( { DetectedItem = DetectedItem, ReportSetGroup = self.DetectionSetGroup } ) -- Fill the Friendlies table
self:CalculateThreatLevelA2G( DetectedItem ) -- Calculate A2G threat level

View File

@ -146,6 +146,12 @@
<td class="name" nowrap="nowrap"><a href="##(AI_A2A).ClearTargetDistance">AI_A2A:ClearTargetDistance()</a></td>
<td class="summary">
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(AI_A2A).DisengageRadius">AI_A2A.DisengageRadius</a></td>
<td class="summary">
</td>
</tr>
<tr>
@ -338,6 +344,12 @@
<td class="name" nowrap="nowrap"><a href="##(AI_A2A).SetDamageThreshold">AI_A2A:SetDamageThreshold(PatrolDamageThreshold)</a></td>
<td class="summary">
<p>When the AI is damaged beyond a certain treshold, it is required that the AI returns to the home base.</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(AI_A2A).SetDisengageRadius">AI_A2A:SetDisengageRadius(DisengageRadius)</a></td>
<td class="summary">
<p>Sets the disengage range, that when engaging a target beyond the specified range, the engagement will be cancelled and the plane will RTB.</p>
</td>
</tr>
<tr>
@ -543,6 +555,20 @@
</dd>
</dl>
<dl class="function">
<dt>
<em></em>
<a id="#(AI_A2A).DisengageRadius" >
<strong>AI_A2A.DisengageRadius</strong>
</a>
</dt>
<dd>
</dd>
</dl>
<dl class="function">
@ -575,6 +601,7 @@
<dl class="function">
<dt>
<em>#number</em>
<a id="#(AI_A2A).IdleCount" >
<strong>AI_A2A.IdleCount</strong>
</a>
@ -1397,6 +1424,33 @@ self</p>
<dl class="function">
<dt>
<a id="#(AI_A2A).SetDisengageRadius" >
<strong>AI_A2A:SetDisengageRadius(DisengageRadius)</strong>
</a>
</dt>
<dd>
<p>Sets the disengage range, that when engaging a target beyond the specified range, the engagement will be cancelled and the plane will RTB.</p>
<h3>Parameter</h3>
<ul>
<li>
<p><code><em>#number DisengageRadius </em></code>:
The disengage range.</p>
</li>
</ul>
<h3>Return value</h3>
<p><em><a href="##(AI_A2A)">#AI_A2A</a>:</em>
self</p>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(AI_A2A).SetDispatcher" >
<strong>AI_A2A:SetDispatcher(Dispatcher)</strong>
</a>

View File

@ -386,6 +386,12 @@ Per one, two, three, four?</p>
<td class="name" nowrap="nowrap"><a href="##(AI_A2A_DISPATCHER).Detection">AI_A2A_DISPATCHER.Detection</a></td>
<td class="summary">
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(AI_A2A_DISPATCHER).DisengageRadius">AI_A2A_DISPATCHER.DisengageRadius</a></td>
<td class="summary">
</td>
</tr>
<tr>
@ -401,7 +407,7 @@ Per one, two, three, four?</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(AI_A2A_DISPATCHER).EvaluateGCI">AI_A2A_DISPATCHER:EvaluateGCI(DetectedItem, Target)</a></td>
<td class="name" nowrap="nowrap"><a href="##(AI_A2A_DISPATCHER).EvaluateGCI">AI_A2A_DISPATCHER:EvaluateGCI(DetectedItem)</a></td>
<td class="summary">
<p>Creates an GCI task when there are targets for it.</p>
</td>
@ -704,6 +710,12 @@ Per one, two, three, four?</p>
<td class="name" nowrap="nowrap"><a href="##(AI_A2A_DISPATCHER).SetDefenderTaskTarget">AI_A2A_DISPATCHER:SetDefenderTaskTarget(AIGroup, Defender, Target)</a></td>
<td class="summary">
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(AI_A2A_DISPATCHER).SetDisengageRadius">AI_A2A_DISPATCHER:SetDisengageRadius(DisengageRadius)</a></td>
<td class="summary">
<p>Define the radius to disengage any target when the distance to the home base is larger than the specified meters.</p>
</td>
</tr>
<tr>
@ -716,6 +728,12 @@ Per one, two, three, four?</p>
<td class="name" nowrap="nowrap"><a href="##(AI_A2A_DISPATCHER).SetGciRadius">AI_A2A_DISPATCHER:SetGciRadius(GciRadius)</a></td>
<td class="summary">
<p>Define the radius to check if a target can be engaged by an ground controlled intercept.</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(AI_A2A_DISPATCHER).SetIntercept">AI_A2A_DISPATCHER:SetIntercept(InterceptDelay)</a></td>
<td class="summary">
</td>
</tr>
<tr>
@ -863,7 +881,7 @@ Per one, two, three, four?</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(AI_A2A_DISPATCHER).onafterGCI">AI_A2A_DISPATCHER:onafterGCI(From, Event, To, Target, DefendersMissing, AIGroups)</a></td>
<td class="name" nowrap="nowrap"><a href="##(AI_A2A_DISPATCHER).onafterGCI">AI_A2A_DISPATCHER:onafterGCI(From, Event, To, DetectedItem, DefendersMissing, Friendlies)</a></td>
<td class="summary">
</td>
@ -1419,7 +1437,9 @@ For some default settings, a method is available that allows you to tweak the de
<p>Use the method <a href="##(AI_A2A_DISPATCHER).SetDefaultDamageThreshold">AI<em>A2A</em>DISPATCHER.SetDefaultDamageThreshold</a>() to set the <strong>default damage treshold</strong> of spawned airplanes for all squadrons.</p>
<h2>10.7. Default CAP Time Interval.</h2>
<h2>10.7. Default settings for CAP.</h2>
<h3>10.7.1. Default CAP Time Interval.</h3>
<p>CAP is time driven, and will evaluate in random time intervals if a new CAP needs to be spawned.
The <strong>default CAP time interval</strong> is between <strong>180</strong> and <strong>600</strong> seconds.</p>
@ -1427,7 +1447,7 @@ The <strong>default CAP time interval</strong> is between <strong>180</strong> a
<p>Use the method <a href="##(AI_A2A_DISPATCHER).SetDefaultCapTimeInterval">AI<em>A2A</em>DISPATCHER.SetDefaultCapTimeInterval</a>() to set the <strong>default CAP time interval</strong> of spawned airplanes for all squadrons. <br/>
Note that you can still change the CAP limit and CAP time intervals for each CAP individually using the <a href="##(AI_A2A_DISPATCHER).SetSquadronCapTimeInterval">AI<em>A2A</em>DISPATCHER.SetSquadronCapTimeInterval</a>() method.</p>
<h2>10.8. Default CAP limit.</h2>
<h3>10.7.2. Default CAP limit.</h3>
<p>Multiple CAP can be airborne at the same time for one squadron, which is controlled by the <strong>CAP limit</strong>.
The <strong>default CAP limit</strong> is 1 CAP per squadron to be airborne at the same time.
@ -1437,6 +1457,31 @@ So, ensure that you set the default CAP limit <strong>before</strong> you spawn
<p>Use the method <a href="##(AI_A2A_DISPATCHER).SetDefaultCapTimeInterval">AI<em>A2A</em>DISPATCHER.SetDefaultCapTimeInterval</a>() to set the <strong>default CAP time interval</strong> of spawned airplanes for all squadrons. <br/>
Note that you can still change the CAP limit and CAP time intervals for each CAP individually using the <a href="##(AI_A2A_DISPATCHER).SetSquadronCapTimeInterval">AI<em>A2A</em>DISPATCHER.SetSquadronCapTimeInterval</a>() method.</p>
<h2>10.8. Default settings for GCI.</h2>
<h2>10.8.1. Optimal intercept point.</h2>
<p>When intruders are detected, the intrusion path of the attackers can be monitored by the EWR. <br/>
Although defender planes might be on standby at the airbase, it can still take some time to get the defenses up in the air if there aren't any defenses airborne.
This time can easily take 2 to 3 minutes, and even then the defenders still need to fly towards the target, which takes also time.</p>
<p>Therefore, an optimal <strong>intercept point</strong> is calculated which takes a couple of parameters:</p>
<ul>
<li>The average bearing of the intruders for an amount of seconds.</li>
<li>The average speed of the intruders for an amount of seconds.</li>
<li>The altitude of the intruders.</li>
<li>An assumed time it takes to get planes operational at the airbase.</li>
<li>The intercept speed, which is given as a parameter for each squadron or set by default for all squadrons.</li>
</ul>
<p>The <strong>intercept point</strong> will determine:</p>
<ul>
<li>If there are any friendlies close to engage the target. These can be defenders performing CAP or defenders in RTB.</li>
<li>The optimal airbase from where defenders will takeoff for gci.</li>
</ul>
<h2>11. Q &amp; A:</h2>
<h3>11.1. Which countries will be selected for each coalition?</h3>
@ -2050,6 +2095,20 @@ DefenderSquadron</p>
</dd>
</dl>
<dl class="function">
<dt>
<em></em>
<a id="#(AI_A2A_DISPATCHER).DisengageRadius" >
<strong>AI_A2A_DISPATCHER.DisengageRadius</strong>
</a>
</dt>
<dd>
</dd>
</dl>
<dl class="function">
@ -2105,24 +2164,19 @@ If there are no targets to be set.</p>
<dt>
<a id="#(AI_A2A_DISPATCHER).EvaluateGCI" >
<strong>AI_A2A_DISPATCHER:EvaluateGCI(DetectedItem, Target)</strong>
<strong>AI_A2A_DISPATCHER:EvaluateGCI(DetectedItem)</strong>
</a>
</dt>
<dd>
<p>Creates an GCI task when there are targets for it.</p>
<h3>Parameters</h3>
<h3>Parameter</h3>
<ul>
<li>
<p><code><em><a href="Functional.Detection.html##(DETECTION_BASE.DetectedItem)">Functional.Detection#DETECTION_BASE.DetectedItem</a> DetectedItem </em></code>: </p>
</li>
<li>
<p><code><em> Target </em></code>: </p>
</li>
</ul>
<h3>Return values</h3>
@ -3692,6 +3746,42 @@ From the airbase hot, from the airbase cold, in the air, from the runway.</p>
<dl class="function">
<dt>
<a id="#(AI_A2A_DISPATCHER).SetDisengageRadius" >
<strong>AI_A2A_DISPATCHER:SetDisengageRadius(DisengageRadius)</strong>
</a>
</dt>
<dd>
<p>Define the radius to disengage any target when the distance to the home base is larger than the specified meters.</p>
<h3>Parameter</h3>
<ul>
<li>
<p><code><em>#number DisengageRadius </em></code>:
(Optional, Default = 100000) The radius to disengage a target when too far from the home base.</p>
</li>
</ul>
<h3>Return value</h3>
<p><em><a href="##(AI_A2A_DISPATCHER)">#AI<em>A2A</em>DISPATCHER</a>:</em></p>
<h3>Usage:</h3>
<pre class="example"><code>
-- Set 50km as the disengage radius.
Dispatcher:SetDisengageRadius( 50000 )
-- Set 100km as the disengage radius.
Dispatcher:SetDisngageRadius() -- 100000 is the default value.
</code></pre>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(AI_A2A_DISPATCHER).SetEngageRadius" >
<strong>AI_A2A_DISPATCHER:SetEngageRadius(EngageRadius)</strong>
</a>
@ -3787,6 +3877,27 @@ If too large, intercept missions may be triggered when the detected target is to
<dl class="function">
<dt>
<a id="#(AI_A2A_DISPATCHER).SetIntercept" >
<strong>AI_A2A_DISPATCHER:SetIntercept(InterceptDelay)</strong>
</a>
</dt>
<dd>
<h3>Parameter</h3>
<ul>
<li>
<p><code><em> InterceptDelay </em></code>: </p>
</li>
</ul>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(AI_A2A_DISPATCHER).SetSquadron" >
<strong>AI_A2A_DISPATCHER:SetSquadron(SquadronName, AirbaseName, SpawnTemplates, Resources)</strong>
</a>
@ -4766,7 +4877,7 @@ Provide a value of <strong>true</strong> to display every 30 seconds a tactical
<dt>
<a id="#(AI_A2A_DISPATCHER).onafterGCI" >
<strong>AI_A2A_DISPATCHER:onafterGCI(From, Event, To, Target, DefendersMissing, AIGroups)</strong>
<strong>AI_A2A_DISPATCHER:onafterGCI(From, Event, To, DetectedItem, DefendersMissing, Friendlies)</strong>
</a>
</dt>
<dd>
@ -4792,7 +4903,7 @@ Provide a value of <strong>true</strong> to display every 30 seconds a tactical
</li>
<li>
<p><code><em> Target </em></code>: </p>
<p><code><em> DetectedItem </em></code>: </p>
</li>
<li>
@ -4802,7 +4913,7 @@ Provide a value of <strong>true</strong> to display every 30 seconds a tactical
</li>
<li>
<p><code><em> AIGroups </em></code>: </p>
<p><code><em> Friendlies </em></code>: </p>
</li>
</ul>

View File

@ -926,9 +926,6 @@ Use the method <a href="##(AI_PATROL_ZONE).ManageDamage">AI<em>PATROL</em>ZONE.M
<p> This table contains the targets detected during patrol.</p>
</dd>
</dl>
<dl class="function">

View File

@ -184,6 +184,12 @@ DETECTION uses the in-built detection capabilities of DCS World, but adds new fu
<td class="name" nowrap="nowrap"><a href="##(DETECTION_AREAS).BoundDetectedZones">DETECTION_AREAS:BoundDetectedZones()</a></td>
<td class="summary">
<p>Bound the detected zones</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(DETECTION_AREAS).CalculateIntercept">DETECTION_AREAS:CalculateIntercept(DetectedItem)</a></td>
<td class="summary">
<p>Calculate the optimal intercept point of the DetectedItem.</p>
</td>
</tr>
<tr>
@ -612,7 +618,7 @@ The different values of Unit.Category can be:</p>
<tr>
<td class="name" nowrap="nowrap"><a href="##(DETECTION_BASE).GetFriendliesDistance">DETECTION_BASE:GetFriendliesDistance(DetectedItem)</a></td>
<td class="summary">
<p>Returns friendly units nearby the FAC units sorted per distance ...</p>
<p>Returns the distance used to identify friendlies near the deteted item ...</p>
</td>
</tr>
<tr>
@ -667,6 +673,18 @@ The different values of Unit.Category can be:</p>
<td class="name" nowrap="nowrap"><a href="##(DETECTION_BASE).InitDetectVisual">DETECTION_BASE:InitDetectVisual(DetectVisual)</a></td>
<td class="summary">
<p>Detect Visual.</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(DETECTION_BASE).Intercept">DETECTION_BASE.Intercept</a></td>
<td class="summary">
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(DETECTION_BASE).InterceptDelay">DETECTION_BASE.InterceptDelay</a></td>
<td class="summary">
</td>
</tr>
<tr>
@ -841,6 +859,12 @@ The different values of Unit.Category can be:</p>
<td class="name" nowrap="nowrap"><a href="##(DETECTION_BASE).SetFriendliesRange">DETECTION_BASE:SetFriendliesRange(FriendliesRange)</a></td>
<td class="summary">
<p>Set the radius in meters to validate if friendlies are nearby.</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(DETECTION_BASE).SetIntercept">DETECTION_BASE:SetIntercept(Intercept, IntereptDelay, InterceptDelay)</a></td>
<td class="summary">
<p>Set the parameters to calculate to optimal intercept point.</p>
</td>
</tr>
<tr>
@ -959,6 +983,12 @@ The different values of Unit.Category can be:</p>
<td class="name" nowrap="nowrap"><a href="##(DETECTION_BASE.DetectedItem).ID">DETECTION_BASE.DetectedItem.ID</a></td>
<td class="summary">
<p>-- The identifier of the detected area.</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(DETECTION_BASE.DetectedItem).InterceptCoord">DETECTION_BASE.DetectedItem.InterceptCoord</a></td>
<td class="summary">
</td>
</tr>
<tr>
@ -1566,6 +1596,27 @@ self</p>
<dl class="function">
<dt>
<a id="#(DETECTION_AREAS).CalculateIntercept" >
<strong>DETECTION_AREAS:CalculateIntercept(DetectedItem)</strong>
</a>
</dt>
<dd>
<p>Calculate the optimal intercept point of the DetectedItem.</p>
<h3>Parameter</h3>
<ul>
<li>
<p><code><em><a href="##(DETECTION_BASE.DetectedItem)">#DETECTION_BASE.DetectedItem</a> DetectedItem </em></code>: </p>
</li>
</ul>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(DETECTION_AREAS).CalculateThreatLevelA2G" >
<strong>DETECTION_AREAS:CalculateThreatLevelA2G(DetectedItem)</strong>
</a>
@ -2414,6 +2465,7 @@ The index of the DetectedItem.</p>
<dl class="function">
<dt>
<em>#number</em>
<a id="#(DETECTION_BASE).DetectedItemMax" >
<strong>DETECTION_BASE.DetectedItemMax</strong>
</a>
@ -2579,7 +2631,7 @@ The group to generate the report for.</p>
<dl class="function">
<dt>
<em></em>
<em>#number</em>
<a id="#(DETECTION_BASE).DetectionInterval" >
<strong>DETECTION_BASE.DetectionInterval</strong>
</a>
@ -3002,7 +3054,7 @@ DetectedSet</p>
</dt>
<dd>
<p>Returns friendly units nearby the FAC units sorted per distance ...</p>
<p>Returns the distance used to identify friendlies near the deteted item ...</p>
<h3>Parameter</h3>
<ul>
@ -3014,8 +3066,8 @@ DetectedSet</p>
</ul>
<h3>Return value</h3>
<p><em><a href="##(map)">#map</a>:</em></p>
<h1>number,Wrapper.Unit#UNIT> The map of Friendly UNITs.</h1>
<p><em>#number:</em>
The distance. </p>
</dd>
</dl>
@ -3246,6 +3298,34 @@ self</p>
<p><em><a href="##(DETECTION_BASE)">#DETECTION_BASE</a>:</em>
self</p>
</dd>
</dl>
<dl class="function">
<dt>
<em></em>
<a id="#(DETECTION_BASE).Intercept" >
<strong>DETECTION_BASE.Intercept</strong>
</a>
</dt>
<dd>
</dd>
</dl>
<dl class="function">
<dt>
<em></em>
<a id="#(DETECTION_BASE).InterceptDelay" >
<strong>DETECTION_BASE.InterceptDelay</strong>
</a>
</dt>
<dd>
</dd>
</dl>
<dl class="function">
@ -4117,6 +4197,44 @@ self</p>
<dl class="function">
<dt>
<a id="#(DETECTION_BASE).SetIntercept" >
<strong>DETECTION_BASE:SetIntercept(Intercept, IntereptDelay, InterceptDelay)</strong>
</a>
</dt>
<dd>
<p>Set the parameters to calculate to optimal intercept point.</p>
<h3>Parameters</h3>
<ul>
<li>
<p><code><em>#boolean Intercept </em></code>:
Intercept is true if an intercept point is calculated. Intercept is false if it is disabled. The default Intercept is false.</p>
</li>
<li>
<p><code><em>#number IntereptDelay </em></code>:
If Intercept is true, then InterceptDelay is the average time it takes to get airplanes airborne.</p>
</li>
<li>
<p><code><em> InterceptDelay </em></code>: </p>
</li>
</ul>
<h3>Return value</h3>
<p><em><a href="##(DETECTION_BASE)">#DETECTION_BASE</a>:</em>
self</p>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(DETECTION_BASE).SetRejectZones" >
<strong>DETECTION_BASE:SetRejectZones(RejectZones)</strong>
</a>
@ -4540,6 +4658,20 @@ The To State string.</p>
<p>-- The identifier of the detected area.</p>
</dd>
</dl>
<dl class="function">
<dt>
<em></em>
<a id="#(DETECTION_BASE.DetectedItem).InterceptCoord" >
<strong>DETECTION_BASE.DetectedItem.InterceptCoord</strong>
</a>
</dt>
<dd>
</dd>
</dl>
<dl class="function">

View File

@ -1598,7 +1598,7 @@ A string defining the start state.</p>
<dl class="function">
<dt>
<em>#string</em>
<em></em>
<a id="#(FSM)._StartState" >
<strong>FSM._StartState</strong>
</a>
@ -1897,6 +1897,7 @@ A string defining the start state.</p>
<dl class="function">
<dt>
<em></em>
<a id="#(FSM).current" >
<strong>FSM.current</strong>
</a>

View File

@ -2200,9 +2200,6 @@ The group that was spawned. You can use this group for further actions.</p>
<p> Don't repeat the group from Take-Off till Landing and back Take-Off by ReSpawning.</p>
</dd>
</dl>
<dl class="function">
@ -2752,9 +2749,6 @@ when nothing was spawned.</p>
<p> By default, no InitLimit</p>
</dd>
</dl>
<dl class="function">
@ -2790,7 +2784,7 @@ when nothing was spawned.</p>
<dl class="function">
<dt>
<em>#number</em>
<em></em>
<a id="#(SPAWN).SpawnMaxGroups" >
<strong>SPAWN.SpawnMaxGroups</strong>
</a>
@ -2807,7 +2801,7 @@ when nothing was spawned.</p>
<dl class="function">
<dt>
<em>#number</em>
<em></em>
<a id="#(SPAWN).SpawnMaxUnitsAlive" >
<strong>SPAWN.SpawnMaxUnitsAlive</strong>
</a>
@ -3135,7 +3129,7 @@ Spawn_BE_KA50 = SPAWN:New( 'BE KA-50@RAMP-Ground Defense' ):Schedule( 600, 0.5 )
<dl class="function">
<dt>
<em>#boolean</em>
<em></em>
<a id="#(SPAWN).SpawnUnControlled" >
<strong>SPAWN.SpawnUnControlled</strong>
</a>

View File

@ -552,7 +552,7 @@ based on the tasking capabilities defined in <a href="Task.html##(TASK)">Task#TA
<dl class="function">
<dt>
<em><a href="Core.Cargo.html##(CARGO_GROUP)">Core.Cargo#CARGO_GROUP</a></em>
<em></em>
<a id="#(FSM_PROCESS).Cargo" >
<strong>FSM_PROCESS.Cargo</strong>
</a>
@ -566,7 +566,6 @@ based on the tasking capabilities defined in <a href="Task.html##(TASK)">Task#TA
<dl class="function">
<dt>
<em></em>
<a id="#(FSM_PROCESS).DeployZone" >
<strong>FSM_PROCESS.DeployZone</strong>
</a>
@ -631,7 +630,7 @@ based on the tasking capabilities defined in <a href="Task.html##(TASK)">Task#TA
<dl class="function">
<dt>
<em></em>
<em>#number</em>
<a id="#(TASK_CARGO).CargoLimit" >
<strong>TASK_CARGO.CargoLimit</strong>
</a>