Added infinite resources implementation.

This commit is contained in:
FlightControl_Master
2017-08-05 16:26:32 +02:00
parent 2ccfe27401
commit cc1b34937c
9 changed files with 376 additions and 70 deletions

View File

@@ -927,13 +927,13 @@ Per one, two, three, four?</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(AI_A2A_GCICAP).New">AI_A2A_GCICAP:New(EWRPrefixes, TemplatePrefixes, CapPrefixes, CapLimit, GroupingRadius, EngageRadius, GciRadius)</a></td>
<td class="name" nowrap="nowrap"><a href="##(AI_A2A_GCICAP).New">AI_A2A_GCICAP:New(EWRPrefixes, TemplatePrefixes, CapPrefixes, CapLimit, GroupingRadius, EngageRadius, GciRadius, Resources)</a></td>
<td class="summary">
<p>AI<em>A2A</em>GCICAP constructor.</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(AI_A2A_GCICAP).NewWithBorder">AI_A2A_GCICAP:NewWithBorder(EWRPrefixes, TemplatePrefixes, BorderPrefix, CapPrefixes, CapLimit, GroupingRadius, EngageRadius, GciRadius)</a></td>
<td class="name" nowrap="nowrap"><a href="##(AI_A2A_GCICAP).NewWithBorder">AI_A2A_GCICAP:NewWithBorder(EWRPrefixes, TemplatePrefixes, BorderPrefix, CapPrefixes, CapLimit, GroupingRadius, EngageRadius, GciRadius, Resources)</a></td>
<td class="summary">
<p>AI<em>A2A</em>GCICAP constructor with border.</p>
</td>
@@ -1156,7 +1156,7 @@ while defining which plane types are being used by the squadron and how many res
<li>Have name (string) that is the identifier or key of the squadron.</li>
<li>Have specific plane types.</li>
<li>Are located at one airbase.</li>
<li>Have a limited set of resources.</li>
<li>Optionally have a limited set of resources. The default is that squadrons have <strong>unlimited resources</strong>.</li>
</ul>
<p>The name of the squadron given acts as the <strong>squadron key</strong> in the AI_A2A_DISPATCHER:Squadron...() methods.</p>
@@ -4102,7 +4102,7 @@ If too large, intercept missions may be triggered when the detected target is to
<li>Have a <strong>name or key</strong> that is the identifier or key of the squadron.</li>
<li>Have <strong>specific plane types</strong> defined by <strong>templates</strong>.</li>
<li>Are <strong>located at one specific airbase</strong>. Multiple squadrons can be located at one airbase through.</li>
<li>Have a limited set of <strong>resources</strong>.</li>
<li>Optionally have a limited set of <strong>resources</strong>. The default is that squadrons have unlimited resources.</li>
</ul>
<p>The name of the squadron given acts as the <strong>squadron key</strong> in the AI_A2A_DISPATCHER:Squadron...() methods.</p>
@@ -4161,7 +4161,7 @@ If you have only one prefix name for a squadron, you don't need to use the <code
<li>
<p><code><em>#number Resources </em></code>:
A number that specifies how many resources are in stock of the squadron. It is still a bit buggy, this part. Just make this a large number for the moment. This will be fine tuned later.</p>
(optional) A number that specifies how many resources are in stock of the squadron. If not specified, the squadron will have infinite resources available.</p>
</li>
@@ -4174,17 +4174,26 @@ A number that specifies how many resources are in stock of the squadron. It is s
<h3>Usages:</h3>
<ul>
<li><pre class="example"><code> -- Now Setup the A2A dispatcher, and initialize it using the Detection object.
A2ADispatcher = AI_A2A_DISPATCHER:New( Detection ) </code></pre></li>
A2ADispatcher = AI_A2A_DISPATCHER:New( Detection )
</code></pre></li>
<li><pre class="example"><code> -- This will create squadron "Squadron1" at "Batumi" airbase, and will use plane types "SQ1" and has 40 planes in stock...
A2ADispatcher:SetSquadron( "Squadron1", "Batumi", "SQ1", 40 )</code></pre></li>
A2ADispatcher:SetSquadron( "Squadron1", "Batumi", "SQ1", 40 )
</code></pre></li>
<li><pre class="example"><code> -- This will create squadron "Sq 1" at "Batumi" airbase, and will use plane types "Mig-29" and "Su-27" and has 20 planes in stock...
-- Note that in this implementation, the A2A dispatcher will select a random plane when a new plane (group) needs to be spawned for defenses.
-- Note that in this implementation, the A2A dispatcher will select a random plane type when a new plane (group) needs to be spawned for defenses.
-- Note the usage of the {} for the airplane templates list.
A2ADispatcher:SetSquadron( "Sq 1", "Batumi", { "Mig-29", "Su-27" }, 40 )</code></pre></li>
A2ADispatcher:SetSquadron( "Sq 1", "Batumi", { "Mig-29", "Su-27" }, 40 )
</code></pre></li>
<li><pre class="example"><code> -- This will create 2 squadrons "104th" and "23th" at "Batumi" airbase, and will use plane types "Mig-29" and "Su-27" respectively and each squadron has 10 planes in stock...
-- Note that in this implementation, the A2A dispatcher will select a random plane when a new plane (group) needs to be spawned for defenses.
A2ADispatcher:SetSquadron( "104th", "Batumi", "Mig-29", 10 )
A2ADispatcher:SetSquadron( "23th", "Batumi", "Su-27", 10 )</code></pre></li>
A2ADispatcher:SetSquadron( "23th", "Batumi", "Su-27", 10 )
</code></pre></li>
<li><pre class="example"><code> -- This is an example like the previous, but now with infinite resources.
-- The Resources parameter is not given in the SetSquadron method.
A2ADispatcher:SetSquadron( "104th", "Batumi", "Mig-29" )
A2ADispatcher:SetSquadron( "23th", "Batumi", "Su-27" )
</code></pre></li>
</ul>
</dd>
@@ -5271,7 +5280,7 @@ Provide a value of <strong>true</strong> to display every 30 seconds a tactical
<dt>
<a id="#(AI_A2A_GCICAP).New" >
<strong>AI_A2A_GCICAP:New(EWRPrefixes, TemplatePrefixes, CapPrefixes, CapLimit, GroupingRadius, EngageRadius, GciRadius)</strong>
<strong>AI_A2A_GCICAP:New(EWRPrefixes, TemplatePrefixes, CapPrefixes, CapLimit, GroupingRadius, EngageRadius, GciRadius, Resources)</strong>
</a>
</dt>
<dd>
@@ -5322,6 +5331,12 @@ The radius in meters wherein detected airplanes will be engaged by airborne defe
<p><code><em>#number GciRadius </em></code>:
The radius in meters wherein detected airplanes will GCI.</p>
</li>
<li>
<p><code><em>#number Resources </em></code>:
The amount of resources that will be allocated to each squadron.</p>
</li>
</ul>
<h3>Return value</h3>
@@ -5329,13 +5344,76 @@ The radius in meters wherein detected airplanes will GCI.</p>
<p><em><a href="##(AI_A2A_GCICAP)">#AI<em>A2A</em>GCICAP</a>:</em></p>
<h3>Usage:</h3>
<pre class="example"><code>
-- Set a new AI A2A GCICAP object, based on an EWR network with a 30 km grouping radius
-- This for ground and awacs installations.
A2ADispatcher = AI_A2A_GCICAP:New( { "BlueEWRGroundRadars", "BlueEWRAwacs" }, 30000 )
</code></pre>
<h3>Usages:</h3>
<ul>
<li><pre class="example"><code>
-- Setup a new GCICAP dispatcher object. Each squadron has unlimited resources.
-- The EWR network group prefix is "DF CCCP". All groups starting with "DF CCCP" will be part of the EWR network.
-- The Squadron Templates prefix is "SQ CCCP". All groups starting with "SQ CCCP" will be considered as airplane templates.
-- The CAP Zone prefix is "CAP Zone".
-- The CAP Limit is 2.
A2ADispatcher = AI_A2A_GCICAP:New( { "DF CCCP" }, { "SQ CCCP" }, { "CAP Zone" }, 2 )
</code></pre></li>
<li><pre class="example"><code>
-- Setup a new GCICAP dispatcher object. Each squadron has unlimited resources.
-- The EWR network group prefix is "DF CCCP". All groups starting with "DF CCCP" will be part of the EWR network.
-- The Squadron Templates prefix is "SQ CCCP". All groups starting with "SQ CCCP" will be considered as airplane templates.
-- The CAP Zone prefix is "CAP Zone".
-- The CAP Limit is 2.
-- The Grouping Radius is set to 20000. Thus all planes within a 20km radius will be grouped as a group of targets.
A2ADispatcher = AI_A2A_GCICAP:New( { "DF CCCP" }, { "SQ CCCP" }, { "CAP Zone" }, 2, 20000 )
</code></pre></li>
<li><pre class="example"><code>
-- Setup a new GCICAP dispatcher object. Each squadron has unlimited resources.
-- The EWR network group prefix is "DF CCCP". All groups starting with "DF CCCP" will be part of the EWR network.
-- The Squadron Templates prefix is "SQ CCCP". All groups starting with "SQ CCCP" will be considered as airplane templates.
-- The CAP Zone prefix is "CAP Zone".
-- The CAP Limit is 2.
-- The Grouping Radius is set to 20000. Thus all planes within a 20km radius will be grouped as a group of targets.
-- The Engage Radius is set to 60000. Any defender without a task, and in healthy condition,
-- will be considered a defense task if the target is within 60km from the defender.
A2ADispatcher = AI_A2A_GCICAP:New( { "DF CCCP" }, { "SQ CCCP" }, { "CAP Zone" }, 2, 20000, 60000 )
</code></pre></li>
<li><pre class="example"><code>
-- Setup a new GCICAP dispatcher object. Each squadron has unlimited resources.
-- The EWR network group prefix is DF CCCP. All groups starting with DF CCCP will be part of the EWR network.
-- The Squadron Templates prefix is "SQ CCCP". All groups starting with "SQ CCCP" will be considered as airplane templates.
-- The CAP Zone prefix is "CAP Zone".
-- The CAP Limit is 2.
-- The Grouping Radius is set to 20000. Thus all planes within a 20km radius will be grouped as a group of targets.
-- The Engage Radius is set to 60000. Any defender without a task, and in healthy condition,
-- will be considered a defense task if the target is within 60km from the defender.
-- The GCI Radius is set to 150000. Any target detected within 150km will be considered for GCI engagement.
A2ADispatcher = AI_A2A_GCICAP:New( { "DF CCCP" }, { "SQ CCCP" }, { "CAP Zone" }, 2, 20000, 60000, 150000 )
</code></pre></li>
<li><pre class="example"><code>
-- Setup a new GCICAP dispatcher object. Each squadron has 30 resources.
-- The EWR network group prefix is "DF CCCP". All groups starting with "DF CCCP" will be part of the EWR network.
-- The Squadron Templates prefix is "SQ CCCP". All groups starting with "SQ CCCP" will be considered as airplane templates.
-- The CAP Zone prefix is "CAP Zone".
-- The CAP Limit is 2.
-- The Grouping Radius is set to 20000. Thus all planes within a 20km radius will be grouped as a group of targets.
-- The Engage Radius is set to 60000. Any defender without a task, and in healthy condition,
-- will be considered a defense task if the target is within 60km from the defender.
-- The GCI Radius is set to 150000. Any target detected within 150km will be considered for GCI engagement.
-- The amount of resources for each squadron is set to 30. Thus about 30 resources are allocated to each squadron created.
A2ADispatcher = AI_A2A_GCICAP:New( { "DF CCCP" }, { "SQ CCCP" }, { "CAP Zone" }, 2, 20000, 60000, 150000, 30 )
</code></pre></li>
<li><pre class="example"><code>
-- Setup a new GCICAP dispatcher object. Each squadron has 30 resources.
-- The EWR network group prefix is "DF CCCP". All groups starting with "DF CCCP" will be part of the EWR network.
-- The Squadron Templates prefix is "SQ CCCP". All groups starting with "SQ CCCP" will be considered as airplane templates.
-- The CAP Zone prefix is nil. No CAP is created.
-- The CAP Limit is nil.
-- The Grouping Radius is nil. The default range of 6km radius will be grouped as a group of targets.
-- The Engage Radius is set nil. The default Engage Radius will be used to consider a defenser being assigned to a task.
-- The GCI Radius is nil. Any target detected within the default GCI Radius will be considered for GCI engagement.
-- The amount of resources for each squadron is set to 30. Thus about 30 resources are allocated to each squadron created.
A2ADispatcher = AI_A2A_GCICAP:New( { "DF CCCP" }, { "SQ CCCP" }, nil, nil, nil, nil, nil, 30 )
</code></pre></li>
</ul>
</dd>
</dl>
@@ -5343,7 +5421,7 @@ The radius in meters wherein detected airplanes will GCI.</p>
<dt>
<a id="#(AI_A2A_GCICAP).NewWithBorder" >
<strong>AI_A2A_GCICAP:NewWithBorder(EWRPrefixes, TemplatePrefixes, BorderPrefix, CapPrefixes, CapLimit, GroupingRadius, EngageRadius, GciRadius)</strong>
<strong>AI_A2A_GCICAP:NewWithBorder(EWRPrefixes, TemplatePrefixes, BorderPrefix, CapPrefixes, CapLimit, GroupingRadius, EngageRadius, GciRadius, Resources)</strong>
</a>
</dt>
<dd>
@@ -5400,6 +5478,12 @@ The radius in meters wherein detected airplanes will be engaged by airborne defe
<p><code><em>#number GciRadius </em></code>:
The radius in meters wherein detected airplanes will GCI.</p>
</li>
<li>
<p><code><em>#number Resources </em></code>:
The amount of resources that will be allocated to each squadron.</p>
</li>
</ul>
<h3>Return value</h3>
@@ -5407,13 +5491,85 @@ The radius in meters wherein detected airplanes will GCI.</p>
<p><em><a href="##(AI_A2A_GCICAP)">#AI<em>A2A</em>GCICAP</a>:</em></p>
<h3>Usage:</h3>
<pre class="example"><code>
-- Set a new AI A2A GCICAP object, based on an EWR network with a 30 km grouping radius
-- This for ground and awacs installations.
A2ADispatcher = AI_A2A_GCICAP:New( { "BlueEWRGroundRadars", "BlueEWRAwacs" }, 30000 )
</code></pre>
<h3>Usages:</h3>
<ul>
<li><pre class="example"><code>
-- Setup a new GCICAP dispatcher object with a border. Each squadron has unlimited resources.
-- The EWR network group prefix is "DF CCCP". All groups starting with "DF CCCP" will be part of the EWR network.
-- The Squadron Templates prefix is "SQ CCCP". All groups starting with "SQ CCCP" will be considered as airplane templates.
-- The CAP Zone prefix is "CAP Zone".
-- The CAP Limit is 2.
A2ADispatcher = AI_A2A_GCICAP:NewWithBorder( { "DF CCCP" }, { "SQ CCCP" }, "Border", { "CAP Zone" }, 2 )
</code></pre></li>
<li><pre class="example"><code>
-- Setup a new GCICAP dispatcher object with a border. Each squadron has unlimited resources.
-- The EWR network group prefix is "DF CCCP". All groups starting with "DF CCCP" will be part of the EWR network.
-- The Squadron Templates prefix is "SQ CCCP". All groups starting with "SQ CCCP" will be considered as airplane templates.
-- The Border prefix is "Border". This will setup a border using the group defined within the mission editor with the name Border.
-- The CAP Zone prefix is "CAP Zone".
-- The CAP Limit is 2.
-- The Grouping Radius is set to 20000. Thus all planes within a 20km radius will be grouped as a group of targets.
A2ADispatcher = AI_A2A_GCICAP:NewWithBorder( { "DF CCCP" }, { "SQ CCCP" }, "Border", { "CAP Zone" }, 2, 20000 )
</code></pre></li>
<li><pre class="example"><code>
-- Setup a new GCICAP dispatcher object with a border. Each squadron has unlimited resources.
-- The EWR network group prefix is "DF CCCP". All groups starting with "DF CCCP" will be part of the EWR network.
-- The Squadron Templates prefix is "SQ CCCP". All groups starting with "SQ CCCP" will be considered as airplane templates.
-- The Border prefix is "Border". This will setup a border using the group defined within the mission editor with the name Border.
-- The CAP Zone prefix is "CAP Zone".
-- The CAP Limit is 2.
-- The Grouping Radius is set to 20000. Thus all planes within a 20km radius will be grouped as a group of targets.
-- The Engage Radius is set to 60000. Any defender without a task, and in healthy condition,
-- will be considered a defense task if the target is within 60km from the defender.
A2ADispatcher = AI_A2A_GCICAP:NewWithBorder( { "DF CCCP" }, { "SQ CCCP" }, "Border", { "CAP Zone" }, 2, 20000, 60000 )
</code></pre></li>
<li><pre class="example"><code>
-- Setup a new GCICAP dispatcher object with a border. Each squadron has unlimited resources.
-- The EWR network group prefix is "DF CCCP". All groups starting with "DF CCCP" will be part of the EWR network.
-- The Squadron Templates prefix is "SQ CCCP". All groups starting with "SQ CCCP" will be considered as airplane templates.
-- The Border prefix is "Border". This will setup a border using the group defined within the mission editor with the name Border.
-- The CAP Zone prefix is "CAP Zone".
-- The CAP Limit is 2.
-- The Grouping Radius is set to 20000. Thus all planes within a 20km radius will be grouped as a group of targets.
-- The Engage Radius is set to 60000. Any defender without a task, and in healthy condition,
-- will be considered a defense task if the target is within 60km from the defender.
-- The GCI Radius is set to 150000. Any target detected within 150km will be considered for GCI engagement.
A2ADispatcher = AI_A2A_GCICAP:NewWithBorder( { "DF CCCP" }, { "SQ CCCP" }, "Border", { "CAP Zone" }, 2, 20000, 60000, 150000 )
</code></pre></li>
<li><pre class="example"><code>
-- Setup a new GCICAP dispatcher object with a border. Each squadron has 30 resources.
-- The EWR network group prefix is "DF CCCP". All groups starting with "DF CCCP" will be part of the EWR network.
-- The Squadron Templates prefix is "SQ CCCP". All groups starting with "SQ CCCP" will be considered as airplane templates.
-- The Border prefix is "Border". This will setup a border using the group defined within the mission editor with the name Border.
-- The CAP Zone prefix is "CAP Zone".
-- The CAP Limit is 2.
-- The Grouping Radius is set to 20000. Thus all planes within a 20km radius will be grouped as a group of targets.
-- The Engage Radius is set to 60000. Any defender without a task, and in healthy condition,
-- will be considered a defense task if the target is within 60km from the defender.
-- The GCI Radius is set to 150000. Any target detected within 150km will be considered for GCI engagement.
-- The amount of resources for each squadron is set to 30. Thus about 30 resources are allocated to each squadron created.
A2ADispatcher = AI_A2A_GCICAP:NewWithBorder( { "DF CCCP" }, { "SQ CCCP" }, "Border", { "CAP Zone" }, 2, 20000, 60000, 150000, 30 )
</code></pre></li>
<li><pre class="example"><code>
-- Setup a new GCICAP dispatcher object with a border. Each squadron has 30 resources.
-- The EWR network group prefix is "DF CCCP". All groups starting with "DF CCCP" will be part of the EWR network.
-- The Squadron Templates prefix is "SQ CCCP". All groups starting with "SQ CCCP" will be considered as airplane templates.
-- The Border prefix is "Border". This will setup a border using the group defined within the mission editor with the name Border.
-- The CAP Zone prefix is nil. No CAP is created.
-- The CAP Limit is nil.
-- The Grouping Radius is nil. The default range of 6km radius will be grouped as a group of targets.
-- The Engage Radius is set nil. The default Engage Radius will be used to consider a defenser being assigned to a task.
-- The GCI Radius is nil. Any target detected within the default GCI Radius will be considered for GCI engagement.
-- The amount of resources for each squadron is set to 30. Thus about 30 resources are allocated to each squadron created.
A2ADispatcher = AI_A2A_GCICAP:NewWithBorder( { "DF CCCP" }, { "SQ CCCP" }, "Border", nil, nil, nil, nil, nil, 30 )
</code></pre></li>
</ul>
</dd>
</dl>

View File

@@ -2464,7 +2464,6 @@ The index of the DetectedItem.</p>
<dl class="function">
<dt>
<em>#number</em>
<a id="#(DETECTION_BASE).DetectedItemCount" >
<strong>DETECTION_BASE.DetectedItemCount</strong>
</a>
@@ -2478,7 +2477,6 @@ The index of the DetectedItem.</p>
<dl class="function">
<dt>
<em>#number</em>
<a id="#(DETECTION_BASE).DetectedItemMax" >
<strong>DETECTION_BASE.DetectedItemMax</strong>
</a>
@@ -2644,7 +2642,7 @@ The group to generate the report for.</p>
<dl class="function">
<dt>
<em>#number</em>
<em></em>
<a id="#(DETECTION_BASE).DetectionInterval" >
<strong>DETECTION_BASE.DetectionInterval</strong>
</a>

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

@@ -2829,7 +2829,6 @@ The y coordinate.</p>
<dl class="function">
<dt>
<em></em>
<a id="#(POINT_VEC2).z" >
<strong>POINT_VEC2.z</strong>
</a>

View File

@@ -1142,7 +1142,7 @@ true if metric.</p>
<dl class="function">
<dt>
<em></em>
<em>#boolean</em>
<a id="#(SETTINGS).Metric" >
<strong>SETTINGS.Metric</strong>
</a>

View File

@@ -2194,6 +2194,9 @@ 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">
@@ -2749,9 +2752,6 @@ when nothing was spawned.</p>
<p> By default, no InitLimit</p>
</dd>
</dl>
<dl class="function">
@@ -2787,7 +2787,7 @@ when nothing was spawned.</p>
<dl class="function">
<dt>
<em>#number</em>
<em></em>
<a id="#(SPAWN).SpawnMaxGroups" >
<strong>SPAWN.SpawnMaxGroups</strong>
</a>
@@ -2804,7 +2804,7 @@ when nothing was spawned.</p>
<dl class="function">
<dt>
<em>#number</em>
<em></em>
<a id="#(SPAWN).SpawnMaxUnitsAlive" >
<strong>SPAWN.SpawnMaxUnitsAlive</strong>
</a>

View File

@@ -436,7 +436,6 @@ ptional) The name of the new static.</p>
<dl class="function">
<dt>
<em>#number</em>
<a id="#(SPAWNSTATIC).SpawnIndex" >
<strong>SPAWNSTATIC.SpawnIndex</strong>
</a>

View File

@@ -765,7 +765,6 @@ true if it is lasing</p>
<dl class="function">
<dt>
<em></em>
<a id="#(SPOT).ScheduleID" >
<strong>SPOT.ScheduleID</strong>
</a>
@@ -779,7 +778,6 @@ true if it is lasing</p>
<dl class="function">
<dt>
<em></em>
<a id="#(SPOT).SpotIR" >
<strong>SPOT.SpotIR</strong>
</a>
@@ -793,7 +791,6 @@ true if it is lasing</p>
<dl class="function">
<dt>
<em></em>
<a id="#(SPOT).SpotLaser" >
<strong>SPOT.SpotLaser</strong>
</a>
@@ -807,7 +804,6 @@ true if it is lasing</p>
<dl class="function">
<dt>
<em></em>
<a id="#(SPOT).Target" >
<strong>SPOT.Target</strong>
</a>