Merge pull request #325 from FlightControl-Master/FlightControl

Fixes for tasking
This commit is contained in:
Sven Van de Velde 2017-03-20 12:54:30 +01:00 committed by GitHub
commit e50e08dc38
32 changed files with 1344 additions and 971 deletions

View File

@ -420,7 +420,6 @@ do -- FSM
for ProcessID, Process in pairs( self:GetProcesses() ) do
if Process.From == From and Process.Event == Event then
self:T( Process )
return Process.fsm
end
end
@ -449,7 +448,7 @@ do -- FSM
-- @param #number Score is a number providing the score of the status.
-- @return #FSM self
function FSM:AddScore( State, ScoreText, Score )
self:F2( { State, ScoreText, Score } )
self:F( { State, ScoreText, Score } )
self._Scores[State] = self._Scores[State] or {}
self._Scores[State].ScoreText = ScoreText
@ -467,15 +466,16 @@ do -- FSM
-- @param #number Score is a number providing the score of the status.
-- @return #FSM self
function FSM:AddScoreProcess( From, Event, State, ScoreText, Score )
self:F2( { Event, State, ScoreText, Score } )
self:F( { From, Event, State, ScoreText, Score } )
local Process = self:GetProcess( From, Event )
self:T( { Process = Process._Name, Scores = Process._Scores, State = State, ScoreText = ScoreText, Score = Score } )
Process._Scores[State] = Process._Scores[State] or {}
Process._Scores[State].ScoreText = ScoreText
Process._Scores[State].Score = Score
self:T( Process._Scores )
return Process
end
@ -1047,14 +1047,14 @@ end
-- @param #string Event
-- @param #string From
-- @param #string To
function FSM_PROCESS:onstatechange( ProcessUnit, From, Event, To, Dummy )
function FSM_PROCESS:onstatechange( ProcessUnit, Task, From, Event, To, Dummy )
self:T( { ProcessUnit, From, Event, To, Dummy, self:IsTrace() } )
if self:IsTrace() then
MESSAGE:New( "@ Process " .. self:GetClassNameAndID() .. " : " .. Event .. " changed to state " .. To, 2 ):ToAll()
end
self:T( self._Scores[To] )
self:T( { Scores = self._Scores, To = To } )
-- TODO: This needs to be reworked with a callback functions allocated within Task, and set within the mission script from the Task Objects...
if self._Scores[To] then

View File

@ -1,222 +1,27 @@
--- **Core** - SET classes define **collections** of objects to perform **bulk actions** and logically **group** objects.
--- **Core** - SET_ classes define **collections** of objects to perform **bulk actions** and logically **group** objects.
--
-- ![Banner Image](..\Presentations\SET\Dia1.JPG)
--
-- ===
--
-- 1) @{Set#SET_BASE} class, extends @{Base#BASE}
-- ==============================================
-- The @{Set#SET_BASE} class defines the core functions that define a collection of objects.
-- A SET provides iterators to iterate the SET, but will **temporarily** yield the ForEach interator loop at defined **"intervals"** to the mail simulator loop.
-- In this way, large loops can be done while not blocking the simulator main processing loop.
-- The default **"yield interval"** is after 10 objects processed.
-- The default **"time interval"** is after 0.001 seconds.
-- SET_ classes group objects of the same type into a collection, which is either:
--
-- 1.1) Add or remove objects from the SET
-- ---------------------------------------
-- Some key core functions are @{Set#SET_BASE.Add} and @{Set#SET_BASE.Remove} to add or remove objects from the SET in your logic.
-- * Manually managed using the **:Add...()** or **:Remove...()** methods. The initial SET can be filtered with the **@{#SET_BASE.FilterOnce}()** method
-- * Dynamically updated when new objects are created or objects are destroyed using the **@{#SET_BASE.FilterStart}()** method.
--
-- 1.2) Define the SET iterator **"yield interval"** and the **"time interval"**
-- -----------------------------------------------------------------------------
-- Modify the iterator intervals with the @{Set#SET_BASE.SetInteratorIntervals} method.
-- You can set the **"yield interval"**, and the **"time interval"**. (See above).
-- Various types of SET_ classes are available:
--
-- ===
-- * @{#SET_UNIT}: Defines a colleciton of @{Unit}s filtered by filter criteria.
-- * @{#SET_GROUP}: Defines a collection of @{Group}s filtered by filter criteria.
-- * @{#SET_CLIENT}: Defines a collection of @{Client}s filterd by filter criteria.
-- * @{#SET_AIRBASE}: Defines a collection of @{Airbase}s filtered by filter criteria.
--
-- 2) @{Set#SET_GROUP} class, extends @{Set#SET_BASE}
-- ==================================================
-- Mission designers can use the @{Set#SET_GROUP} class to build sets of groups belonging to certain:
-- These classes are derived from @{#SET_BASE}, which contains the main methods to manage SETs.
--
-- * Coalitions
-- * Categories
-- * Countries
-- * Starting with certain prefix strings.
-- A multitude of other methods are available in SET_ classes that allow to:
--
-- 2.1) SET_GROUP construction method:
-- -----------------------------------
-- Create a new SET_GROUP object with the @{#SET_GROUP.New} method:
--
-- * @{#SET_GROUP.New}: Creates a new SET_GROUP object.
--
-- 2.2) Add or Remove GROUP(s) from SET_GROUP:
-- -------------------------------------------
-- GROUPS can be added and removed using the @{Set#SET_GROUP.AddGroupsByName} and @{Set#SET_GROUP.RemoveGroupsByName} respectively.
-- These methods take a single GROUP name or an array of GROUP names to be added or removed from SET_GROUP.
--
-- 2.3) SET_GROUP filter criteria:
-- -------------------------------
-- You can set filter criteria to define the set of groups within the SET_GROUP.
-- Filter criteria are defined by:
--
-- * @{#SET_GROUP.FilterCoalitions}: Builds the SET_GROUP with the groups belonging to the coalition(s).
-- * @{#SET_GROUP.FilterCategories}: Builds the SET_GROUP with the groups belonging to the category(ies).
-- * @{#SET_GROUP.FilterCountries}: Builds the SET_GROUP with the gruops belonging to the country(ies).
-- * @{#SET_GROUP.FilterPrefixes}: Builds the SET_GROUP with the groups starting with the same prefix string(s).
--
-- Once the filter criteria have been set for the SET_GROUP, you can start filtering using:
--
-- * @{#SET_GROUP.FilterStart}: Starts the filtering of the groups within the SET_GROUP and add or remove GROUP objects **dynamically**.
--
-- Planned filter criteria within development are (so these are not yet available):
--
-- * @{#SET_GROUP.FilterZones}: Builds the SET_GROUP with the groups within a @{Zone#ZONE}.
--
-- 2.4) SET_GROUP iterators:
-- -------------------------
-- Once the filters have been defined and the SET_GROUP has been built, you can iterate the SET_GROUP with the available iterator methods.
-- The iterator methods will walk the SET_GROUP set, and call for each element within the set a function that you provide.
-- The following iterator methods are currently available within the SET_GROUP:
--
-- * @{#SET_GROUP.ForEachGroup}: Calls a function for each alive group it finds within the SET_GROUP.
-- * @{#SET_GROUP.ForEachGroupCompletelyInZone}: Iterate the SET_GROUP and call an iterator function for each **alive** GROUP presence completely in a @{Zone}, providing the GROUP and optional parameters to the called function.
-- * @{#SET_GROUP.ForEachGroupPartlyInZone}: Iterate the SET_GROUP and call an iterator function for each **alive** GROUP presence partly in a @{Zone}, providing the GROUP and optional parameters to the called function.
-- * @{#SET_GROUP.ForEachGroupNotInZone}: Iterate the SET_GROUP and call an iterator function for each **alive** GROUP presence not in a @{Zone}, providing the GROUP and optional parameters to the called function.
--
-- ====
--
-- 3) @{Set#SET_UNIT} class, extends @{Set#SET_BASE}
-- ===================================================
-- Mission designers can use the @{Set#SET_UNIT} class to build sets of units belonging to certain:
--
-- * Coalitions
-- * Categories
-- * Countries
-- * Unit types
-- * Starting with certain prefix strings.
--
-- 3.1) SET_UNIT construction method:
-- ----------------------------------
-- Create a new SET_UNIT object with the @{#SET_UNIT.New} method:
--
-- * @{#SET_UNIT.New}: Creates a new SET_UNIT object.
--
-- 3.2) Add or Remove UNIT(s) from SET_UNIT:
-- -----------------------------------------
-- UNITs can be added and removed using the @{Set#SET_UNIT.AddUnitsByName} and @{Set#SET_UNIT.RemoveUnitsByName} respectively.
-- These methods take a single UNIT name or an array of UNIT names to be added or removed from SET_UNIT.
--
-- 3.3) SET_UNIT filter criteria:
-- ------------------------------
-- You can set filter criteria to define the set of units within the SET_UNIT.
-- Filter criteria are defined by:
--
-- * @{#SET_UNIT.FilterCoalitions}: Builds the SET_UNIT with the units belonging to the coalition(s).
-- * @{#SET_UNIT.FilterCategories}: Builds the SET_UNIT with the units belonging to the category(ies).
-- * @{#SET_UNIT.FilterTypes}: Builds the SET_UNIT with the units belonging to the unit type(s).
-- * @{#SET_UNIT.FilterCountries}: Builds the SET_UNIT with the units belonging to the country(ies).
-- * @{#SET_UNIT.FilterPrefixes}: Builds the SET_UNIT with the units starting with the same prefix string(s).
--
-- Once the filter criteria have been set for the SET_UNIT, you can start filtering using:
--
-- * @{#SET_UNIT.FilterStart}: Starts the filtering of the units within the SET_UNIT.
--
-- Planned filter criteria within development are (so these are not yet available):
--
-- * @{#SET_UNIT.FilterZones}: Builds the SET_UNIT with the units within a @{Zone#ZONE}.
--
-- 3.4) SET_UNIT iterators:
-- ------------------------
-- Once the filters have been defined and the SET_UNIT has been built, you can iterate the SET_UNIT with the available iterator methods.
-- The iterator methods will walk the SET_UNIT set, and call for each element within the set a function that you provide.
-- The following iterator methods are currently available within the SET_UNIT:
--
-- * @{#SET_UNIT.ForEachUnit}: Calls a function for each alive unit it finds within the SET_UNIT.
-- * @{#SET_GROUP.ForEachGroupCompletelyInZone}: Iterate the SET_GROUP and call an iterator function for each **alive** GROUP presence completely in a @{Zone}, providing the GROUP and optional parameters to the called function.
-- * @{#SET_GROUP.ForEachGroupNotInZone}: Iterate the SET_GROUP and call an iterator function for each **alive** GROUP presence not in a @{Zone}, providing the GROUP and optional parameters to the called function.
--
-- Planned iterators methods in development are (so these are not yet available):
--
-- * @{#SET_UNIT.ForEachUnitInUnit}: Calls a function for each unit contained within the SET_UNIT.
-- * @{#SET_UNIT.ForEachUnitCompletelyInZone}: Iterate and call an iterator function for each **alive** UNIT presence completely in a @{Zone}, providing the UNIT and optional parameters to the called function.
-- * @{#SET_UNIT.ForEachUnitNotInZone}: Iterate and call an iterator function for each **alive** UNIT presence not in a @{Zone}, providing the UNIT and optional parameters to the called function.
--
-- ===
--
-- 4) @{Set#SET_CLIENT} class, extends @{Set#SET_BASE}
-- ===================================================
-- Mission designers can use the @{Set#SET_CLIENT} class to build sets of units belonging to certain:
--
-- * Coalitions
-- * Categories
-- * Countries
-- * Client types
-- * Starting with certain prefix strings.
--
-- 4.1) SET_CLIENT construction method:
-- ----------------------------------
-- Create a new SET_CLIENT object with the @{#SET_CLIENT.New} method:
--
-- * @{#SET_CLIENT.New}: Creates a new SET_CLIENT object.
--
-- 4.2) Add or Remove CLIENT(s) from SET_CLIENT:
-- -----------------------------------------
-- CLIENTs can be added and removed using the @{Set#SET_CLIENT.AddClientsByName} and @{Set#SET_CLIENT.RemoveClientsByName} respectively.
-- These methods take a single CLIENT name or an array of CLIENT names to be added or removed from SET_CLIENT.
--
-- 4.3) SET_CLIENT filter criteria:
-- ------------------------------
-- You can set filter criteria to define the set of clients within the SET_CLIENT.
-- Filter criteria are defined by:
--
-- * @{#SET_CLIENT.FilterCoalitions}: Builds the SET_CLIENT with the clients belonging to the coalition(s).
-- * @{#SET_CLIENT.FilterCategories}: Builds the SET_CLIENT with the clients belonging to the category(ies).
-- * @{#SET_CLIENT.FilterTypes}: Builds the SET_CLIENT with the clients belonging to the client type(s).
-- * @{#SET_CLIENT.FilterCountries}: Builds the SET_CLIENT with the clients belonging to the country(ies).
-- * @{#SET_CLIENT.FilterPrefixes}: Builds the SET_CLIENT with the clients starting with the same prefix string(s).
--
-- Once the filter criteria have been set for the SET_CLIENT, you can start filtering using:
--
-- * @{#SET_CLIENT.FilterStart}: Starts the filtering of the clients within the SET_CLIENT.
--
-- Planned filter criteria within development are (so these are not yet available):
--
-- * @{#SET_CLIENT.FilterZones}: Builds the SET_CLIENT with the clients within a @{Zone#ZONE}.
--
-- 4.4) SET_CLIENT iterators:
-- ------------------------
-- Once the filters have been defined and the SET_CLIENT has been built, you can iterate the SET_CLIENT with the available iterator methods.
-- The iterator methods will walk the SET_CLIENT set, and call for each element within the set a function that you provide.
-- The following iterator methods are currently available within the SET_CLIENT:
--
-- * @{#SET_CLIENT.ForEachClient}: Calls a function for each alive client it finds within the SET_CLIENT.
--
-- ====
--
-- 5) @{Set#SET_AIRBASE} class, extends @{Set#SET_BASE}
-- ====================================================
-- Mission designers can use the @{Set#SET_AIRBASE} class to build sets of airbases optionally belonging to certain:
--
-- * Coalitions
--
-- 5.1) SET_AIRBASE construction
-- -----------------------------
-- Create a new SET_AIRBASE object with the @{#SET_AIRBASE.New} method:
--
-- * @{#SET_AIRBASE.New}: Creates a new SET_AIRBASE object.
--
-- 5.2) Add or Remove AIRBASEs from SET_AIRBASE
-- --------------------------------------------
-- AIRBASEs can be added and removed using the @{Set#SET_AIRBASE.AddAirbasesByName} and @{Set#SET_AIRBASE.RemoveAirbasesByName} respectively.
-- These methods take a single AIRBASE name or an array of AIRBASE names to be added or removed from SET_AIRBASE.
--
-- 5.3) SET_AIRBASE filter criteria
-- --------------------------------
-- You can set filter criteria to define the set of clients within the SET_AIRBASE.
-- Filter criteria are defined by:
--
-- * @{#SET_AIRBASE.FilterCoalitions}: Builds the SET_AIRBASE with the airbases belonging to the coalition(s).
--
-- Once the filter criteria have been set for the SET_AIRBASE, you can start filtering using:
--
-- * @{#SET_AIRBASE.FilterStart}: Starts the filtering of the airbases within the SET_AIRBASE.
--
-- 5.4) SET_AIRBASE iterators:
-- ---------------------------
-- Once the filters have been defined and the SET_AIRBASE has been built, you can iterate the SET_AIRBASE with the available iterator methods.
-- The iterator methods will walk the SET_AIRBASE set, and call for each airbase within the set a function that you provide.
-- The following iterator methods are currently available within the SET_AIRBASE:
--
-- * @{#SET_AIRBASE.ForEachAirbase}: Calls a function for each airbase it finds within the SET_AIRBASE.
--
-- ====
-- * Validate the presence of objects in the SET.
-- * Trigger events when objects in the SET change a zone presence.
--
-- ### Authors:
--
@ -228,7 +33,22 @@
-- @module Set
--- SET_BASE class
--- # 1) SET_BASE class, extends @{Base#BASE}
-- The @{Set#SET_BASE} class defines the core functions that define a collection of objects.
-- A SET provides iterators to iterate the SET, but will **temporarily** yield the ForEach interator loop at defined **"intervals"** to the mail simulator loop.
-- In this way, large loops can be done while not blocking the simulator main processing loop.
-- The default **"yield interval"** is after 10 objects processed.
-- The default **"time interval"** is after 0.001 seconds.
--
-- ## 1.1) Add or remove objects from the SET
--
-- Some key core functions are @{Set#SET_BASE.Add} and @{Set#SET_BASE.Remove} to add or remove objects from the SET in your logic.
--
-- ## 1.2) Define the SET iterator **"yield interval"** and the **"time interval"**
--
-- Modify the iterator intervals with the @{Set#SET_BASE.SetInteratorIntervals} method.
-- You can set the **"yield interval"**, and the **"time interval"**. (See above).
--
-- @type SET_BASE
-- @field #table Filter
-- @field #table Set
@ -442,7 +262,7 @@ end
-- @return #number Count
function SET_BASE:Count()
return #self.Index
return #self.Index or 0
end
@ -777,7 +597,55 @@ end
-- SET_GROUP
--- SET_GROUP class
--- # 2) SET_GROUP class, extends @{Set#SET_BASE}
--
-- Mission designers can use the @{Set#SET_GROUP} class to build sets of groups belonging to certain:
--
-- * Coalitions
-- * Categories
-- * Countries
-- * Starting with certain prefix strings.
--
-- ## 2.1) SET_GROUP constructor
--
-- Create a new SET_GROUP object with the @{#SET_GROUP.New} method:
--
-- * @{#SET_GROUP.New}: Creates a new SET_GROUP object.
--
-- ## 2.2) Add or Remove GROUP(s) from SET_GROUP
--
-- GROUPS can be added and removed using the @{Set#SET_GROUP.AddGroupsByName} and @{Set#SET_GROUP.RemoveGroupsByName} respectively.
-- These methods take a single GROUP name or an array of GROUP names to be added or removed from SET_GROUP.
--
-- ## 2.3) SET_GROUP filter criteria
--
-- You can set filter criteria to define the set of groups within the SET_GROUP.
-- Filter criteria are defined by:
--
-- * @{#SET_GROUP.FilterCoalitions}: Builds the SET_GROUP with the groups belonging to the coalition(s).
-- * @{#SET_GROUP.FilterCategories}: Builds the SET_GROUP with the groups belonging to the category(ies).
-- * @{#SET_GROUP.FilterCountries}: Builds the SET_GROUP with the gruops belonging to the country(ies).
-- * @{#SET_GROUP.FilterPrefixes}: Builds the SET_GROUP with the groups starting with the same prefix string(s).
--
-- Once the filter criteria have been set for the SET_GROUP, you can start filtering using:
--
-- * @{#SET_GROUP.FilterStart}: Starts the filtering of the groups within the SET_GROUP and add or remove GROUP objects **dynamically**.
--
-- Planned filter criteria within development are (so these are not yet available):
--
-- * @{#SET_GROUP.FilterZones}: Builds the SET_GROUP with the groups within a @{Zone#ZONE}.
--
-- ## 2.4) SET_GROUP iterators
--
-- Once the filters have been defined and the SET_GROUP has been built, you can iterate the SET_GROUP with the available iterator methods.
-- The iterator methods will walk the SET_GROUP set, and call for each element within the set a function that you provide.
-- The following iterator methods are currently available within the SET_GROUP:
--
-- * @{#SET_GROUP.ForEachGroup}: Calls a function for each alive group it finds within the SET_GROUP.
-- * @{#SET_GROUP.ForEachGroupCompletelyInZone}: Iterate the SET_GROUP and call an iterator function for each **alive** GROUP presence completely in a @{Zone}, providing the GROUP and optional parameters to the called function.
-- * @{#SET_GROUP.ForEachGroupPartlyInZone}: Iterate the SET_GROUP and call an iterator function for each **alive** GROUP presence partly in a @{Zone}, providing the GROUP and optional parameters to the called function.
-- * @{#SET_GROUP.ForEachGroupNotInZone}: Iterate the SET_GROUP and call an iterator function for each **alive** GROUP presence not in a @{Zone}, providing the GROUP and optional parameters to the called function.
--
-- @type SET_GROUP
-- @extends Core.Set#SET_BASE
SET_GROUP = {
@ -1145,7 +1013,69 @@ function SET_GROUP:IsIncludeObject( MooseGroup )
return MooseGroupInclude
end
--- SET_UNIT class
--- # 3) SET_UNIT class, extends @{Set#SET_BASE}
--
-- Mission designers can use the SET_UNIT class to build sets of units belonging to certain:
--
-- * Coalitions
-- * Categories
-- * Countries
-- * Unit types
-- * Starting with certain prefix strings.
--
-- ## 3.1) SET_UNIT constructor
--
-- Create a new SET_UNIT object with the @{#SET_UNIT.New} method:
--
-- * @{#SET_UNIT.New}: Creates a new SET_UNIT object.
--
-- ## 3.2) Add or Remove UNIT(s) from SET_UNIT
--
-- UNITs can be added and removed using the @{Set#SET_UNIT.AddUnitsByName} and @{Set#SET_UNIT.RemoveUnitsByName} respectively.
-- These methods take a single UNIT name or an array of UNIT names to be added or removed from SET_UNIT.
--
-- ## 3.3) SET_UNIT filter criteria
--
-- You can set filter criteria to define the set of units within the SET_UNIT.
-- Filter criteria are defined by:
--
-- * @{#SET_UNIT.FilterCoalitions}: Builds the SET_UNIT with the units belonging to the coalition(s).
-- * @{#SET_UNIT.FilterCategories}: Builds the SET_UNIT with the units belonging to the category(ies).
-- * @{#SET_UNIT.FilterTypes}: Builds the SET_UNIT with the units belonging to the unit type(s).
-- * @{#SET_UNIT.FilterCountries}: Builds the SET_UNIT with the units belonging to the country(ies).
-- * @{#SET_UNIT.FilterPrefixes}: Builds the SET_UNIT with the units starting with the same prefix string(s).
--
-- Once the filter criteria have been set for the SET_UNIT, you can start filtering using:
--
-- * @{#SET_UNIT.FilterStart}: Starts the filtering of the units within the SET_UNIT.
--
-- Planned filter criteria within development are (so these are not yet available):
--
-- * @{#SET_UNIT.FilterZones}: Builds the SET_UNIT with the units within a @{Zone#ZONE}.
--
-- ## 3.4) SET_UNIT iterators
--
-- Once the filters have been defined and the SET_UNIT has been built, you can iterate the SET_UNIT with the available iterator methods.
-- The iterator methods will walk the SET_UNIT set, and call for each element within the set a function that you provide.
-- The following iterator methods are currently available within the SET_UNIT:
--
-- * @{#SET_UNIT.ForEachUnit}: Calls a function for each alive unit it finds within the SET_UNIT.
-- * @{#SET_GROUP.ForEachGroupCompletelyInZone}: Iterate the SET_GROUP and call an iterator function for each **alive** GROUP presence completely in a @{Zone}, providing the GROUP and optional parameters to the called function.
-- * @{#SET_GROUP.ForEachGroupNotInZone}: Iterate the SET_GROUP and call an iterator function for each **alive** GROUP presence not in a @{Zone}, providing the GROUP and optional parameters to the called function.
--
-- Planned iterators methods in development are (so these are not yet available):
--
-- * @{#SET_UNIT.ForEachUnitInUnit}: Calls a function for each unit contained within the SET_UNIT.
-- * @{#SET_UNIT.ForEachUnitCompletelyInZone}: Iterate and call an iterator function for each **alive** UNIT presence completely in a @{Zone}, providing the UNIT and optional parameters to the called function.
-- * @{#SET_UNIT.ForEachUnitNotInZone}: Iterate and call an iterator function for each **alive** UNIT presence not in a @{Zone}, providing the UNIT and optional parameters to the called function.
--
-- ## 3.5 ) SET_UNIT atomic methods
--
-- Various methods exist for a SET_UNIT to perform actions or calculations and retrieve results from the SET_UNIT:
--
-- * @{#SET_UNIT.GetTypeNames}(): Retrieve the type names of the @{Unit}s in the SET, delimited by a comma.
--
--
-- @type SET_UNIT
-- @extends Core.Set#SET_BASE
SET_UNIT = {
@ -1759,9 +1689,81 @@ function SET_UNIT:IsIncludeObject( MUnit )
end
--- Retrieve the type names of the @{Unit}s in the SET, delimited by an optional delimiter.
-- @param #SET_UNIT self
-- @param #string Delimiter (optional) The delimiter, which is default a comma.
-- @return #string The types of the @{Unit}s delimited.
function SET_UNIT:GetTypeNames( Delimiter )
Delimiter = Delimiter or ", "
local TypeReport = REPORT:New()
local Types = {}
for UnitName, UnitData in pairs( self:GetSet() ) do
local Unit = UnitData -- Wrapper.Unit#UNIT
local UnitTypeName = Unit:GetTypeName()
if not Types[UnitTypeName] then
Types[UnitTypeName] = UnitTypeName
TypeReport:Add( UnitTypeName )
end
end
return TypeReport:Text( Delimiter )
end
--- SET_CLIENT
--- SET_CLIENT class
--- # 4) SET_CLIENT class, extends @{Set#SET_BASE}
--
-- Mission designers can use the @{Set#SET_CLIENT} class to build sets of units belonging to certain:
--
-- * Coalitions
-- * Categories
-- * Countries
-- * Client types
-- * Starting with certain prefix strings.
--
-- ## 4.1) SET_CLIENT constructor
--
-- Create a new SET_CLIENT object with the @{#SET_CLIENT.New} method:
--
-- * @{#SET_CLIENT.New}: Creates a new SET_CLIENT object.
--
-- ## 4.2) Add or Remove CLIENT(s) from SET_CLIENT
--
-- CLIENTs can be added and removed using the @{Set#SET_CLIENT.AddClientsByName} and @{Set#SET_CLIENT.RemoveClientsByName} respectively.
-- These methods take a single CLIENT name or an array of CLIENT names to be added or removed from SET_CLIENT.
--
-- ## 4.3) SET_CLIENT filter criteria
--
-- You can set filter criteria to define the set of clients within the SET_CLIENT.
-- Filter criteria are defined by:
--
-- * @{#SET_CLIENT.FilterCoalitions}: Builds the SET_CLIENT with the clients belonging to the coalition(s).
-- * @{#SET_CLIENT.FilterCategories}: Builds the SET_CLIENT with the clients belonging to the category(ies).
-- * @{#SET_CLIENT.FilterTypes}: Builds the SET_CLIENT with the clients belonging to the client type(s).
-- * @{#SET_CLIENT.FilterCountries}: Builds the SET_CLIENT with the clients belonging to the country(ies).
-- * @{#SET_CLIENT.FilterPrefixes}: Builds the SET_CLIENT with the clients starting with the same prefix string(s).
--
-- Once the filter criteria have been set for the SET_CLIENT, you can start filtering using:
--
-- * @{#SET_CLIENT.FilterStart}: Starts the filtering of the clients within the SET_CLIENT.
--
-- Planned filter criteria within development are (so these are not yet available):
--
-- * @{#SET_CLIENT.FilterZones}: Builds the SET_CLIENT with the clients within a @{Zone#ZONE}.
--
-- ## 4.4) SET_CLIENT iterators
--
-- Once the filters have been defined and the SET_CLIENT has been built, you can iterate the SET_CLIENT with the available iterator methods.
-- The iterator methods will walk the SET_CLIENT set, and call for each element within the set a function that you provide.
-- The following iterator methods are currently available within the SET_CLIENT:
--
-- * @{#SET_CLIENT.ForEachClient}: Calls a function for each alive client it finds within the SET_CLIENT.
--
-- @type SET_CLIENT
-- @extends Core.Set#SET_BASE
SET_CLIENT = {
@ -2118,7 +2120,42 @@ end
--- SET_AIRBASE
--- SET_AIRBASE class
--- # 5) SET_AIRBASE class, extends @{Set#SET_BASE}
--
-- Mission designers can use the @{Set#SET_AIRBASE} class to build sets of airbases optionally belonging to certain:
--
-- * Coalitions
--
-- ## 5.1) SET_AIRBASE constructor
--
-- Create a new SET_AIRBASE object with the @{#SET_AIRBASE.New} method:
--
-- * @{#SET_AIRBASE.New}: Creates a new SET_AIRBASE object.
--
-- ## 5.2) Add or Remove AIRBASEs from SET_AIRBASE
--
-- AIRBASEs can be added and removed using the @{Set#SET_AIRBASE.AddAirbasesByName} and @{Set#SET_AIRBASE.RemoveAirbasesByName} respectively.
-- These methods take a single AIRBASE name or an array of AIRBASE names to be added or removed from SET_AIRBASE.
--
-- ## 5.3) SET_AIRBASE filter criteria
--
-- You can set filter criteria to define the set of clients within the SET_AIRBASE.
-- Filter criteria are defined by:
--
-- * @{#SET_AIRBASE.FilterCoalitions}: Builds the SET_AIRBASE with the airbases belonging to the coalition(s).
--
-- Once the filter criteria have been set for the SET_AIRBASE, you can start filtering using:
--
-- * @{#SET_AIRBASE.FilterStart}: Starts the filtering of the airbases within the SET_AIRBASE.
--
-- ## 5.4) SET_AIRBASE iterators
--
-- Once the filters have been defined and the SET_AIRBASE has been built, you can iterate the SET_AIRBASE with the available iterator methods.
-- The iterator methods will walk the SET_AIRBASE set, and call for each airbase within the set a function that you provide.
-- The following iterator methods are currently available within the SET_AIRBASE:
--
-- * @{#SET_AIRBASE.ForEachAirbase}: Calls a function for each airbase it finds within the SET_AIRBASE.
--
-- @type SET_AIRBASE
-- @extends Core.Set#SET_BASE
SET_AIRBASE = {

View File

@ -1073,7 +1073,7 @@ do -- DETECTION_BASE
--- Get a detected item using a given numeric index.
-- @param #DETECTION_BASE self
-- @param #number Index
-- @return DETECTION_BASE.DetectedItem
-- @return #DETECTION_BASE.DetectedItem
function DETECTION_BASE:GetDetectedItem( Index )
local DetectedItem = self.DetectedItems[Index]
@ -1336,7 +1336,7 @@ do -- DETECTION_UNITS
local DetectedItemUnit = DetectedSet:GetFirst() -- Wrapper.Unit#UNIT
if DetectedItemUnit then
if DetectedItemUnit and DetectedItemUnit:IsAlive() then
self:T(DetectedItemUnit)
local UnitCategoryName = DetectedItemUnit:GetCategoryName() or ""
@ -1354,8 +1354,16 @@ do -- DETECTION_UNITS
UnitDistanceText = string.format( "%.2f", DetectedItem.Distance ) .. " km, visual contact"
end
local DetectedItemPointVec3 = DetectedItemUnit:GetPointVec3()
local DetectedItemPointLL = DetectedItemPointVec3:ToStringLL( 3, true )
local ThreatLevelA2G = DetectedItemUnit:GetThreatLevel( DetectedItem )
ReportSummary = string.format(
"%s%s",
"%s - Threat [%s] (%2d) - %s%s",
DetectedItemPointLL,
string.rep( "", ThreatLevelA2G ),
ThreatLevelA2G,
UnitCategoryText,
UnitDistanceText
)
@ -1470,10 +1478,10 @@ do -- DETECTION_TYPES
for DetectedItemID, DetectedItem in pairs( self.DetectedItems ) do
local DetectedItemSet = DetectedItem:GetSet() -- Core.Set#SET_UNIT
local DetectedItemSet = DetectedItem.Set -- Core.Set#SET_UNIT
local DetectedTypeName = DetectedItem.Type
for DetectedUnitName, DetectedUnitData in pairs( DetectedItemSet ) do
for DetectedUnitName, DetectedUnitData in pairs( DetectedItemSet:GetSet() ) do
local DetectedUnit = DetectedUnitData -- Wrapper.Unit#UNIT
local DetectedObject = nil
@ -1542,12 +1550,15 @@ do -- DETECTION_TYPES
if DetectedItem then
local ThreatLevelA2G = DetectedSet:CalculateThreatLevelA2G()
local DetectedItemsCount = DetectedSet:Count()
local DetectedItemType = DetectedItem.Type
local ReportSummary = string.format(
"Type #%s - Threat Level [%s] (%2d)",
DetectedItem.Type,
"Threat [%s] (%2d) - %2d of %s",
string.rep( "", ThreatLevelA2G ),
ThreatLevelA2G
ThreatLevelA2G,
DetectedItemsCount,
DetectedItemType
)
self:T( ReportSummary )
@ -1651,17 +1662,23 @@ do -- DETECTION_AREAS
local DetectedItem = self:GetDetectedItem( Index )
if DetectedItem then
local DetectedSet = self:GetDetectedSet( Index )
local ThreatLevelA2G = self:GetTreatLevelA2G( DetectedItem )
local ReportSummaryItem
local DetectedZone = self:GetDetectedZone( Index )
local DetectedItemPointVec3 = DetectedZone:GetPointVec3()
local DetectedItemPointLL = DetectedItemPointVec3:ToStringLL( 3, true )
local ThreatLevelA2G = self:GetTreatLevelA2G( DetectedItem )
local DetectedItemsCount = DetectedSet:Count()
local DetectedItemsTypes = DetectedSet:GetTypeNames()
local ReportSummary = string.format(
"%s - Threat Level [%s] (%2d)",
"%s - Threat [%s] (%2d) - %2d of %s",
DetectedItemPointLL,
string.rep( "", ThreatLevelA2G ),
ThreatLevelA2G
ThreatLevelA2G,
DetectedItemsCount,
DetectedItemsTypes
)
return ReportSummary

View File

@ -36,8 +36,14 @@ function REPORT:Add( Text )
return self.Report[#self.Report]
end
function REPORT:Text()
return table.concat( self.Report, "\n" )
--- Produces the text of the report, taking into account an optional delimeter, which is \n by default.
-- @param #REPORT self
-- @param #string Delimiter (optional) A delimiter text.
-- @return #string The report text.
function REPORT:Text( Delimiter )
Delimiter = Delimiter or "\n"
local ReportText = table.concat( self.Report, Delimiter ) or ""
return ReportText
end
--- The COMMANDCENTER class

View File

@ -983,11 +983,12 @@ end
-- @param #string To
function TASK:onenterAssigned( From, Event, To, PlayerUnit, PlayerName )
self:E("Task Assigned")
self:E( { "Task Assigned", self.Dispatcher } )
self:MessageToGroups( "Task " .. self:GetName() .. " has been assigned to your group." )
if self.Dispatcher then
self:E( "Firing Assign event " )
self.Dispatcher:Assign( self, PlayerUnit, PlayerName )
end

View File

@ -308,6 +308,7 @@ do -- TASK_A2G
-- @param Wrapper.Unit#UNIT TaskUnit
-- @return #TASK_A2G
function TASK_A2G:SetScoreOnDestroy( Text, Score, TaskUnit )
self:F( { Text, Score, TaskUnit } )
local ProcessUnit = self:GetUnitProcess( TaskUnit )
@ -323,6 +324,7 @@ do -- TASK_A2G
-- @param Wrapper.Unit#UNIT TaskUnit
-- @return #TASK_A2G
function TASK_A2G:SetScoreOnSuccess( Text, Score, TaskUnit )
self:F( { Text, Score, TaskUnit } )
local ProcessUnit = self:GetUnitProcess( TaskUnit )
@ -338,6 +340,7 @@ do -- TASK_A2G
-- @param Wrapper.Unit#UNIT TaskUnit
-- @return #TASK_A2G
function TASK_A2G:SetPenaltyOnFailed( Text, Penalty, TaskUnit )
self:F( { Text, Score, TaskUnit } )
local ProcessUnit = self:GetUnitProcess( TaskUnit )

View File

@ -289,7 +289,7 @@ do -- TASK_A2G_DISPATCHER
Mission:GetCommandCenter():MessageToGroup(
string.format( "HQ Reporting - Planned tasks for mission '%s':\n%s\n",
self.Mission:GetName(),
string.format( "%s\n%s\n%s\n%s", ReportSEAD:Text(), ReportCAS:Text(), ReportBAI:Text(), ReportChanges:Text()
string.format( "%s\n\n%s\n\n%s\n\n%s", ReportSEAD:Text(), ReportCAS:Text(), ReportBAI:Text(), ReportChanges:Text()
)
), TaskGroup
)

View File

@ -1,5 +1,5 @@
env.info( '*** MOOSE STATIC INCLUDE START *** ' )
env.info( 'Moose Generation Timestamp: 20170319_1459' )
env.info( 'Moose Generation Timestamp: 20170320_1252' )
local base = _G
Include = {}
@ -7971,225 +7971,30 @@ end
--- **Core** - SET classes define **collections** of objects to perform **bulk actions** and logically **group** objects.
--- **Core** - SET_ classes define **collections** of objects to perform **bulk actions** and logically **group** objects.
--
-- ![Banner Image](..\Presentations\SET\Dia1.JPG)
--
-- ===
--
-- 1) @{Set#SET_BASE} class, extends @{Base#BASE}
-- ==============================================
-- The @{Set#SET_BASE} class defines the core functions that define a collection of objects.
-- A SET provides iterators to iterate the SET, but will **temporarily** yield the ForEach interator loop at defined **"intervals"** to the mail simulator loop.
-- In this way, large loops can be done while not blocking the simulator main processing loop.
-- The default **"yield interval"** is after 10 objects processed.
-- The default **"time interval"** is after 0.001 seconds.
-- SET_ classes group objects of the same type into a collection, which is either:
--
-- 1.1) Add or remove objects from the SET
-- ---------------------------------------
-- Some key core functions are @{Set#SET_BASE.Add} and @{Set#SET_BASE.Remove} to add or remove objects from the SET in your logic.
-- * Manually managed using the **:Add...()** or **:Remove...()** methods. The initial SET can be filtered with the **@{#SET_BASE.FilterOnce}()** method
-- * Dynamically updated when new objects are created or objects are destroyed using the **@{#SET_BASE.FilterStart}()** method.
--
-- 1.2) Define the SET iterator **"yield interval"** and the **"time interval"**
-- -----------------------------------------------------------------------------
-- Modify the iterator intervals with the @{Set#SET_BASE.SetInteratorIntervals} method.
-- You can set the **"yield interval"**, and the **"time interval"**. (See above).
-- Various types of SET_ classes are available:
--
-- ===
-- * @{#SET_UNIT}: Defines a colleciton of @{Unit}s filtered by filter criteria.
-- * @{#SET_GROUP}: Defines a collection of @{Group}s filtered by filter criteria.
-- * @{#SET_CLIENT}: Defines a collection of @{Client}s filterd by filter criteria.
-- * @{#SET_AIRBASE}: Defines a collection of @{Airbase}s filtered by filter criteria.
--
-- 2) @{Set#SET_GROUP} class, extends @{Set#SET_BASE}
-- ==================================================
-- Mission designers can use the @{Set#SET_GROUP} class to build sets of groups belonging to certain:
-- These classes are derived from @{#SET_BASE}, which contains the main methods to manage SETs.
--
-- * Coalitions
-- * Categories
-- * Countries
-- * Starting with certain prefix strings.
-- A multitude of other methods are available in SET_ classes that allow to:
--
-- 2.1) SET_GROUP construction method:
-- -----------------------------------
-- Create a new SET_GROUP object with the @{#SET_GROUP.New} method:
--
-- * @{#SET_GROUP.New}: Creates a new SET_GROUP object.
--
-- 2.2) Add or Remove GROUP(s) from SET_GROUP:
-- -------------------------------------------
-- GROUPS can be added and removed using the @{Set#SET_GROUP.AddGroupsByName} and @{Set#SET_GROUP.RemoveGroupsByName} respectively.
-- These methods take a single GROUP name or an array of GROUP names to be added or removed from SET_GROUP.
--
-- 2.3) SET_GROUP filter criteria:
-- -------------------------------
-- You can set filter criteria to define the set of groups within the SET_GROUP.
-- Filter criteria are defined by:
--
-- * @{#SET_GROUP.FilterCoalitions}: Builds the SET_GROUP with the groups belonging to the coalition(s).
-- * @{#SET_GROUP.FilterCategories}: Builds the SET_GROUP with the groups belonging to the category(ies).
-- * @{#SET_GROUP.FilterCountries}: Builds the SET_GROUP with the gruops belonging to the country(ies).
-- * @{#SET_GROUP.FilterPrefixes}: Builds the SET_GROUP with the groups starting with the same prefix string(s).
--
-- Once the filter criteria have been set for the SET_GROUP, you can start filtering using:
--
-- * @{#SET_GROUP.FilterStart}: Starts the filtering of the groups within the SET_GROUP and add or remove GROUP objects **dynamically**.
--
-- Planned filter criteria within development are (so these are not yet available):
--
-- * @{#SET_GROUP.FilterZones}: Builds the SET_GROUP with the groups within a @{Zone#ZONE}.
--
-- 2.4) SET_GROUP iterators:
-- -------------------------
-- Once the filters have been defined and the SET_GROUP has been built, you can iterate the SET_GROUP with the available iterator methods.
-- The iterator methods will walk the SET_GROUP set, and call for each element within the set a function that you provide.
-- The following iterator methods are currently available within the SET_GROUP:
--
-- * @{#SET_GROUP.ForEachGroup}: Calls a function for each alive group it finds within the SET_GROUP.
-- * @{#SET_GROUP.ForEachGroupCompletelyInZone}: Iterate the SET_GROUP and call an iterator function for each **alive** GROUP presence completely in a @{Zone}, providing the GROUP and optional parameters to the called function.
-- * @{#SET_GROUP.ForEachGroupPartlyInZone}: Iterate the SET_GROUP and call an iterator function for each **alive** GROUP presence partly in a @{Zone}, providing the GROUP and optional parameters to the called function.
-- * @{#SET_GROUP.ForEachGroupNotInZone}: Iterate the SET_GROUP and call an iterator function for each **alive** GROUP presence not in a @{Zone}, providing the GROUP and optional parameters to the called function.
--
-- ====
--
-- 3) @{Set#SET_UNIT} class, extends @{Set#SET_BASE}
-- ===================================================
-- Mission designers can use the @{Set#SET_UNIT} class to build sets of units belonging to certain:
--
-- * Coalitions
-- * Categories
-- * Countries
-- * Unit types
-- * Starting with certain prefix strings.
--
-- 3.1) SET_UNIT construction method:
-- ----------------------------------
-- Create a new SET_UNIT object with the @{#SET_UNIT.New} method:
--
-- * @{#SET_UNIT.New}: Creates a new SET_UNIT object.
--
-- 3.2) Add or Remove UNIT(s) from SET_UNIT:
-- -----------------------------------------
-- UNITs can be added and removed using the @{Set#SET_UNIT.AddUnitsByName} and @{Set#SET_UNIT.RemoveUnitsByName} respectively.
-- These methods take a single UNIT name or an array of UNIT names to be added or removed from SET_UNIT.
--
-- 3.3) SET_UNIT filter criteria:
-- ------------------------------
-- You can set filter criteria to define the set of units within the SET_UNIT.
-- Filter criteria are defined by:
--
-- * @{#SET_UNIT.FilterCoalitions}: Builds the SET_UNIT with the units belonging to the coalition(s).
-- * @{#SET_UNIT.FilterCategories}: Builds the SET_UNIT with the units belonging to the category(ies).
-- * @{#SET_UNIT.FilterTypes}: Builds the SET_UNIT with the units belonging to the unit type(s).
-- * @{#SET_UNIT.FilterCountries}: Builds the SET_UNIT with the units belonging to the country(ies).
-- * @{#SET_UNIT.FilterPrefixes}: Builds the SET_UNIT with the units starting with the same prefix string(s).
--
-- Once the filter criteria have been set for the SET_UNIT, you can start filtering using:
--
-- * @{#SET_UNIT.FilterStart}: Starts the filtering of the units within the SET_UNIT.
--
-- Planned filter criteria within development are (so these are not yet available):
--
-- * @{#SET_UNIT.FilterZones}: Builds the SET_UNIT with the units within a @{Zone#ZONE}.
--
-- 3.4) SET_UNIT iterators:
-- ------------------------
-- Once the filters have been defined and the SET_UNIT has been built, you can iterate the SET_UNIT with the available iterator methods.
-- The iterator methods will walk the SET_UNIT set, and call for each element within the set a function that you provide.
-- The following iterator methods are currently available within the SET_UNIT:
--
-- * @{#SET_UNIT.ForEachUnit}: Calls a function for each alive unit it finds within the SET_UNIT.
-- * @{#SET_GROUP.ForEachGroupCompletelyInZone}: Iterate the SET_GROUP and call an iterator function for each **alive** GROUP presence completely in a @{Zone}, providing the GROUP and optional parameters to the called function.
-- * @{#SET_GROUP.ForEachGroupNotInZone}: Iterate the SET_GROUP and call an iterator function for each **alive** GROUP presence not in a @{Zone}, providing the GROUP and optional parameters to the called function.
--
-- Planned iterators methods in development are (so these are not yet available):
--
-- * @{#SET_UNIT.ForEachUnitInUnit}: Calls a function for each unit contained within the SET_UNIT.
-- * @{#SET_UNIT.ForEachUnitCompletelyInZone}: Iterate and call an iterator function for each **alive** UNIT presence completely in a @{Zone}, providing the UNIT and optional parameters to the called function.
-- * @{#SET_UNIT.ForEachUnitNotInZone}: Iterate and call an iterator function for each **alive** UNIT presence not in a @{Zone}, providing the UNIT and optional parameters to the called function.
--
-- ===
--
-- 4) @{Set#SET_CLIENT} class, extends @{Set#SET_BASE}
-- ===================================================
-- Mission designers can use the @{Set#SET_CLIENT} class to build sets of units belonging to certain:
--
-- * Coalitions
-- * Categories
-- * Countries
-- * Client types
-- * Starting with certain prefix strings.
--
-- 4.1) SET_CLIENT construction method:
-- ----------------------------------
-- Create a new SET_CLIENT object with the @{#SET_CLIENT.New} method:
--
-- * @{#SET_CLIENT.New}: Creates a new SET_CLIENT object.
--
-- 4.2) Add or Remove CLIENT(s) from SET_CLIENT:
-- -----------------------------------------
-- CLIENTs can be added and removed using the @{Set#SET_CLIENT.AddClientsByName} and @{Set#SET_CLIENT.RemoveClientsByName} respectively.
-- These methods take a single CLIENT name or an array of CLIENT names to be added or removed from SET_CLIENT.
--
-- 4.3) SET_CLIENT filter criteria:
-- ------------------------------
-- You can set filter criteria to define the set of clients within the SET_CLIENT.
-- Filter criteria are defined by:
--
-- * @{#SET_CLIENT.FilterCoalitions}: Builds the SET_CLIENT with the clients belonging to the coalition(s).
-- * @{#SET_CLIENT.FilterCategories}: Builds the SET_CLIENT with the clients belonging to the category(ies).
-- * @{#SET_CLIENT.FilterTypes}: Builds the SET_CLIENT with the clients belonging to the client type(s).
-- * @{#SET_CLIENT.FilterCountries}: Builds the SET_CLIENT with the clients belonging to the country(ies).
-- * @{#SET_CLIENT.FilterPrefixes}: Builds the SET_CLIENT with the clients starting with the same prefix string(s).
--
-- Once the filter criteria have been set for the SET_CLIENT, you can start filtering using:
--
-- * @{#SET_CLIENT.FilterStart}: Starts the filtering of the clients within the SET_CLIENT.
--
-- Planned filter criteria within development are (so these are not yet available):
--
-- * @{#SET_CLIENT.FilterZones}: Builds the SET_CLIENT with the clients within a @{Zone#ZONE}.
--
-- 4.4) SET_CLIENT iterators:
-- ------------------------
-- Once the filters have been defined and the SET_CLIENT has been built, you can iterate the SET_CLIENT with the available iterator methods.
-- The iterator methods will walk the SET_CLIENT set, and call for each element within the set a function that you provide.
-- The following iterator methods are currently available within the SET_CLIENT:
--
-- * @{#SET_CLIENT.ForEachClient}: Calls a function for each alive client it finds within the SET_CLIENT.
--
-- ====
--
-- 5) @{Set#SET_AIRBASE} class, extends @{Set#SET_BASE}
-- ====================================================
-- Mission designers can use the @{Set#SET_AIRBASE} class to build sets of airbases optionally belonging to certain:
--
-- * Coalitions
--
-- 5.1) SET_AIRBASE construction
-- -----------------------------
-- Create a new SET_AIRBASE object with the @{#SET_AIRBASE.New} method:
--
-- * @{#SET_AIRBASE.New}: Creates a new SET_AIRBASE object.
--
-- 5.2) Add or Remove AIRBASEs from SET_AIRBASE
-- --------------------------------------------
-- AIRBASEs can be added and removed using the @{Set#SET_AIRBASE.AddAirbasesByName} and @{Set#SET_AIRBASE.RemoveAirbasesByName} respectively.
-- These methods take a single AIRBASE name or an array of AIRBASE names to be added or removed from SET_AIRBASE.
--
-- 5.3) SET_AIRBASE filter criteria
-- --------------------------------
-- You can set filter criteria to define the set of clients within the SET_AIRBASE.
-- Filter criteria are defined by:
--
-- * @{#SET_AIRBASE.FilterCoalitions}: Builds the SET_AIRBASE with the airbases belonging to the coalition(s).
--
-- Once the filter criteria have been set for the SET_AIRBASE, you can start filtering using:
--
-- * @{#SET_AIRBASE.FilterStart}: Starts the filtering of the airbases within the SET_AIRBASE.
--
-- 5.4) SET_AIRBASE iterators:
-- ---------------------------
-- Once the filters have been defined and the SET_AIRBASE has been built, you can iterate the SET_AIRBASE with the available iterator methods.
-- The iterator methods will walk the SET_AIRBASE set, and call for each airbase within the set a function that you provide.
-- The following iterator methods are currently available within the SET_AIRBASE:
--
-- * @{#SET_AIRBASE.ForEachAirbase}: Calls a function for each airbase it finds within the SET_AIRBASE.
--
-- ====
-- * Validate the presence of objects in the SET.
-- * Trigger events when objects in the SET change a zone presence.
--
-- ### Authors:
--
@ -8201,7 +8006,22 @@ end
-- @module Set
--- SET_BASE class
--- # 1) SET_BASE class, extends @{Base#BASE}
-- The @{Set#SET_BASE} class defines the core functions that define a collection of objects.
-- A SET provides iterators to iterate the SET, but will **temporarily** yield the ForEach interator loop at defined **"intervals"** to the mail simulator loop.
-- In this way, large loops can be done while not blocking the simulator main processing loop.
-- The default **"yield interval"** is after 10 objects processed.
-- The default **"time interval"** is after 0.001 seconds.
--
-- ## 1.1) Add or remove objects from the SET
--
-- Some key core functions are @{Set#SET_BASE.Add} and @{Set#SET_BASE.Remove} to add or remove objects from the SET in your logic.
--
-- ## 1.2) Define the SET iterator **"yield interval"** and the **"time interval"**
--
-- Modify the iterator intervals with the @{Set#SET_BASE.SetInteratorIntervals} method.
-- You can set the **"yield interval"**, and the **"time interval"**. (See above).
--
-- @type SET_BASE
-- @field #table Filter
-- @field #table Set
@ -8415,7 +8235,7 @@ end
-- @return #number Count
function SET_BASE:Count()
return #self.Index
return #self.Index or 0
end
@ -8750,7 +8570,55 @@ end
-- SET_GROUP
--- SET_GROUP class
--- # 2) SET_GROUP class, extends @{Set#SET_BASE}
--
-- Mission designers can use the @{Set#SET_GROUP} class to build sets of groups belonging to certain:
--
-- * Coalitions
-- * Categories
-- * Countries
-- * Starting with certain prefix strings.
--
-- ## 2.1) SET_GROUP constructor
--
-- Create a new SET_GROUP object with the @{#SET_GROUP.New} method:
--
-- * @{#SET_GROUP.New}: Creates a new SET_GROUP object.
--
-- ## 2.2) Add or Remove GROUP(s) from SET_GROUP
--
-- GROUPS can be added and removed using the @{Set#SET_GROUP.AddGroupsByName} and @{Set#SET_GROUP.RemoveGroupsByName} respectively.
-- These methods take a single GROUP name or an array of GROUP names to be added or removed from SET_GROUP.
--
-- ## 2.3) SET_GROUP filter criteria
--
-- You can set filter criteria to define the set of groups within the SET_GROUP.
-- Filter criteria are defined by:
--
-- * @{#SET_GROUP.FilterCoalitions}: Builds the SET_GROUP with the groups belonging to the coalition(s).
-- * @{#SET_GROUP.FilterCategories}: Builds the SET_GROUP with the groups belonging to the category(ies).
-- * @{#SET_GROUP.FilterCountries}: Builds the SET_GROUP with the gruops belonging to the country(ies).
-- * @{#SET_GROUP.FilterPrefixes}: Builds the SET_GROUP with the groups starting with the same prefix string(s).
--
-- Once the filter criteria have been set for the SET_GROUP, you can start filtering using:
--
-- * @{#SET_GROUP.FilterStart}: Starts the filtering of the groups within the SET_GROUP and add or remove GROUP objects **dynamically**.
--
-- Planned filter criteria within development are (so these are not yet available):
--
-- * @{#SET_GROUP.FilterZones}: Builds the SET_GROUP with the groups within a @{Zone#ZONE}.
--
-- ## 2.4) SET_GROUP iterators
--
-- Once the filters have been defined and the SET_GROUP has been built, you can iterate the SET_GROUP with the available iterator methods.
-- The iterator methods will walk the SET_GROUP set, and call for each element within the set a function that you provide.
-- The following iterator methods are currently available within the SET_GROUP:
--
-- * @{#SET_GROUP.ForEachGroup}: Calls a function for each alive group it finds within the SET_GROUP.
-- * @{#SET_GROUP.ForEachGroupCompletelyInZone}: Iterate the SET_GROUP and call an iterator function for each **alive** GROUP presence completely in a @{Zone}, providing the GROUP and optional parameters to the called function.
-- * @{#SET_GROUP.ForEachGroupPartlyInZone}: Iterate the SET_GROUP and call an iterator function for each **alive** GROUP presence partly in a @{Zone}, providing the GROUP and optional parameters to the called function.
-- * @{#SET_GROUP.ForEachGroupNotInZone}: Iterate the SET_GROUP and call an iterator function for each **alive** GROUP presence not in a @{Zone}, providing the GROUP and optional parameters to the called function.
--
-- @type SET_GROUP
-- @extends Core.Set#SET_BASE
SET_GROUP = {
@ -9118,7 +8986,69 @@ function SET_GROUP:IsIncludeObject( MooseGroup )
return MooseGroupInclude
end
--- SET_UNIT class
--- # 3) SET_UNIT class, extends @{Set#SET_BASE}
--
-- Mission designers can use the SET_UNIT class to build sets of units belonging to certain:
--
-- * Coalitions
-- * Categories
-- * Countries
-- * Unit types
-- * Starting with certain prefix strings.
--
-- ## 3.1) SET_UNIT constructor
--
-- Create a new SET_UNIT object with the @{#SET_UNIT.New} method:
--
-- * @{#SET_UNIT.New}: Creates a new SET_UNIT object.
--
-- ## 3.2) Add or Remove UNIT(s) from SET_UNIT
--
-- UNITs can be added and removed using the @{Set#SET_UNIT.AddUnitsByName} and @{Set#SET_UNIT.RemoveUnitsByName} respectively.
-- These methods take a single UNIT name or an array of UNIT names to be added or removed from SET_UNIT.
--
-- ## 3.3) SET_UNIT filter criteria
--
-- You can set filter criteria to define the set of units within the SET_UNIT.
-- Filter criteria are defined by:
--
-- * @{#SET_UNIT.FilterCoalitions}: Builds the SET_UNIT with the units belonging to the coalition(s).
-- * @{#SET_UNIT.FilterCategories}: Builds the SET_UNIT with the units belonging to the category(ies).
-- * @{#SET_UNIT.FilterTypes}: Builds the SET_UNIT with the units belonging to the unit type(s).
-- * @{#SET_UNIT.FilterCountries}: Builds the SET_UNIT with the units belonging to the country(ies).
-- * @{#SET_UNIT.FilterPrefixes}: Builds the SET_UNIT with the units starting with the same prefix string(s).
--
-- Once the filter criteria have been set for the SET_UNIT, you can start filtering using:
--
-- * @{#SET_UNIT.FilterStart}: Starts the filtering of the units within the SET_UNIT.
--
-- Planned filter criteria within development are (so these are not yet available):
--
-- * @{#SET_UNIT.FilterZones}: Builds the SET_UNIT with the units within a @{Zone#ZONE}.
--
-- ## 3.4) SET_UNIT iterators
--
-- Once the filters have been defined and the SET_UNIT has been built, you can iterate the SET_UNIT with the available iterator methods.
-- The iterator methods will walk the SET_UNIT set, and call for each element within the set a function that you provide.
-- The following iterator methods are currently available within the SET_UNIT:
--
-- * @{#SET_UNIT.ForEachUnit}: Calls a function for each alive unit it finds within the SET_UNIT.
-- * @{#SET_GROUP.ForEachGroupCompletelyInZone}: Iterate the SET_GROUP and call an iterator function for each **alive** GROUP presence completely in a @{Zone}, providing the GROUP and optional parameters to the called function.
-- * @{#SET_GROUP.ForEachGroupNotInZone}: Iterate the SET_GROUP and call an iterator function for each **alive** GROUP presence not in a @{Zone}, providing the GROUP and optional parameters to the called function.
--
-- Planned iterators methods in development are (so these are not yet available):
--
-- * @{#SET_UNIT.ForEachUnitInUnit}: Calls a function for each unit contained within the SET_UNIT.
-- * @{#SET_UNIT.ForEachUnitCompletelyInZone}: Iterate and call an iterator function for each **alive** UNIT presence completely in a @{Zone}, providing the UNIT and optional parameters to the called function.
-- * @{#SET_UNIT.ForEachUnitNotInZone}: Iterate and call an iterator function for each **alive** UNIT presence not in a @{Zone}, providing the UNIT and optional parameters to the called function.
--
-- ## 3.5 ) SET_UNIT atomic methods
--
-- Various methods exist for a SET_UNIT to perform actions or calculations and retrieve results from the SET_UNIT:
--
-- * @{#SET_UNIT.GetTypeNames}(): Retrieve the type names of the @{Unit}s in the SET, delimited by a comma.
--
--
-- @type SET_UNIT
-- @extends Core.Set#SET_BASE
SET_UNIT = {
@ -9732,9 +9662,81 @@ function SET_UNIT:IsIncludeObject( MUnit )
end
--- Retrieve the type names of the @{Unit}s in the SET, delimited by an optional delimiter.
-- @param #SET_UNIT self
-- @param #string Delimiter (optional) The delimiter, which is default a comma.
-- @return #string The types of the @{Unit}s delimited.
function SET_UNIT:GetTypeNames( Delimiter )
Delimiter = Delimiter or ", "
local TypeReport = REPORT:New()
local Types = {}
for UnitName, UnitData in pairs( self:GetSet() ) do
local Unit = UnitData -- Wrapper.Unit#UNIT
local UnitTypeName = Unit:GetTypeName()
if not Types[UnitTypeName] then
Types[UnitTypeName] = UnitTypeName
TypeReport:Add( UnitTypeName )
end
end
return TypeReport:Text( Delimiter )
end
--- SET_CLIENT
--- SET_CLIENT class
--- # 4) SET_CLIENT class, extends @{Set#SET_BASE}
--
-- Mission designers can use the @{Set#SET_CLIENT} class to build sets of units belonging to certain:
--
-- * Coalitions
-- * Categories
-- * Countries
-- * Client types
-- * Starting with certain prefix strings.
--
-- ## 4.1) SET_CLIENT constructor
--
-- Create a new SET_CLIENT object with the @{#SET_CLIENT.New} method:
--
-- * @{#SET_CLIENT.New}: Creates a new SET_CLIENT object.
--
-- ## 4.2) Add or Remove CLIENT(s) from SET_CLIENT
--
-- CLIENTs can be added and removed using the @{Set#SET_CLIENT.AddClientsByName} and @{Set#SET_CLIENT.RemoveClientsByName} respectively.
-- These methods take a single CLIENT name or an array of CLIENT names to be added or removed from SET_CLIENT.
--
-- ## 4.3) SET_CLIENT filter criteria
--
-- You can set filter criteria to define the set of clients within the SET_CLIENT.
-- Filter criteria are defined by:
--
-- * @{#SET_CLIENT.FilterCoalitions}: Builds the SET_CLIENT with the clients belonging to the coalition(s).
-- * @{#SET_CLIENT.FilterCategories}: Builds the SET_CLIENT with the clients belonging to the category(ies).
-- * @{#SET_CLIENT.FilterTypes}: Builds the SET_CLIENT with the clients belonging to the client type(s).
-- * @{#SET_CLIENT.FilterCountries}: Builds the SET_CLIENT with the clients belonging to the country(ies).
-- * @{#SET_CLIENT.FilterPrefixes}: Builds the SET_CLIENT with the clients starting with the same prefix string(s).
--
-- Once the filter criteria have been set for the SET_CLIENT, you can start filtering using:
--
-- * @{#SET_CLIENT.FilterStart}: Starts the filtering of the clients within the SET_CLIENT.
--
-- Planned filter criteria within development are (so these are not yet available):
--
-- * @{#SET_CLIENT.FilterZones}: Builds the SET_CLIENT with the clients within a @{Zone#ZONE}.
--
-- ## 4.4) SET_CLIENT iterators
--
-- Once the filters have been defined and the SET_CLIENT has been built, you can iterate the SET_CLIENT with the available iterator methods.
-- The iterator methods will walk the SET_CLIENT set, and call for each element within the set a function that you provide.
-- The following iterator methods are currently available within the SET_CLIENT:
--
-- * @{#SET_CLIENT.ForEachClient}: Calls a function for each alive client it finds within the SET_CLIENT.
--
-- @type SET_CLIENT
-- @extends Core.Set#SET_BASE
SET_CLIENT = {
@ -10091,7 +10093,42 @@ end
--- SET_AIRBASE
--- SET_AIRBASE class
--- # 5) SET_AIRBASE class, extends @{Set#SET_BASE}
--
-- Mission designers can use the @{Set#SET_AIRBASE} class to build sets of airbases optionally belonging to certain:
--
-- * Coalitions
--
-- ## 5.1) SET_AIRBASE constructor
--
-- Create a new SET_AIRBASE object with the @{#SET_AIRBASE.New} method:
--
-- * @{#SET_AIRBASE.New}: Creates a new SET_AIRBASE object.
--
-- ## 5.2) Add or Remove AIRBASEs from SET_AIRBASE
--
-- AIRBASEs can be added and removed using the @{Set#SET_AIRBASE.AddAirbasesByName} and @{Set#SET_AIRBASE.RemoveAirbasesByName} respectively.
-- These methods take a single AIRBASE name or an array of AIRBASE names to be added or removed from SET_AIRBASE.
--
-- ## 5.3) SET_AIRBASE filter criteria
--
-- You can set filter criteria to define the set of clients within the SET_AIRBASE.
-- Filter criteria are defined by:
--
-- * @{#SET_AIRBASE.FilterCoalitions}: Builds the SET_AIRBASE with the airbases belonging to the coalition(s).
--
-- Once the filter criteria have been set for the SET_AIRBASE, you can start filtering using:
--
-- * @{#SET_AIRBASE.FilterStart}: Starts the filtering of the airbases within the SET_AIRBASE.
--
-- ## 5.4) SET_AIRBASE iterators
--
-- Once the filters have been defined and the SET_AIRBASE has been built, you can iterate the SET_AIRBASE with the available iterator methods.
-- The iterator methods will walk the SET_AIRBASE set, and call for each airbase within the set a function that you provide.
-- The following iterator methods are currently available within the SET_AIRBASE:
--
-- * @{#SET_AIRBASE.ForEachAirbase}: Calls a function for each airbase it finds within the SET_AIRBASE.
--
-- @type SET_AIRBASE
-- @extends Core.Set#SET_BASE
SET_AIRBASE = {
@ -11901,7 +11938,6 @@ do -- FSM
for ProcessID, Process in pairs( self:GetProcesses() ) do
if Process.From == From and Process.Event == Event then
self:T( Process )
return Process.fsm
end
end
@ -11930,7 +11966,7 @@ do -- FSM
-- @param #number Score is a number providing the score of the status.
-- @return #FSM self
function FSM:AddScore( State, ScoreText, Score )
self:F2( { State, ScoreText, Score } )
self:F( { State, ScoreText, Score } )
self._Scores[State] = self._Scores[State] or {}
self._Scores[State].ScoreText = ScoreText
@ -11948,15 +11984,16 @@ do -- FSM
-- @param #number Score is a number providing the score of the status.
-- @return #FSM self
function FSM:AddScoreProcess( From, Event, State, ScoreText, Score )
self:F2( { Event, State, ScoreText, Score } )
self:F( { From, Event, State, ScoreText, Score } )
local Process = self:GetProcess( From, Event )
self:T( { Process = Process._Name, Scores = Process._Scores, State = State, ScoreText = ScoreText, Score = Score } )
Process._Scores[State] = Process._Scores[State] or {}
Process._Scores[State].ScoreText = ScoreText
Process._Scores[State].Score = Score
self:T( Process._Scores )
return Process
end
@ -12528,14 +12565,14 @@ end
-- @param #string Event
-- @param #string From
-- @param #string To
function FSM_PROCESS:onstatechange( ProcessUnit, From, Event, To, Dummy )
function FSM_PROCESS:onstatechange( ProcessUnit, Task, From, Event, To, Dummy )
self:T( { ProcessUnit, From, Event, To, Dummy, self:IsTrace() } )
if self:IsTrace() then
MESSAGE:New( "@ Process " .. self:GetClassNameAndID() .. " : " .. Event .. " changed to state " .. To, 2 ):ToAll()
end
self:T( self._Scores[To] )
self:T( { Scores = self._Scores, To = To } )
-- TODO: This needs to be reworked with a callback functions allocated within Task, and set within the mission script from the Task Objects...
if self._Scores[To] then
@ -26574,7 +26611,7 @@ do -- DETECTION_BASE
--- Get a detected item using a given numeric index.
-- @param #DETECTION_BASE self
-- @param #number Index
-- @return DETECTION_BASE.DetectedItem
-- @return #DETECTION_BASE.DetectedItem
function DETECTION_BASE:GetDetectedItem( Index )
local DetectedItem = self.DetectedItems[Index]
@ -26837,7 +26874,7 @@ do -- DETECTION_UNITS
local DetectedItemUnit = DetectedSet:GetFirst() -- Wrapper.Unit#UNIT
if DetectedItemUnit then
if DetectedItemUnit and DetectedItemUnit:IsAlive() then
self:T(DetectedItemUnit)
local UnitCategoryName = DetectedItemUnit:GetCategoryName() or ""
@ -26855,8 +26892,16 @@ do -- DETECTION_UNITS
UnitDistanceText = string.format( "%.2f", DetectedItem.Distance ) .. " km, visual contact"
end
local DetectedItemPointVec3 = DetectedItemUnit:GetPointVec3()
local DetectedItemPointLL = DetectedItemPointVec3:ToStringLL( 3, true )
local ThreatLevelA2G = DetectedItemUnit:GetThreatLevel( DetectedItem )
ReportSummary = string.format(
"%s%s",
"%s - Threat [%s] (%2d) - %s%s",
DetectedItemPointLL,
string.rep( "", ThreatLevelA2G ),
ThreatLevelA2G,
UnitCategoryText,
UnitDistanceText
)
@ -26971,10 +27016,10 @@ do -- DETECTION_TYPES
for DetectedItemID, DetectedItem in pairs( self.DetectedItems ) do
local DetectedItemSet = DetectedItem:GetSet() -- Core.Set#SET_UNIT
local DetectedItemSet = DetectedItem.Set -- Core.Set#SET_UNIT
local DetectedTypeName = DetectedItem.Type
for DetectedUnitName, DetectedUnitData in pairs( DetectedItemSet ) do
for DetectedUnitName, DetectedUnitData in pairs( DetectedItemSet:GetSet() ) do
local DetectedUnit = DetectedUnitData -- Wrapper.Unit#UNIT
local DetectedObject = nil
@ -27043,12 +27088,15 @@ do -- DETECTION_TYPES
if DetectedItem then
local ThreatLevelA2G = DetectedSet:CalculateThreatLevelA2G()
local DetectedItemsCount = DetectedSet:Count()
local DetectedItemType = DetectedItem.Type
local ReportSummary = string.format(
"Type #%s - Threat Level [%s] (%2d)",
DetectedItem.Type,
"Threat [%s] (%2d) - %2d of %s",
string.rep( "", ThreatLevelA2G ),
ThreatLevelA2G
ThreatLevelA2G,
DetectedItemsCount,
DetectedItemType
)
self:T( ReportSummary )
@ -27152,17 +27200,23 @@ do -- DETECTION_AREAS
local DetectedItem = self:GetDetectedItem( Index )
if DetectedItem then
local DetectedSet = self:GetDetectedSet( Index )
local ThreatLevelA2G = self:GetTreatLevelA2G( DetectedItem )
local ReportSummaryItem
local DetectedZone = self:GetDetectedZone( Index )
local DetectedItemPointVec3 = DetectedZone:GetPointVec3()
local DetectedItemPointLL = DetectedItemPointVec3:ToStringLL( 3, true )
local ThreatLevelA2G = self:GetTreatLevelA2G( DetectedItem )
local DetectedItemsCount = DetectedSet:Count()
local DetectedItemsTypes = DetectedSet:GetTypeNames()
local ReportSummary = string.format(
"%s - Threat Level [%s] (%2d)",
"%s - Threat [%s] (%2d) - %2d of %s",
DetectedItemPointLL,
string.rep( "", ThreatLevelA2G ),
ThreatLevelA2G
ThreatLevelA2G,
DetectedItemsCount,
DetectedItemsTypes
)
return ReportSummary
@ -32121,8 +32175,14 @@ function REPORT:Add( Text )
return self.Report[#self.Report]
end
function REPORT:Text()
return table.concat( self.Report, "\n" )
--- Produces the text of the report, taking into account an optional delimeter, which is \n by default.
-- @param #REPORT self
-- @param #string Delimiter (optional) A delimiter text.
-- @return #string The report text.
function REPORT:Text( Delimiter )
Delimiter = Delimiter or "\n"
local ReportText = table.concat( self.Report, Delimiter ) or ""
return ReportText
end
--- The COMMANDCENTER class
@ -34007,11 +34067,12 @@ end
-- @param #string To
function TASK:onenterAssigned( From, Event, To, PlayerUnit, PlayerName )
self:E("Task Assigned")
self:E( { "Task Assigned", self.Dispatcher } )
self:MessageToGroups( "Task " .. self:GetName() .. " has been assigned to your group." )
if self.Dispatcher then
self:E( "Firing Assign event " )
self.Dispatcher:Assign( self, PlayerUnit, PlayerName )
end
@ -34701,7 +34762,7 @@ do -- TASK_A2G_DISPATCHER
Mission:GetCommandCenter():MessageToGroup(
string.format( "HQ Reporting - Planned tasks for mission '%s':\n%s\n",
self.Mission:GetName(),
string.format( "%s\n%s\n%s\n%s", ReportSEAD:Text(), ReportCAS:Text(), ReportBAI:Text(), ReportChanges:Text()
string.format( "%s\n\n%s\n\n%s\n\n%s", ReportSEAD:Text(), ReportCAS:Text(), ReportBAI:Text(), ReportChanges:Text()
)
), TaskGroup
)
@ -35021,6 +35082,7 @@ do -- TASK_A2G
-- @param Wrapper.Unit#UNIT TaskUnit
-- @return #TASK_A2G
function TASK_A2G:SetScoreOnDestroy( Text, Score, TaskUnit )
self:F( { Text, Score, TaskUnit } )
local ProcessUnit = self:GetUnitProcess( TaskUnit )
@ -35036,6 +35098,7 @@ do -- TASK_A2G
-- @param Wrapper.Unit#UNIT TaskUnit
-- @return #TASK_A2G
function TASK_A2G:SetScoreOnSuccess( Text, Score, TaskUnit )
self:F( { Text, Score, TaskUnit } )
local ProcessUnit = self:GetUnitProcess( TaskUnit )
@ -35051,6 +35114,7 @@ do -- TASK_A2G
-- @param Wrapper.Unit#UNIT TaskUnit
-- @return #TASK_A2G
function TASK_A2G:SetPenaltyOnFailed( Text, Penalty, TaskUnit )
self:F( { Text, Score, TaskUnit } )
local ProcessUnit = self:GetUnitProcess( TaskUnit )

View File

@ -1,5 +1,5 @@
env.info( '*** MOOSE STATIC INCLUDE START *** ' )
env.info( 'Moose Generation Timestamp: 20170319_1459' )
env.info( 'Moose Generation Timestamp: 20170320_1252' )
local base = _G
Include = {}
@ -7971,225 +7971,30 @@ end
--- **Core** - SET classes define **collections** of objects to perform **bulk actions** and logically **group** objects.
--- **Core** - SET_ classes define **collections** of objects to perform **bulk actions** and logically **group** objects.
--
-- ![Banner Image](..\Presentations\SET\Dia1.JPG)
--
-- ===
--
-- 1) @{Set#SET_BASE} class, extends @{Base#BASE}
-- ==============================================
-- The @{Set#SET_BASE} class defines the core functions that define a collection of objects.
-- A SET provides iterators to iterate the SET, but will **temporarily** yield the ForEach interator loop at defined **"intervals"** to the mail simulator loop.
-- In this way, large loops can be done while not blocking the simulator main processing loop.
-- The default **"yield interval"** is after 10 objects processed.
-- The default **"time interval"** is after 0.001 seconds.
-- SET_ classes group objects of the same type into a collection, which is either:
--
-- 1.1) Add or remove objects from the SET
-- ---------------------------------------
-- Some key core functions are @{Set#SET_BASE.Add} and @{Set#SET_BASE.Remove} to add or remove objects from the SET in your logic.
-- * Manually managed using the **:Add...()** or **:Remove...()** methods. The initial SET can be filtered with the **@{#SET_BASE.FilterOnce}()** method
-- * Dynamically updated when new objects are created or objects are destroyed using the **@{#SET_BASE.FilterStart}()** method.
--
-- 1.2) Define the SET iterator **"yield interval"** and the **"time interval"**
-- -----------------------------------------------------------------------------
-- Modify the iterator intervals with the @{Set#SET_BASE.SetInteratorIntervals} method.
-- You can set the **"yield interval"**, and the **"time interval"**. (See above).
-- Various types of SET_ classes are available:
--
-- ===
-- * @{#SET_UNIT}: Defines a colleciton of @{Unit}s filtered by filter criteria.
-- * @{#SET_GROUP}: Defines a collection of @{Group}s filtered by filter criteria.
-- * @{#SET_CLIENT}: Defines a collection of @{Client}s filterd by filter criteria.
-- * @{#SET_AIRBASE}: Defines a collection of @{Airbase}s filtered by filter criteria.
--
-- 2) @{Set#SET_GROUP} class, extends @{Set#SET_BASE}
-- ==================================================
-- Mission designers can use the @{Set#SET_GROUP} class to build sets of groups belonging to certain:
-- These classes are derived from @{#SET_BASE}, which contains the main methods to manage SETs.
--
-- * Coalitions
-- * Categories
-- * Countries
-- * Starting with certain prefix strings.
-- A multitude of other methods are available in SET_ classes that allow to:
--
-- 2.1) SET_GROUP construction method:
-- -----------------------------------
-- Create a new SET_GROUP object with the @{#SET_GROUP.New} method:
--
-- * @{#SET_GROUP.New}: Creates a new SET_GROUP object.
--
-- 2.2) Add or Remove GROUP(s) from SET_GROUP:
-- -------------------------------------------
-- GROUPS can be added and removed using the @{Set#SET_GROUP.AddGroupsByName} and @{Set#SET_GROUP.RemoveGroupsByName} respectively.
-- These methods take a single GROUP name or an array of GROUP names to be added or removed from SET_GROUP.
--
-- 2.3) SET_GROUP filter criteria:
-- -------------------------------
-- You can set filter criteria to define the set of groups within the SET_GROUP.
-- Filter criteria are defined by:
--
-- * @{#SET_GROUP.FilterCoalitions}: Builds the SET_GROUP with the groups belonging to the coalition(s).
-- * @{#SET_GROUP.FilterCategories}: Builds the SET_GROUP with the groups belonging to the category(ies).
-- * @{#SET_GROUP.FilterCountries}: Builds the SET_GROUP with the gruops belonging to the country(ies).
-- * @{#SET_GROUP.FilterPrefixes}: Builds the SET_GROUP with the groups starting with the same prefix string(s).
--
-- Once the filter criteria have been set for the SET_GROUP, you can start filtering using:
--
-- * @{#SET_GROUP.FilterStart}: Starts the filtering of the groups within the SET_GROUP and add or remove GROUP objects **dynamically**.
--
-- Planned filter criteria within development are (so these are not yet available):
--
-- * @{#SET_GROUP.FilterZones}: Builds the SET_GROUP with the groups within a @{Zone#ZONE}.
--
-- 2.4) SET_GROUP iterators:
-- -------------------------
-- Once the filters have been defined and the SET_GROUP has been built, you can iterate the SET_GROUP with the available iterator methods.
-- The iterator methods will walk the SET_GROUP set, and call for each element within the set a function that you provide.
-- The following iterator methods are currently available within the SET_GROUP:
--
-- * @{#SET_GROUP.ForEachGroup}: Calls a function for each alive group it finds within the SET_GROUP.
-- * @{#SET_GROUP.ForEachGroupCompletelyInZone}: Iterate the SET_GROUP and call an iterator function for each **alive** GROUP presence completely in a @{Zone}, providing the GROUP and optional parameters to the called function.
-- * @{#SET_GROUP.ForEachGroupPartlyInZone}: Iterate the SET_GROUP and call an iterator function for each **alive** GROUP presence partly in a @{Zone}, providing the GROUP and optional parameters to the called function.
-- * @{#SET_GROUP.ForEachGroupNotInZone}: Iterate the SET_GROUP and call an iterator function for each **alive** GROUP presence not in a @{Zone}, providing the GROUP and optional parameters to the called function.
--
-- ====
--
-- 3) @{Set#SET_UNIT} class, extends @{Set#SET_BASE}
-- ===================================================
-- Mission designers can use the @{Set#SET_UNIT} class to build sets of units belonging to certain:
--
-- * Coalitions
-- * Categories
-- * Countries
-- * Unit types
-- * Starting with certain prefix strings.
--
-- 3.1) SET_UNIT construction method:
-- ----------------------------------
-- Create a new SET_UNIT object with the @{#SET_UNIT.New} method:
--
-- * @{#SET_UNIT.New}: Creates a new SET_UNIT object.
--
-- 3.2) Add or Remove UNIT(s) from SET_UNIT:
-- -----------------------------------------
-- UNITs can be added and removed using the @{Set#SET_UNIT.AddUnitsByName} and @{Set#SET_UNIT.RemoveUnitsByName} respectively.
-- These methods take a single UNIT name or an array of UNIT names to be added or removed from SET_UNIT.
--
-- 3.3) SET_UNIT filter criteria:
-- ------------------------------
-- You can set filter criteria to define the set of units within the SET_UNIT.
-- Filter criteria are defined by:
--
-- * @{#SET_UNIT.FilterCoalitions}: Builds the SET_UNIT with the units belonging to the coalition(s).
-- * @{#SET_UNIT.FilterCategories}: Builds the SET_UNIT with the units belonging to the category(ies).
-- * @{#SET_UNIT.FilterTypes}: Builds the SET_UNIT with the units belonging to the unit type(s).
-- * @{#SET_UNIT.FilterCountries}: Builds the SET_UNIT with the units belonging to the country(ies).
-- * @{#SET_UNIT.FilterPrefixes}: Builds the SET_UNIT with the units starting with the same prefix string(s).
--
-- Once the filter criteria have been set for the SET_UNIT, you can start filtering using:
--
-- * @{#SET_UNIT.FilterStart}: Starts the filtering of the units within the SET_UNIT.
--
-- Planned filter criteria within development are (so these are not yet available):
--
-- * @{#SET_UNIT.FilterZones}: Builds the SET_UNIT with the units within a @{Zone#ZONE}.
--
-- 3.4) SET_UNIT iterators:
-- ------------------------
-- Once the filters have been defined and the SET_UNIT has been built, you can iterate the SET_UNIT with the available iterator methods.
-- The iterator methods will walk the SET_UNIT set, and call for each element within the set a function that you provide.
-- The following iterator methods are currently available within the SET_UNIT:
--
-- * @{#SET_UNIT.ForEachUnit}: Calls a function for each alive unit it finds within the SET_UNIT.
-- * @{#SET_GROUP.ForEachGroupCompletelyInZone}: Iterate the SET_GROUP and call an iterator function for each **alive** GROUP presence completely in a @{Zone}, providing the GROUP and optional parameters to the called function.
-- * @{#SET_GROUP.ForEachGroupNotInZone}: Iterate the SET_GROUP and call an iterator function for each **alive** GROUP presence not in a @{Zone}, providing the GROUP and optional parameters to the called function.
--
-- Planned iterators methods in development are (so these are not yet available):
--
-- * @{#SET_UNIT.ForEachUnitInUnit}: Calls a function for each unit contained within the SET_UNIT.
-- * @{#SET_UNIT.ForEachUnitCompletelyInZone}: Iterate and call an iterator function for each **alive** UNIT presence completely in a @{Zone}, providing the UNIT and optional parameters to the called function.
-- * @{#SET_UNIT.ForEachUnitNotInZone}: Iterate and call an iterator function for each **alive** UNIT presence not in a @{Zone}, providing the UNIT and optional parameters to the called function.
--
-- ===
--
-- 4) @{Set#SET_CLIENT} class, extends @{Set#SET_BASE}
-- ===================================================
-- Mission designers can use the @{Set#SET_CLIENT} class to build sets of units belonging to certain:
--
-- * Coalitions
-- * Categories
-- * Countries
-- * Client types
-- * Starting with certain prefix strings.
--
-- 4.1) SET_CLIENT construction method:
-- ----------------------------------
-- Create a new SET_CLIENT object with the @{#SET_CLIENT.New} method:
--
-- * @{#SET_CLIENT.New}: Creates a new SET_CLIENT object.
--
-- 4.2) Add or Remove CLIENT(s) from SET_CLIENT:
-- -----------------------------------------
-- CLIENTs can be added and removed using the @{Set#SET_CLIENT.AddClientsByName} and @{Set#SET_CLIENT.RemoveClientsByName} respectively.
-- These methods take a single CLIENT name or an array of CLIENT names to be added or removed from SET_CLIENT.
--
-- 4.3) SET_CLIENT filter criteria:
-- ------------------------------
-- You can set filter criteria to define the set of clients within the SET_CLIENT.
-- Filter criteria are defined by:
--
-- * @{#SET_CLIENT.FilterCoalitions}: Builds the SET_CLIENT with the clients belonging to the coalition(s).
-- * @{#SET_CLIENT.FilterCategories}: Builds the SET_CLIENT with the clients belonging to the category(ies).
-- * @{#SET_CLIENT.FilterTypes}: Builds the SET_CLIENT with the clients belonging to the client type(s).
-- * @{#SET_CLIENT.FilterCountries}: Builds the SET_CLIENT with the clients belonging to the country(ies).
-- * @{#SET_CLIENT.FilterPrefixes}: Builds the SET_CLIENT with the clients starting with the same prefix string(s).
--
-- Once the filter criteria have been set for the SET_CLIENT, you can start filtering using:
--
-- * @{#SET_CLIENT.FilterStart}: Starts the filtering of the clients within the SET_CLIENT.
--
-- Planned filter criteria within development are (so these are not yet available):
--
-- * @{#SET_CLIENT.FilterZones}: Builds the SET_CLIENT with the clients within a @{Zone#ZONE}.
--
-- 4.4) SET_CLIENT iterators:
-- ------------------------
-- Once the filters have been defined and the SET_CLIENT has been built, you can iterate the SET_CLIENT with the available iterator methods.
-- The iterator methods will walk the SET_CLIENT set, and call for each element within the set a function that you provide.
-- The following iterator methods are currently available within the SET_CLIENT:
--
-- * @{#SET_CLIENT.ForEachClient}: Calls a function for each alive client it finds within the SET_CLIENT.
--
-- ====
--
-- 5) @{Set#SET_AIRBASE} class, extends @{Set#SET_BASE}
-- ====================================================
-- Mission designers can use the @{Set#SET_AIRBASE} class to build sets of airbases optionally belonging to certain:
--
-- * Coalitions
--
-- 5.1) SET_AIRBASE construction
-- -----------------------------
-- Create a new SET_AIRBASE object with the @{#SET_AIRBASE.New} method:
--
-- * @{#SET_AIRBASE.New}: Creates a new SET_AIRBASE object.
--
-- 5.2) Add or Remove AIRBASEs from SET_AIRBASE
-- --------------------------------------------
-- AIRBASEs can be added and removed using the @{Set#SET_AIRBASE.AddAirbasesByName} and @{Set#SET_AIRBASE.RemoveAirbasesByName} respectively.
-- These methods take a single AIRBASE name or an array of AIRBASE names to be added or removed from SET_AIRBASE.
--
-- 5.3) SET_AIRBASE filter criteria
-- --------------------------------
-- You can set filter criteria to define the set of clients within the SET_AIRBASE.
-- Filter criteria are defined by:
--
-- * @{#SET_AIRBASE.FilterCoalitions}: Builds the SET_AIRBASE with the airbases belonging to the coalition(s).
--
-- Once the filter criteria have been set for the SET_AIRBASE, you can start filtering using:
--
-- * @{#SET_AIRBASE.FilterStart}: Starts the filtering of the airbases within the SET_AIRBASE.
--
-- 5.4) SET_AIRBASE iterators:
-- ---------------------------
-- Once the filters have been defined and the SET_AIRBASE has been built, you can iterate the SET_AIRBASE with the available iterator methods.
-- The iterator methods will walk the SET_AIRBASE set, and call for each airbase within the set a function that you provide.
-- The following iterator methods are currently available within the SET_AIRBASE:
--
-- * @{#SET_AIRBASE.ForEachAirbase}: Calls a function for each airbase it finds within the SET_AIRBASE.
--
-- ====
-- * Validate the presence of objects in the SET.
-- * Trigger events when objects in the SET change a zone presence.
--
-- ### Authors:
--
@ -8201,7 +8006,22 @@ end
-- @module Set
--- SET_BASE class
--- # 1) SET_BASE class, extends @{Base#BASE}
-- The @{Set#SET_BASE} class defines the core functions that define a collection of objects.
-- A SET provides iterators to iterate the SET, but will **temporarily** yield the ForEach interator loop at defined **"intervals"** to the mail simulator loop.
-- In this way, large loops can be done while not blocking the simulator main processing loop.
-- The default **"yield interval"** is after 10 objects processed.
-- The default **"time interval"** is after 0.001 seconds.
--
-- ## 1.1) Add or remove objects from the SET
--
-- Some key core functions are @{Set#SET_BASE.Add} and @{Set#SET_BASE.Remove} to add or remove objects from the SET in your logic.
--
-- ## 1.2) Define the SET iterator **"yield interval"** and the **"time interval"**
--
-- Modify the iterator intervals with the @{Set#SET_BASE.SetInteratorIntervals} method.
-- You can set the **"yield interval"**, and the **"time interval"**. (See above).
--
-- @type SET_BASE
-- @field #table Filter
-- @field #table Set
@ -8415,7 +8235,7 @@ end
-- @return #number Count
function SET_BASE:Count()
return #self.Index
return #self.Index or 0
end
@ -8750,7 +8570,55 @@ end
-- SET_GROUP
--- SET_GROUP class
--- # 2) SET_GROUP class, extends @{Set#SET_BASE}
--
-- Mission designers can use the @{Set#SET_GROUP} class to build sets of groups belonging to certain:
--
-- * Coalitions
-- * Categories
-- * Countries
-- * Starting with certain prefix strings.
--
-- ## 2.1) SET_GROUP constructor
--
-- Create a new SET_GROUP object with the @{#SET_GROUP.New} method:
--
-- * @{#SET_GROUP.New}: Creates a new SET_GROUP object.
--
-- ## 2.2) Add or Remove GROUP(s) from SET_GROUP
--
-- GROUPS can be added and removed using the @{Set#SET_GROUP.AddGroupsByName} and @{Set#SET_GROUP.RemoveGroupsByName} respectively.
-- These methods take a single GROUP name or an array of GROUP names to be added or removed from SET_GROUP.
--
-- ## 2.3) SET_GROUP filter criteria
--
-- You can set filter criteria to define the set of groups within the SET_GROUP.
-- Filter criteria are defined by:
--
-- * @{#SET_GROUP.FilterCoalitions}: Builds the SET_GROUP with the groups belonging to the coalition(s).
-- * @{#SET_GROUP.FilterCategories}: Builds the SET_GROUP with the groups belonging to the category(ies).
-- * @{#SET_GROUP.FilterCountries}: Builds the SET_GROUP with the gruops belonging to the country(ies).
-- * @{#SET_GROUP.FilterPrefixes}: Builds the SET_GROUP with the groups starting with the same prefix string(s).
--
-- Once the filter criteria have been set for the SET_GROUP, you can start filtering using:
--
-- * @{#SET_GROUP.FilterStart}: Starts the filtering of the groups within the SET_GROUP and add or remove GROUP objects **dynamically**.
--
-- Planned filter criteria within development are (so these are not yet available):
--
-- * @{#SET_GROUP.FilterZones}: Builds the SET_GROUP with the groups within a @{Zone#ZONE}.
--
-- ## 2.4) SET_GROUP iterators
--
-- Once the filters have been defined and the SET_GROUP has been built, you can iterate the SET_GROUP with the available iterator methods.
-- The iterator methods will walk the SET_GROUP set, and call for each element within the set a function that you provide.
-- The following iterator methods are currently available within the SET_GROUP:
--
-- * @{#SET_GROUP.ForEachGroup}: Calls a function for each alive group it finds within the SET_GROUP.
-- * @{#SET_GROUP.ForEachGroupCompletelyInZone}: Iterate the SET_GROUP and call an iterator function for each **alive** GROUP presence completely in a @{Zone}, providing the GROUP and optional parameters to the called function.
-- * @{#SET_GROUP.ForEachGroupPartlyInZone}: Iterate the SET_GROUP and call an iterator function for each **alive** GROUP presence partly in a @{Zone}, providing the GROUP and optional parameters to the called function.
-- * @{#SET_GROUP.ForEachGroupNotInZone}: Iterate the SET_GROUP and call an iterator function for each **alive** GROUP presence not in a @{Zone}, providing the GROUP and optional parameters to the called function.
--
-- @type SET_GROUP
-- @extends Core.Set#SET_BASE
SET_GROUP = {
@ -9118,7 +8986,69 @@ function SET_GROUP:IsIncludeObject( MooseGroup )
return MooseGroupInclude
end
--- SET_UNIT class
--- # 3) SET_UNIT class, extends @{Set#SET_BASE}
--
-- Mission designers can use the SET_UNIT class to build sets of units belonging to certain:
--
-- * Coalitions
-- * Categories
-- * Countries
-- * Unit types
-- * Starting with certain prefix strings.
--
-- ## 3.1) SET_UNIT constructor
--
-- Create a new SET_UNIT object with the @{#SET_UNIT.New} method:
--
-- * @{#SET_UNIT.New}: Creates a new SET_UNIT object.
--
-- ## 3.2) Add or Remove UNIT(s) from SET_UNIT
--
-- UNITs can be added and removed using the @{Set#SET_UNIT.AddUnitsByName} and @{Set#SET_UNIT.RemoveUnitsByName} respectively.
-- These methods take a single UNIT name or an array of UNIT names to be added or removed from SET_UNIT.
--
-- ## 3.3) SET_UNIT filter criteria
--
-- You can set filter criteria to define the set of units within the SET_UNIT.
-- Filter criteria are defined by:
--
-- * @{#SET_UNIT.FilterCoalitions}: Builds the SET_UNIT with the units belonging to the coalition(s).
-- * @{#SET_UNIT.FilterCategories}: Builds the SET_UNIT with the units belonging to the category(ies).
-- * @{#SET_UNIT.FilterTypes}: Builds the SET_UNIT with the units belonging to the unit type(s).
-- * @{#SET_UNIT.FilterCountries}: Builds the SET_UNIT with the units belonging to the country(ies).
-- * @{#SET_UNIT.FilterPrefixes}: Builds the SET_UNIT with the units starting with the same prefix string(s).
--
-- Once the filter criteria have been set for the SET_UNIT, you can start filtering using:
--
-- * @{#SET_UNIT.FilterStart}: Starts the filtering of the units within the SET_UNIT.
--
-- Planned filter criteria within development are (so these are not yet available):
--
-- * @{#SET_UNIT.FilterZones}: Builds the SET_UNIT with the units within a @{Zone#ZONE}.
--
-- ## 3.4) SET_UNIT iterators
--
-- Once the filters have been defined and the SET_UNIT has been built, you can iterate the SET_UNIT with the available iterator methods.
-- The iterator methods will walk the SET_UNIT set, and call for each element within the set a function that you provide.
-- The following iterator methods are currently available within the SET_UNIT:
--
-- * @{#SET_UNIT.ForEachUnit}: Calls a function for each alive unit it finds within the SET_UNIT.
-- * @{#SET_GROUP.ForEachGroupCompletelyInZone}: Iterate the SET_GROUP and call an iterator function for each **alive** GROUP presence completely in a @{Zone}, providing the GROUP and optional parameters to the called function.
-- * @{#SET_GROUP.ForEachGroupNotInZone}: Iterate the SET_GROUP and call an iterator function for each **alive** GROUP presence not in a @{Zone}, providing the GROUP and optional parameters to the called function.
--
-- Planned iterators methods in development are (so these are not yet available):
--
-- * @{#SET_UNIT.ForEachUnitInUnit}: Calls a function for each unit contained within the SET_UNIT.
-- * @{#SET_UNIT.ForEachUnitCompletelyInZone}: Iterate and call an iterator function for each **alive** UNIT presence completely in a @{Zone}, providing the UNIT and optional parameters to the called function.
-- * @{#SET_UNIT.ForEachUnitNotInZone}: Iterate and call an iterator function for each **alive** UNIT presence not in a @{Zone}, providing the UNIT and optional parameters to the called function.
--
-- ## 3.5 ) SET_UNIT atomic methods
--
-- Various methods exist for a SET_UNIT to perform actions or calculations and retrieve results from the SET_UNIT:
--
-- * @{#SET_UNIT.GetTypeNames}(): Retrieve the type names of the @{Unit}s in the SET, delimited by a comma.
--
--
-- @type SET_UNIT
-- @extends Core.Set#SET_BASE
SET_UNIT = {
@ -9732,9 +9662,81 @@ function SET_UNIT:IsIncludeObject( MUnit )
end
--- Retrieve the type names of the @{Unit}s in the SET, delimited by an optional delimiter.
-- @param #SET_UNIT self
-- @param #string Delimiter (optional) The delimiter, which is default a comma.
-- @return #string The types of the @{Unit}s delimited.
function SET_UNIT:GetTypeNames( Delimiter )
Delimiter = Delimiter or ", "
local TypeReport = REPORT:New()
local Types = {}
for UnitName, UnitData in pairs( self:GetSet() ) do
local Unit = UnitData -- Wrapper.Unit#UNIT
local UnitTypeName = Unit:GetTypeName()
if not Types[UnitTypeName] then
Types[UnitTypeName] = UnitTypeName
TypeReport:Add( UnitTypeName )
end
end
return TypeReport:Text( Delimiter )
end
--- SET_CLIENT
--- SET_CLIENT class
--- # 4) SET_CLIENT class, extends @{Set#SET_BASE}
--
-- Mission designers can use the @{Set#SET_CLIENT} class to build sets of units belonging to certain:
--
-- * Coalitions
-- * Categories
-- * Countries
-- * Client types
-- * Starting with certain prefix strings.
--
-- ## 4.1) SET_CLIENT constructor
--
-- Create a new SET_CLIENT object with the @{#SET_CLIENT.New} method:
--
-- * @{#SET_CLIENT.New}: Creates a new SET_CLIENT object.
--
-- ## 4.2) Add or Remove CLIENT(s) from SET_CLIENT
--
-- CLIENTs can be added and removed using the @{Set#SET_CLIENT.AddClientsByName} and @{Set#SET_CLIENT.RemoveClientsByName} respectively.
-- These methods take a single CLIENT name or an array of CLIENT names to be added or removed from SET_CLIENT.
--
-- ## 4.3) SET_CLIENT filter criteria
--
-- You can set filter criteria to define the set of clients within the SET_CLIENT.
-- Filter criteria are defined by:
--
-- * @{#SET_CLIENT.FilterCoalitions}: Builds the SET_CLIENT with the clients belonging to the coalition(s).
-- * @{#SET_CLIENT.FilterCategories}: Builds the SET_CLIENT with the clients belonging to the category(ies).
-- * @{#SET_CLIENT.FilterTypes}: Builds the SET_CLIENT with the clients belonging to the client type(s).
-- * @{#SET_CLIENT.FilterCountries}: Builds the SET_CLIENT with the clients belonging to the country(ies).
-- * @{#SET_CLIENT.FilterPrefixes}: Builds the SET_CLIENT with the clients starting with the same prefix string(s).
--
-- Once the filter criteria have been set for the SET_CLIENT, you can start filtering using:
--
-- * @{#SET_CLIENT.FilterStart}: Starts the filtering of the clients within the SET_CLIENT.
--
-- Planned filter criteria within development are (so these are not yet available):
--
-- * @{#SET_CLIENT.FilterZones}: Builds the SET_CLIENT with the clients within a @{Zone#ZONE}.
--
-- ## 4.4) SET_CLIENT iterators
--
-- Once the filters have been defined and the SET_CLIENT has been built, you can iterate the SET_CLIENT with the available iterator methods.
-- The iterator methods will walk the SET_CLIENT set, and call for each element within the set a function that you provide.
-- The following iterator methods are currently available within the SET_CLIENT:
--
-- * @{#SET_CLIENT.ForEachClient}: Calls a function for each alive client it finds within the SET_CLIENT.
--
-- @type SET_CLIENT
-- @extends Core.Set#SET_BASE
SET_CLIENT = {
@ -10091,7 +10093,42 @@ end
--- SET_AIRBASE
--- SET_AIRBASE class
--- # 5) SET_AIRBASE class, extends @{Set#SET_BASE}
--
-- Mission designers can use the @{Set#SET_AIRBASE} class to build sets of airbases optionally belonging to certain:
--
-- * Coalitions
--
-- ## 5.1) SET_AIRBASE constructor
--
-- Create a new SET_AIRBASE object with the @{#SET_AIRBASE.New} method:
--
-- * @{#SET_AIRBASE.New}: Creates a new SET_AIRBASE object.
--
-- ## 5.2) Add or Remove AIRBASEs from SET_AIRBASE
--
-- AIRBASEs can be added and removed using the @{Set#SET_AIRBASE.AddAirbasesByName} and @{Set#SET_AIRBASE.RemoveAirbasesByName} respectively.
-- These methods take a single AIRBASE name or an array of AIRBASE names to be added or removed from SET_AIRBASE.
--
-- ## 5.3) SET_AIRBASE filter criteria
--
-- You can set filter criteria to define the set of clients within the SET_AIRBASE.
-- Filter criteria are defined by:
--
-- * @{#SET_AIRBASE.FilterCoalitions}: Builds the SET_AIRBASE with the airbases belonging to the coalition(s).
--
-- Once the filter criteria have been set for the SET_AIRBASE, you can start filtering using:
--
-- * @{#SET_AIRBASE.FilterStart}: Starts the filtering of the airbases within the SET_AIRBASE.
--
-- ## 5.4) SET_AIRBASE iterators
--
-- Once the filters have been defined and the SET_AIRBASE has been built, you can iterate the SET_AIRBASE with the available iterator methods.
-- The iterator methods will walk the SET_AIRBASE set, and call for each airbase within the set a function that you provide.
-- The following iterator methods are currently available within the SET_AIRBASE:
--
-- * @{#SET_AIRBASE.ForEachAirbase}: Calls a function for each airbase it finds within the SET_AIRBASE.
--
-- @type SET_AIRBASE
-- @extends Core.Set#SET_BASE
SET_AIRBASE = {
@ -11901,7 +11938,6 @@ do -- FSM
for ProcessID, Process in pairs( self:GetProcesses() ) do
if Process.From == From and Process.Event == Event then
self:T( Process )
return Process.fsm
end
end
@ -11930,7 +11966,7 @@ do -- FSM
-- @param #number Score is a number providing the score of the status.
-- @return #FSM self
function FSM:AddScore( State, ScoreText, Score )
self:F2( { State, ScoreText, Score } )
self:F( { State, ScoreText, Score } )
self._Scores[State] = self._Scores[State] or {}
self._Scores[State].ScoreText = ScoreText
@ -11948,15 +11984,16 @@ do -- FSM
-- @param #number Score is a number providing the score of the status.
-- @return #FSM self
function FSM:AddScoreProcess( From, Event, State, ScoreText, Score )
self:F2( { Event, State, ScoreText, Score } )
self:F( { From, Event, State, ScoreText, Score } )
local Process = self:GetProcess( From, Event )
self:T( { Process = Process._Name, Scores = Process._Scores, State = State, ScoreText = ScoreText, Score = Score } )
Process._Scores[State] = Process._Scores[State] or {}
Process._Scores[State].ScoreText = ScoreText
Process._Scores[State].Score = Score
self:T( Process._Scores )
return Process
end
@ -12528,14 +12565,14 @@ end
-- @param #string Event
-- @param #string From
-- @param #string To
function FSM_PROCESS:onstatechange( ProcessUnit, From, Event, To, Dummy )
function FSM_PROCESS:onstatechange( ProcessUnit, Task, From, Event, To, Dummy )
self:T( { ProcessUnit, From, Event, To, Dummy, self:IsTrace() } )
if self:IsTrace() then
MESSAGE:New( "@ Process " .. self:GetClassNameAndID() .. " : " .. Event .. " changed to state " .. To, 2 ):ToAll()
end
self:T( self._Scores[To] )
self:T( { Scores = self._Scores, To = To } )
-- TODO: This needs to be reworked with a callback functions allocated within Task, and set within the mission script from the Task Objects...
if self._Scores[To] then
@ -26574,7 +26611,7 @@ do -- DETECTION_BASE
--- Get a detected item using a given numeric index.
-- @param #DETECTION_BASE self
-- @param #number Index
-- @return DETECTION_BASE.DetectedItem
-- @return #DETECTION_BASE.DetectedItem
function DETECTION_BASE:GetDetectedItem( Index )
local DetectedItem = self.DetectedItems[Index]
@ -26837,7 +26874,7 @@ do -- DETECTION_UNITS
local DetectedItemUnit = DetectedSet:GetFirst() -- Wrapper.Unit#UNIT
if DetectedItemUnit then
if DetectedItemUnit and DetectedItemUnit:IsAlive() then
self:T(DetectedItemUnit)
local UnitCategoryName = DetectedItemUnit:GetCategoryName() or ""
@ -26855,8 +26892,16 @@ do -- DETECTION_UNITS
UnitDistanceText = string.format( "%.2f", DetectedItem.Distance ) .. " km, visual contact"
end
local DetectedItemPointVec3 = DetectedItemUnit:GetPointVec3()
local DetectedItemPointLL = DetectedItemPointVec3:ToStringLL( 3, true )
local ThreatLevelA2G = DetectedItemUnit:GetThreatLevel( DetectedItem )
ReportSummary = string.format(
"%s%s",
"%s - Threat [%s] (%2d) - %s%s",
DetectedItemPointLL,
string.rep( "", ThreatLevelA2G ),
ThreatLevelA2G,
UnitCategoryText,
UnitDistanceText
)
@ -26971,10 +27016,10 @@ do -- DETECTION_TYPES
for DetectedItemID, DetectedItem in pairs( self.DetectedItems ) do
local DetectedItemSet = DetectedItem:GetSet() -- Core.Set#SET_UNIT
local DetectedItemSet = DetectedItem.Set -- Core.Set#SET_UNIT
local DetectedTypeName = DetectedItem.Type
for DetectedUnitName, DetectedUnitData in pairs( DetectedItemSet ) do
for DetectedUnitName, DetectedUnitData in pairs( DetectedItemSet:GetSet() ) do
local DetectedUnit = DetectedUnitData -- Wrapper.Unit#UNIT
local DetectedObject = nil
@ -27043,12 +27088,15 @@ do -- DETECTION_TYPES
if DetectedItem then
local ThreatLevelA2G = DetectedSet:CalculateThreatLevelA2G()
local DetectedItemsCount = DetectedSet:Count()
local DetectedItemType = DetectedItem.Type
local ReportSummary = string.format(
"Type #%s - Threat Level [%s] (%2d)",
DetectedItem.Type,
"Threat [%s] (%2d) - %2d of %s",
string.rep( "", ThreatLevelA2G ),
ThreatLevelA2G
ThreatLevelA2G,
DetectedItemsCount,
DetectedItemType
)
self:T( ReportSummary )
@ -27152,17 +27200,23 @@ do -- DETECTION_AREAS
local DetectedItem = self:GetDetectedItem( Index )
if DetectedItem then
local DetectedSet = self:GetDetectedSet( Index )
local ThreatLevelA2G = self:GetTreatLevelA2G( DetectedItem )
local ReportSummaryItem
local DetectedZone = self:GetDetectedZone( Index )
local DetectedItemPointVec3 = DetectedZone:GetPointVec3()
local DetectedItemPointLL = DetectedItemPointVec3:ToStringLL( 3, true )
local ThreatLevelA2G = self:GetTreatLevelA2G( DetectedItem )
local DetectedItemsCount = DetectedSet:Count()
local DetectedItemsTypes = DetectedSet:GetTypeNames()
local ReportSummary = string.format(
"%s - Threat Level [%s] (%2d)",
"%s - Threat [%s] (%2d) - %2d of %s",
DetectedItemPointLL,
string.rep( "", ThreatLevelA2G ),
ThreatLevelA2G
ThreatLevelA2G,
DetectedItemsCount,
DetectedItemsTypes
)
return ReportSummary
@ -32121,8 +32175,14 @@ function REPORT:Add( Text )
return self.Report[#self.Report]
end
function REPORT:Text()
return table.concat( self.Report, "\n" )
--- Produces the text of the report, taking into account an optional delimeter, which is \n by default.
-- @param #REPORT self
-- @param #string Delimiter (optional) A delimiter text.
-- @return #string The report text.
function REPORT:Text( Delimiter )
Delimiter = Delimiter or "\n"
local ReportText = table.concat( self.Report, Delimiter ) or ""
return ReportText
end
--- The COMMANDCENTER class
@ -34007,11 +34067,12 @@ end
-- @param #string To
function TASK:onenterAssigned( From, Event, To, PlayerUnit, PlayerName )
self:E("Task Assigned")
self:E( { "Task Assigned", self.Dispatcher } )
self:MessageToGroups( "Task " .. self:GetName() .. " has been assigned to your group." )
if self.Dispatcher then
self:E( "Firing Assign event " )
self.Dispatcher:Assign( self, PlayerUnit, PlayerName )
end
@ -34701,7 +34762,7 @@ do -- TASK_A2G_DISPATCHER
Mission:GetCommandCenter():MessageToGroup(
string.format( "HQ Reporting - Planned tasks for mission '%s':\n%s\n",
self.Mission:GetName(),
string.format( "%s\n%s\n%s\n%s", ReportSEAD:Text(), ReportCAS:Text(), ReportBAI:Text(), ReportChanges:Text()
string.format( "%s\n\n%s\n\n%s\n\n%s", ReportSEAD:Text(), ReportCAS:Text(), ReportBAI:Text(), ReportChanges:Text()
)
), TaskGroup
)
@ -35021,6 +35082,7 @@ do -- TASK_A2G
-- @param Wrapper.Unit#UNIT TaskUnit
-- @return #TASK_A2G
function TASK_A2G:SetScoreOnDestroy( Text, Score, TaskUnit )
self:F( { Text, Score, TaskUnit } )
local ProcessUnit = self:GetUnitProcess( TaskUnit )
@ -35036,6 +35098,7 @@ do -- TASK_A2G
-- @param Wrapper.Unit#UNIT TaskUnit
-- @return #TASK_A2G
function TASK_A2G:SetScoreOnSuccess( Text, Score, TaskUnit )
self:F( { Text, Score, TaskUnit } )
local ProcessUnit = self:GetUnitProcess( TaskUnit )
@ -35051,6 +35114,7 @@ do -- TASK_A2G
-- @param Wrapper.Unit#UNIT TaskUnit
-- @return #TASK_A2G
function TASK_A2G:SetPenaltyOnFailed( Text, Penalty, TaskUnit )
self:F( { Text, Score, TaskUnit } )
local ProcessUnit = self:GetUnitProcess( TaskUnit )

Binary file not shown.

View File

@ -1,5 +1,5 @@
---
-- Name: TAD-210 - A2G Task Dispatching #1 for AREAS and SCORING
-- Name: TAD-210 - A2G Task Dispatching for AREAS and SCORING
-- Author: FlightControl
-- Date Created: 19 Mar 2017
--

View File

@ -0,0 +1,64 @@
---
-- Name: TAD-220 - A2G Task Dispatching per TYPE and SCORING
-- Author: FlightControl
-- Date Created: 20 Mar 2017
--
-- # Situation:
--
-- This mission demonstrates the scoring of dynamic task dispatching for Air to Ground operations.
--
-- # Test cases:
--
-- 1. Observe the FAC(A)'s detecting targets and grouping them.
-- 2. Check that the HQ provides menus to engage on a task set by the FACs.
-- 3. Engage on a task and destroy a target. Check if scoring is given for that target.
-- 4. Engage all targets in the task, and check if mission success is achieved and that a scoring is given.
-- 5. Restart the mission, and crash into the ground, check if you can get penalties.
--
local HQ = GROUP:FindByName( "HQ", "Bravo HQ" )
local CommandCenter = COMMANDCENTER:New( HQ, "Lima" )
local Scoring = SCORING:New( "Detect Demo" )
local Mission = MISSION
:New( CommandCenter, "Overlord", "High", "Attack Detect Mission Briefing", coalition.side.RED )
:AddScoring( Scoring )
local FACSet = SET_GROUP:New():FilterPrefixes( "FAC" ):FilterCoalitions("red"):FilterStart()
local FACAreas = DETECTION_TYPES:New( FACSet )
local AttackGroups = SET_GROUP:New():FilterCoalitions( "red" ):FilterPrefixes( "Attack" ):FilterStart()
TaskDispatcher = TASK_A2G_DISPATCHER:New( Mission, AttackGroups, FACAreas )
--- @param #TaskDispatcher self
-- @param From
-- @param Event
-- @param To
-- @param Tasking.Task_A2G#TASK_A2G Task
-- @param Wrapper.Unit#UNIT TaskUnit
-- @param #string PlayerName
function TaskDispatcher:OnAfterAssign( From, Event, To, Task, TaskUnit, PlayerName )
self:E( "I am in assigned ... " )
Task:SetScoreOnDestroy( "Player " .. PlayerName .. " destroyed a target", 50, TaskUnit )
Task:SetScoreOnSuccess( "The task has been successfully completed!", 200, TaskUnit )
Task:SetPenaltyOnFailed( "The task has failed completion!", -100, TaskUnit )
end
-- Now this is REALLY neat. I set the goal of the mission to be the destruction of Target #004.
-- This is just an example, but many more examples can follow...
-- Every time a Task becomes Successful, it will trigger the Complete event in the Mission.
-- The mission designer NEED TO OVERRIDE the OnBeforeComplete to prevent the mission from getting into completion
-- too early!
function Mission:OnBeforeComplete( From, Event, To )
local Group004 = GROUP:FindByName( "Target #004" )
if Group004:IsAlive() == false then
Mission:GetCommandCenter():MessageToCoalition( "Mission Complete!" )
return true
end
return false
end

View File

@ -919,6 +919,9 @@ 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

@ -2425,6 +2425,7 @@ The UNIT carrying the package.</p>
<dl class="function">
<dt>
<em></em>
<a id="#(AI_CARGO_UNIT).CargoCarrier" >
<strong>AI_CARGO_UNIT.CargoCarrier</strong>
</a>

View File

@ -243,9 +243,9 @@
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(REPORT).Text">REPORT:Text()</a></td>
<td class="name" nowrap="nowrap"><a href="##(REPORT).Text">REPORT:Text(Delimiter)</a></td>
<td class="summary">
<p>Produces the text of the report, taking into account an optional delimeter, which is \n by default.</p>
</td>
</tr>
</table>
@ -788,12 +788,26 @@ Group#GROUP</p>
<dt>
<a id="#(REPORT).Text" >
<strong>REPORT:Text()</strong>
<strong>REPORT:Text(Delimiter)</strong>
</a>
</dt>
<dd>
<p>Produces the text of the report, taking into account an optional delimeter, which is \n by default.</p>
<h3>Parameter</h3>
<ul>
<li>
<p><code><em>#string Delimiter </em></code>:
(optional) A delimiter text.</p>
</li>
</ul>
<h3>Return value</h3>
<p><em>#string:</em>
The report text.</p>
</dd>
</dl>

View File

@ -2105,6 +2105,7 @@ self</p>
<dl class="function">
<dt>
<em>#number</em>
<a id="#(DETECTION_BASE).DetectedItemCount" >
<strong>DETECTION_BASE.DetectedItemCount</strong>
</a>
@ -2118,6 +2119,7 @@ self</p>
<dl class="function">
<dt>
<em>#number</em>
<a id="#(DETECTION_BASE).DetectedItemMax" >
<strong>DETECTION_BASE.DetectedItemMax</strong>
</a>
@ -2333,8 +2335,8 @@ self</p>
</ul>
<h3>Return value</h3>
<p><em><a href="##(DETECTION_BASE.DetectedItem)">#DETECTION_BASE.DetectedItem</a>:</em></p>
<p>DETECTION_BASE.DetectedItem</p>
</dd>
</dl>

View File

@ -877,7 +877,7 @@ YYYY-MM-DD: CLASS:<strong>NewFunction( Params )</strong> added</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(FSM_PROCESS).onstatechange">FSM_PROCESS:onstatechange(ProcessUnit, Event, From, To, Dummy)</a></td>
<td class="name" nowrap="nowrap"><a href="##(FSM_PROCESS).onstatechange">FSM_PROCESS:onstatechange(ProcessUnit, Event, From, To, Task, Dummy)</a></td>
<td class="summary">
<p>StateMachine callback function for a FSM_PROCESS</p>
</td>
@ -1554,7 +1554,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>
@ -1853,6 +1853,7 @@ A string defining the start state.</p>
<dl class="function">
<dt>
<em></em>
<a id="#(FSM).current" >
<strong>FSM.current</strong>
</a>
@ -2637,7 +2638,7 @@ self</p>
<dt>
<a id="#(FSM_PROCESS).onstatechange" >
<strong>FSM_PROCESS:onstatechange(ProcessUnit, Event, From, To, Dummy)</strong>
<strong>FSM_PROCESS:onstatechange(ProcessUnit, Event, From, To, Task, Dummy)</strong>
</a>
</dt>
<dd>
@ -2668,6 +2669,11 @@ self</p>
</li>
<li>
<p><code><em> Task </em></code>: </p>
</li>
<li>
<p><code><em> Dummy </em></code>: </p>
</li>

View File

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

View File

@ -72,253 +72,39 @@
<div id="content">
<h1>Module <code>Set</code></h1>
<p><strong>Core</strong> - SET classes define <strong>collections</strong> of objects to perform <strong>bulk actions</strong> and logically <strong>group</strong> objects.</p>
<p><strong>Core</strong> - SET_ classes define <strong>collections</strong> of objects to perform <strong>bulk actions</strong> and logically <strong>group</strong> objects.</p>
<p><img src="..\Presentations\SET\Dia1.JPG" alt="Banner Image"/></p>
<hr/>
<h1>1) <a href="Set.html##(SET_BASE)">Set#SET_BASE</a> class, extends <a href="Base.html##(BASE)">Base#BASE</a></h1>
<p>The <a href="Set.html##(SET_BASE)">Set#SET_BASE</a> class defines the core functions that define a collection of objects.
A SET provides iterators to iterate the SET, but will <strong>temporarily</strong> yield the ForEach interator loop at defined <strong>"intervals"</strong> to the mail simulator loop.
In this way, large loops can be done while not blocking the simulator main processing loop.
The default <strong>"yield interval"</strong> is after 10 objects processed.
The default <strong>"time interval"</strong> is after 0.001 seconds.</p>
<h2>1.1) Add or remove objects from the SET</h2>
<p>Some key core functions are <a href="Set.html##(SET_BASE).Add">Set#SET_BASE.Add</a> and <a href="Set.html##(SET_BASE).Remove">Set#SET_BASE.Remove</a> to add or remove objects from the SET in your logic.</p>
<h2>1.2) Define the SET iterator <strong>"yield interval"</strong> and the <strong>"time interval"</strong></h2>
<p>Modify the iterator intervals with the <a href="Set.html##(SET_BASE).SetInteratorIntervals">Set#SET_BASE.SetInteratorIntervals</a> method.
You can set the <strong>"yield interval"</strong>, and the <strong>"time interval"</strong>. (See above).</p>
<hr/>
<h1>2) <a href="Set.html##(SET_GROUP)">Set#SET_GROUP</a> class, extends <a href="Set.html##(SET_BASE)">Set#SET_BASE</a></h1>
<p>Mission designers can use the <a href="Set.html##(SET_GROUP)">Set#SET_GROUP</a> class to build sets of groups belonging to certain:</p>
<p>SET_ classes group objects of the same type into a collection, which is either:</p>
<ul>
<li>Coalitions</li>
<li>Categories</li>
<li>Countries</li>
<li>Starting with certain prefix strings.</li>
<li>Manually managed using the <strong>:Add...()</strong> or <strong>:Remove...()</strong> methods. The initial SET can be filtered with the **<a href="##(SET_BASE).FilterOnce">SET_BASE.FilterOnce</a>()** method</li>
<li>Dynamically updated when new objects are created or objects are destroyed using the **<a href="##(SET_BASE).FilterStart">SET_BASE.FilterStart</a>()** method.</li>
</ul>
<h2>2.1) SET_GROUP construction method:</h2>
<p>Create a new SET_GROUP object with the <a href="##(SET_GROUP).New">SET_GROUP.New</a> method:</p>
<p>Various types of SET_ classes are available:</p>
<ul>
<li><a href="##(SET_GROUP).New">SET_GROUP.New</a>: Creates a new SET_GROUP object.</li>
<li><a href="##(SET_UNIT)">#SET_UNIT</a>: Defines a colleciton of <a href="Unit.html">Unit</a>s filtered by filter criteria.</li>
<li><a href="##(SET_GROUP)">#SET_GROUP</a>: Defines a collection of <a href="Group.html">Group</a>s filtered by filter criteria.</li>
<li><a href="##(SET_CLIENT)">#SET_CLIENT</a>: Defines a collection of <a href="Client.html">Client</a>s filterd by filter criteria.</li>
<li><a href="##(SET_AIRBASE)">#SET_AIRBASE</a>: Defines a collection of <a href="Airbase.html">Airbase</a>s filtered by filter criteria.</li>
</ul>
<h2>2.2) Add or Remove GROUP(s) from SET_GROUP: </h2>
<p>GROUPS can be added and removed using the <a href="Set.html##(SET_GROUP).AddGroupsByName">Set#SET_GROUP.AddGroupsByName</a> and <a href="Set.html##(SET_GROUP).RemoveGroupsByName">Set#SET_GROUP.RemoveGroupsByName</a> respectively.
These methods take a single GROUP name or an array of GROUP names to be added or removed from SET_GROUP.</p>
<p>These classes are derived from <a href="##(SET_BASE)">#SET_BASE</a>, which contains the main methods to manage SETs.</p>
<h2>2.3) SET_GROUP filter criteria: </h2>
<p>You can set filter criteria to define the set of groups within the SET_GROUP.
Filter criteria are defined by:</p>
<p>A multitude of other methods are available in SET_ classes that allow to:</p>
<ul>
<li><a href="##(SET_GROUP).FilterCoalitions">SET_GROUP.FilterCoalitions</a>: Builds the SET_GROUP with the groups belonging to the coalition(s).</li>
<li><a href="##(SET_GROUP).FilterCategories">SET_GROUP.FilterCategories</a>: Builds the SET_GROUP with the groups belonging to the category(ies).</li>
<li><a href="##(SET_GROUP).FilterCountries">SET_GROUP.FilterCountries</a>: Builds the SET_GROUP with the gruops belonging to the country(ies).</li>
<li><a href="##(SET_GROUP).FilterPrefixes">SET_GROUP.FilterPrefixes</a>: Builds the SET_GROUP with the groups starting with the same prefix string(s).</li>
<li>Validate the presence of objects in the SET.</li>
<li>Trigger events when objects in the SET change a zone presence.</li>
</ul>
<p>Once the filter criteria have been set for the SET_GROUP, you can start filtering using:</p>
<ul>
<li><a href="##(SET_GROUP).FilterStart">SET_GROUP.FilterStart</a>: Starts the filtering of the groups within the SET_GROUP and add or remove GROUP objects <strong>dynamically</strong>.</li>
</ul>
<p>Planned filter criteria within development are (so these are not yet available):</p>
<ul>
<li><a href="##(SET_GROUP).FilterZones">SET_GROUP.FilterZones</a>: Builds the SET_GROUP with the groups within a <a href="Zone.html##(ZONE)">Zone#ZONE</a>.</li>
</ul>
<h2>2.4) SET_GROUP iterators:</h2>
<p>Once the filters have been defined and the SET<em>GROUP has been built, you can iterate the SET</em>GROUP with the available iterator methods.
The iterator methods will walk the SET<em>GROUP set, and call for each element within the set a function that you provide.
The following iterator methods are currently available within the SET</em>GROUP:</p>
<ul>
<li><a href="##(SET_GROUP).ForEachGroup">SET_GROUP.ForEachGroup</a>: Calls a function for each alive group it finds within the SET_GROUP.</li>
<li><a href="##(SET_GROUP).ForEachGroupCompletelyInZone">SET_GROUP.ForEachGroupCompletelyInZone</a>: Iterate the SET_GROUP and call an iterator function for each <strong>alive</strong> GROUP presence completely in a <a href="Zone.html">Zone</a>, providing the GROUP and optional parameters to the called function.</li>
<li><a href="##(SET_GROUP).ForEachGroupPartlyInZone">SET_GROUP.ForEachGroupPartlyInZone</a>: Iterate the SET_GROUP and call an iterator function for each <strong>alive</strong> GROUP presence partly in a <a href="Zone.html">Zone</a>, providing the GROUP and optional parameters to the called function.</li>
<li><a href="##(SET_GROUP).ForEachGroupNotInZone">SET_GROUP.ForEachGroupNotInZone</a>: Iterate the SET_GROUP and call an iterator function for each <strong>alive</strong> GROUP presence not in a <a href="Zone.html">Zone</a>, providing the GROUP and optional parameters to the called function.</li>
</ul>
<hr/>
<h1>3) <a href="Set.html##(SET_UNIT)">Set#SET_UNIT</a> class, extends <a href="Set.html##(SET_BASE)">Set#SET_BASE</a></h1>
<p>Mission designers can use the <a href="Set.html##(SET_UNIT)">Set#SET_UNIT</a> class to build sets of units belonging to certain:</p>
<ul>
<li>Coalitions</li>
<li>Categories</li>
<li>Countries</li>
<li>Unit types</li>
<li>Starting with certain prefix strings.</li>
</ul>
<h2>3.1) SET_UNIT construction method:</h2>
<p>Create a new SET_UNIT object with the <a href="##(SET_UNIT).New">SET_UNIT.New</a> method:</p>
<ul>
<li><a href="##(SET_UNIT).New">SET_UNIT.New</a>: Creates a new SET_UNIT object.</li>
</ul>
<h2>3.2) Add or Remove UNIT(s) from SET_UNIT: </h2>
<p>UNITs can be added and removed using the <a href="Set.html##(SET_UNIT).AddUnitsByName">Set#SET_UNIT.AddUnitsByName</a> and <a href="Set.html##(SET_UNIT).RemoveUnitsByName">Set#SET_UNIT.RemoveUnitsByName</a> respectively.
These methods take a single UNIT name or an array of UNIT names to be added or removed from SET_UNIT.</p>
<h2>3.3) SET_UNIT filter criteria: </h2>
<p>You can set filter criteria to define the set of units within the SET_UNIT.
Filter criteria are defined by:</p>
<ul>
<li><a href="##(SET_UNIT).FilterCoalitions">SET_UNIT.FilterCoalitions</a>: Builds the SET_UNIT with the units belonging to the coalition(s).</li>
<li><a href="##(SET_UNIT).FilterCategories">SET_UNIT.FilterCategories</a>: Builds the SET_UNIT with the units belonging to the category(ies).</li>
<li><a href="##(SET_UNIT).FilterTypes">SET_UNIT.FilterTypes</a>: Builds the SET_UNIT with the units belonging to the unit type(s).</li>
<li><a href="##(SET_UNIT).FilterCountries">SET_UNIT.FilterCountries</a>: Builds the SET_UNIT with the units belonging to the country(ies).</li>
<li><a href="##(SET_UNIT).FilterPrefixes">SET_UNIT.FilterPrefixes</a>: Builds the SET_UNIT with the units starting with the same prefix string(s).</li>
</ul>
<p>Once the filter criteria have been set for the SET_UNIT, you can start filtering using:</p>
<ul>
<li><a href="##(SET_UNIT).FilterStart">SET_UNIT.FilterStart</a>: Starts the filtering of the units within the SET_UNIT.</li>
</ul>
<p>Planned filter criteria within development are (so these are not yet available):</p>
<ul>
<li><a href="##(SET_UNIT).FilterZones">SET_UNIT.FilterZones</a>: Builds the SET_UNIT with the units within a <a href="Zone.html##(ZONE)">Zone#ZONE</a>.</li>
</ul>
<h2>3.4) SET_UNIT iterators:</h2>
<p>Once the filters have been defined and the SET<em>UNIT has been built, you can iterate the SET</em>UNIT with the available iterator methods.
The iterator methods will walk the SET<em>UNIT set, and call for each element within the set a function that you provide.
The following iterator methods are currently available within the SET</em>UNIT:</p>
<ul>
<li><a href="##(SET_UNIT).ForEachUnit">SET_UNIT.ForEachUnit</a>: Calls a function for each alive unit it finds within the SET_UNIT.</li>
<li><a href="##(SET_GROUP).ForEachGroupCompletelyInZone">SET_GROUP.ForEachGroupCompletelyInZone</a>: Iterate the SET_GROUP and call an iterator function for each <strong>alive</strong> GROUP presence completely in a <a href="Zone.html">Zone</a>, providing the GROUP and optional parameters to the called function.</li>
<li><a href="##(SET_GROUP).ForEachGroupNotInZone">SET_GROUP.ForEachGroupNotInZone</a>: Iterate the SET_GROUP and call an iterator function for each <strong>alive</strong> GROUP presence not in a <a href="Zone.html">Zone</a>, providing the GROUP and optional parameters to the called function.</li>
</ul>
<p>Planned iterators methods in development are (so these are not yet available):</p>
<ul>
<li><a href="##(SET_UNIT).ForEachUnitInUnit">SET_UNIT.ForEachUnitInUnit</a>: Calls a function for each unit contained within the SET_UNIT.</li>
<li><a href="##(SET_UNIT).ForEachUnitCompletelyInZone">SET_UNIT.ForEachUnitCompletelyInZone</a>: Iterate and call an iterator function for each <strong>alive</strong> UNIT presence completely in a <a href="Zone.html">Zone</a>, providing the UNIT and optional parameters to the called function.</li>
<li><a href="##(SET_UNIT).ForEachUnitNotInZone">SET_UNIT.ForEachUnitNotInZone</a>: Iterate and call an iterator function for each <strong>alive</strong> UNIT presence not in a <a href="Zone.html">Zone</a>, providing the UNIT and optional parameters to the called function.</li>
</ul>
<hr/>
<h1>4) <a href="Set.html##(SET_CLIENT)">Set#SET_CLIENT</a> class, extends <a href="Set.html##(SET_BASE)">Set#SET_BASE</a></h1>
<p>Mission designers can use the <a href="Set.html##(SET_CLIENT)">Set#SET_CLIENT</a> class to build sets of units belonging to certain:</p>
<ul>
<li>Coalitions</li>
<li>Categories</li>
<li>Countries</li>
<li>Client types</li>
<li>Starting with certain prefix strings.</li>
</ul>
<h2>4.1) SET_CLIENT construction method:</h2>
<p>Create a new SET_CLIENT object with the <a href="##(SET_CLIENT).New">SET_CLIENT.New</a> method:</p>
<ul>
<li><a href="##(SET_CLIENT).New">SET_CLIENT.New</a>: Creates a new SET_CLIENT object.</li>
</ul>
<h2>4.2) Add or Remove CLIENT(s) from SET_CLIENT: </h2>
<p>CLIENTs can be added and removed using the <a href="Set.html##(SET_CLIENT).AddClientsByName">Set#SET_CLIENT.AddClientsByName</a> and <a href="Set.html##(SET_CLIENT).RemoveClientsByName">Set#SET_CLIENT.RemoveClientsByName</a> respectively.
These methods take a single CLIENT name or an array of CLIENT names to be added or removed from SET_CLIENT.</p>
<h2>4.3) SET_CLIENT filter criteria: </h2>
<p>You can set filter criteria to define the set of clients within the SET_CLIENT.
Filter criteria are defined by:</p>
<ul>
<li><a href="##(SET_CLIENT).FilterCoalitions">SET_CLIENT.FilterCoalitions</a>: Builds the SET_CLIENT with the clients belonging to the coalition(s).</li>
<li><a href="##(SET_CLIENT).FilterCategories">SET_CLIENT.FilterCategories</a>: Builds the SET_CLIENT with the clients belonging to the category(ies).</li>
<li><a href="##(SET_CLIENT).FilterTypes">SET_CLIENT.FilterTypes</a>: Builds the SET_CLIENT with the clients belonging to the client type(s).</li>
<li><a href="##(SET_CLIENT).FilterCountries">SET_CLIENT.FilterCountries</a>: Builds the SET_CLIENT with the clients belonging to the country(ies).</li>
<li><a href="##(SET_CLIENT).FilterPrefixes">SET_CLIENT.FilterPrefixes</a>: Builds the SET_CLIENT with the clients starting with the same prefix string(s).</li>
</ul>
<p>Once the filter criteria have been set for the SET_CLIENT, you can start filtering using:</p>
<ul>
<li><a href="##(SET_CLIENT).FilterStart">SET_CLIENT.FilterStart</a>: Starts the filtering of the clients within the SET_CLIENT.</li>
</ul>
<p>Planned filter criteria within development are (so these are not yet available):</p>
<ul>
<li><a href="##(SET_CLIENT).FilterZones">SET_CLIENT.FilterZones</a>: Builds the SET_CLIENT with the clients within a <a href="Zone.html##(ZONE)">Zone#ZONE</a>.</li>
</ul>
<h2>4.4) SET_CLIENT iterators:</h2>
<p>Once the filters have been defined and the SET<em>CLIENT has been built, you can iterate the SET</em>CLIENT with the available iterator methods.
The iterator methods will walk the SET<em>CLIENT set, and call for each element within the set a function that you provide.
The following iterator methods are currently available within the SET</em>CLIENT:</p>
<ul>
<li><a href="##(SET_CLIENT).ForEachClient">SET_CLIENT.ForEachClient</a>: Calls a function for each alive client it finds within the SET_CLIENT.</li>
</ul>
<hr/>
<h1>5) <a href="Set.html##(SET_AIRBASE)">Set#SET_AIRBASE</a> class, extends <a href="Set.html##(SET_BASE)">Set#SET_BASE</a></h1>
<p>Mission designers can use the <a href="Set.html##(SET_AIRBASE)">Set#SET_AIRBASE</a> class to build sets of airbases optionally belonging to certain:</p>
<ul>
<li>Coalitions</li>
</ul>
<h2>5.1) SET_AIRBASE construction</h2>
<p>Create a new SET_AIRBASE object with the <a href="##(SET_AIRBASE).New">SET_AIRBASE.New</a> method:</p>
<ul>
<li><a href="##(SET_AIRBASE).New">SET_AIRBASE.New</a>: Creates a new SET_AIRBASE object.</li>
</ul>
<h2>5.2) Add or Remove AIRBASEs from SET_AIRBASE </h2>
<p>AIRBASEs can be added and removed using the <a href="Set.html##(SET_AIRBASE).AddAirbasesByName">Set#SET_AIRBASE.AddAirbasesByName</a> and <a href="Set.html##(SET_AIRBASE).RemoveAirbasesByName">Set#SET_AIRBASE.RemoveAirbasesByName</a> respectively.
These methods take a single AIRBASE name or an array of AIRBASE names to be added or removed from SET_AIRBASE.</p>
<h2>5.3) SET_AIRBASE filter criteria </h2>
<p>You can set filter criteria to define the set of clients within the SET_AIRBASE.
Filter criteria are defined by:</p>
<ul>
<li><a href="##(SET_AIRBASE).FilterCoalitions">SET_AIRBASE.FilterCoalitions</a>: Builds the SET_AIRBASE with the airbases belonging to the coalition(s).</li>
</ul>
<p>Once the filter criteria have been set for the SET_AIRBASE, you can start filtering using:</p>
<ul>
<li><a href="##(SET_AIRBASE).FilterStart">SET_AIRBASE.FilterStart</a>: Starts the filtering of the airbases within the SET_AIRBASE.</li>
</ul>
<h2>5.4) SET_AIRBASE iterators:</h2>
<p>Once the filters have been defined and the SET<em>AIRBASE has been built, you can iterate the SET</em>AIRBASE with the available iterator methods.
The iterator methods will walk the SET<em>AIRBASE set, and call for each airbase within the set a function that you provide.
The following iterator methods are currently available within the SET</em>AIRBASE:</p>
<ul>
<li><a href="##(SET_AIRBASE).ForEachAirbase">SET_AIRBASE.ForEachAirbase</a>: Calls a function for each airbase it finds within the SET_AIRBASE.</li>
</ul>
<hr/>
<h3>Authors:</h3>
<ul>
@ -1026,6 +812,12 @@ The following iterator methods are currently available within the SET</em>AIRBAS
<td class="name" nowrap="nowrap"><a href="##(SET_UNIT).ForEachUnitNotInZone">SET_UNIT:ForEachUnitNotInZone(ZoneObject, IteratorFunction, ...)</a></td>
<td class="summary">
<p>Iterate the SET_UNIT and call an iterator function for each <strong>alive</strong> UNIT presence not in a <a href="Zone.html">Zone</a>, providing the UNIT and optional parameters to the called function.</p>
</td>
</tr>
<tr>
<td class="name" nowrap="nowrap"><a href="##(SET_UNIT).GetTypeNames">SET_UNIT:GetTypeNames(Delimiter)</a></td>
<td class="summary">
<p>Retrieve the type names of the <a href="Unit.html">Unit</a>s in the SET, delimited by an optional delimiter.</p>
</td>
</tr>
<tr>
@ -1171,7 +963,54 @@ The following iterator methods are currently available within the SET</em>AIRBAS
<h2><a id="#(SET_AIRBASE)" >Type <code>SET_AIRBASE</code></a></h2>
<p>SET_AIRBASE class</p>
<h1>5) SET_AIRBASE class, extends <a href="Set.html##(SET_BASE)">Set#SET_BASE</a></h1>
<p>Mission designers can use the <a href="Set.html##(SET_AIRBASE)">Set#SET_AIRBASE</a> class to build sets of airbases optionally belonging to certain:</p>
<ul>
<li>Coalitions</li>
</ul>
<h2>5.1) SET_AIRBASE constructor</h2>
<p>Create a new SET_AIRBASE object with the <a href="##(SET_AIRBASE).New">SET_AIRBASE.New</a> method:</p>
<ul>
<li><a href="##(SET_AIRBASE).New">SET_AIRBASE.New</a>: Creates a new SET_AIRBASE object.</li>
</ul>
<p> </p>
<h2>5.2) Add or Remove AIRBASEs from SET_AIRBASE</h2>
<p>AIRBASEs can be added and removed using the <a href="Set.html##(SET_AIRBASE).AddAirbasesByName">Set#SET_AIRBASE.AddAirbasesByName</a> and <a href="Set.html##(SET_AIRBASE).RemoveAirbasesByName">Set#SET_AIRBASE.RemoveAirbasesByName</a> respectively.
These methods take a single AIRBASE name or an array of AIRBASE names to be added or removed from SET_AIRBASE.</p>
<h2>5.3) SET_AIRBASE filter criteria</h2>
<p>You can set filter criteria to define the set of clients within the SET_AIRBASE.
Filter criteria are defined by:</p>
<ul>
<li><a href="##(SET_AIRBASE).FilterCoalitions">SET_AIRBASE.FilterCoalitions</a>: Builds the SET_AIRBASE with the airbases belonging to the coalition(s).</li>
</ul>
<p>Once the filter criteria have been set for the SET_AIRBASE, you can start filtering using:</p>
<ul>
<li><a href="##(SET_AIRBASE).FilterStart">SET_AIRBASE.FilterStart</a>: Starts the filtering of the airbases within the SET_AIRBASE.</li>
</ul>
<h2>5.4) SET_AIRBASE iterators</h2>
<p>Once the filters have been defined and the SET<em>AIRBASE has been built, you can iterate the SET</em>AIRBASE with the available iterator methods.
The iterator methods will walk the SET<em>AIRBASE set, and call for each airbase within the set a function that you provide.
The following iterator methods are currently available within the SET</em>AIRBASE:</p>
<ul>
<li><a href="##(SET_AIRBASE).ForEachAirbase">SET_AIRBASE.ForEachAirbase</a>: Calls a function for each airbase it finds within the SET_AIRBASE.</li>
</ul>
<h3>Field(s)</h3>
<dl class="function">
@ -1576,7 +1415,24 @@ A single name or an array of AIRBASE names.</p>
<h2><a id="#(SET_BASE)" >Type <code>SET_BASE</code></a></h2>
<p>SET_BASE class</p>
<h1>1) SET_BASE class, extends <a href="Base.html##(BASE)">Base#BASE</a></h1>
<p>The <a href="Set.html##(SET_BASE)">Set#SET_BASE</a> class defines the core functions that define a collection of objects.</p>
<p>A SET provides iterators to iterate the SET, but will <strong>temporarily</strong> yield the ForEach interator loop at defined <strong>"intervals"</strong> to the mail simulator loop.
In this way, large loops can be done while not blocking the simulator main processing loop.
The default <strong>"yield interval"</strong> is after 10 objects processed.
The default <strong>"time interval"</strong> is after 0.001 seconds.</p>
<h2>1.1) Add or remove objects from the SET</h2>
<p>Some key core functions are <a href="Set.html##(SET_BASE).Add">Set#SET_BASE.Add</a> and <a href="Set.html##(SET_BASE).Remove">Set#SET_BASE.Remove</a> to add or remove objects from the SET in your logic.</p>
<h2>1.2) Define the SET iterator <strong>"yield interval"</strong> and the <strong>"time interval"</strong></h2>
<p>Modify the iterator intervals with the <a href="Set.html##(SET_BASE).SetInteratorIntervals">Set#SET_BASE.SetInteratorIntervals</a> method.
You can set the <strong>"yield interval"</strong>, and the <strong>"time interval"</strong>. (See above).</p>
<h3>Field(s)</h3>
<dl class="function">
@ -2279,7 +2135,68 @@ The Object found.</p>
<h2><a id="#(SET_CLIENT)" >Type <code>SET_CLIENT</code></a></h2>
<p>SET_CLIENT class</p>
<h1>4) SET_CLIENT class, extends <a href="Set.html##(SET_BASE)">Set#SET_BASE</a></h1>
<p>Mission designers can use the <a href="Set.html##(SET_CLIENT)">Set#SET_CLIENT</a> class to build sets of units belonging to certain:</p>
<ul>
<li>Coalitions</li>
<li>Categories</li>
<li>Countries</li>
<li>Client types</li>
<li>Starting with certain prefix strings.</li>
</ul>
<p> </p>
<h2>4.1) SET_CLIENT constructor</h2>
<p>Create a new SET_CLIENT object with the <a href="##(SET_CLIENT).New">SET_CLIENT.New</a> method:</p>
<ul>
<li><a href="##(SET_CLIENT).New">SET_CLIENT.New</a>: Creates a new SET_CLIENT object.</li>
</ul>
<h2>4.2) Add or Remove CLIENT(s) from SET_CLIENT</h2>
<p>CLIENTs can be added and removed using the <a href="Set.html##(SET_CLIENT).AddClientsByName">Set#SET_CLIENT.AddClientsByName</a> and <a href="Set.html##(SET_CLIENT).RemoveClientsByName">Set#SET_CLIENT.RemoveClientsByName</a> respectively.
These methods take a single CLIENT name or an array of CLIENT names to be added or removed from SET_CLIENT.</p>
<h2>4.3) SET_CLIENT filter criteria</h2>
<p>You can set filter criteria to define the set of clients within the SET_CLIENT.
Filter criteria are defined by:</p>
<ul>
<li><a href="##(SET_CLIENT).FilterCoalitions">SET_CLIENT.FilterCoalitions</a>: Builds the SET_CLIENT with the clients belonging to the coalition(s).</li>
<li><a href="##(SET_CLIENT).FilterCategories">SET_CLIENT.FilterCategories</a>: Builds the SET_CLIENT with the clients belonging to the category(ies).</li>
<li><a href="##(SET_CLIENT).FilterTypes">SET_CLIENT.FilterTypes</a>: Builds the SET_CLIENT with the clients belonging to the client type(s).</li>
<li><a href="##(SET_CLIENT).FilterCountries">SET_CLIENT.FilterCountries</a>: Builds the SET_CLIENT with the clients belonging to the country(ies).</li>
<li><a href="##(SET_CLIENT).FilterPrefixes">SET_CLIENT.FilterPrefixes</a>: Builds the SET_CLIENT with the clients starting with the same prefix string(s).</li>
</ul>
<p>Once the filter criteria have been set for the SET_CLIENT, you can start filtering using:</p>
<ul>
<li><a href="##(SET_CLIENT).FilterStart">SET_CLIENT.FilterStart</a>: Starts the filtering of the clients within the SET_CLIENT.</li>
</ul>
<p>Planned filter criteria within development are (so these are not yet available):</p>
<ul>
<li><a href="##(SET_CLIENT).FilterZones">SET_CLIENT.FilterZones</a>: Builds the SET_CLIENT with the clients within a <a href="Zone.html##(ZONE)">Zone#ZONE</a>.</li>
</ul>
<h2>4.4) SET_CLIENT iterators</h2>
<p>Once the filters have been defined and the SET<em>CLIENT has been built, you can iterate the SET</em>CLIENT with the available iterator methods.
The iterator methods will walk the SET<em>CLIENT set, and call for each element within the set a function that you provide.
The following iterator methods are currently available within the SET</em>CLIENT:</p>
<ul>
<li><a href="##(SET_CLIENT).ForEachClient">SET_CLIENT.ForEachClient</a>: Calls a function for each alive client it finds within the SET_CLIENT.</li>
</ul>
<h3>Field(s)</h3>
<dl class="function">
@ -2823,7 +2740,69 @@ A single name or an array of CLIENT names.</p>
<h2><a id="#(SET_GROUP)" >Type <code>SET_GROUP</code></a></h2>
<p>SET_GROUP class</p>
<h1>2) SET_GROUP class, extends <a href="Set.html##(SET_BASE)">Set#SET_BASE</a></h1>
<p>Mission designers can use the <a href="Set.html##(SET_GROUP)">Set#SET_GROUP</a> class to build sets of groups belonging to certain:</p>
<ul>
<li>Coalitions</li>
<li>Categories</li>
<li>Countries</li>
<li>Starting with certain prefix strings.</li>
</ul>
<p> </p>
<h2>2.1) SET_GROUP constructor</h2>
<p>Create a new SET_GROUP object with the <a href="##(SET_GROUP).New">SET_GROUP.New</a> method:</p>
<ul>
<li><a href="##(SET_GROUP).New">SET_GROUP.New</a>: Creates a new SET_GROUP object.</li>
</ul>
<h2>2.2) Add or Remove GROUP(s) from SET_GROUP</h2>
<p>GROUPS can be added and removed using the <a href="Set.html##(SET_GROUP).AddGroupsByName">Set#SET_GROUP.AddGroupsByName</a> and <a href="Set.html##(SET_GROUP).RemoveGroupsByName">Set#SET_GROUP.RemoveGroupsByName</a> respectively.
These methods take a single GROUP name or an array of GROUP names to be added or removed from SET_GROUP.</p>
<h2>2.3) SET_GROUP filter criteria</h2>
<p>You can set filter criteria to define the set of groups within the SET_GROUP.
Filter criteria are defined by:</p>
<ul>
<li><a href="##(SET_GROUP).FilterCoalitions">SET_GROUP.FilterCoalitions</a>: Builds the SET_GROUP with the groups belonging to the coalition(s).</li>
<li><a href="##(SET_GROUP).FilterCategories">SET_GROUP.FilterCategories</a>: Builds the SET_GROUP with the groups belonging to the category(ies).</li>
<li><a href="##(SET_GROUP).FilterCountries">SET_GROUP.FilterCountries</a>: Builds the SET_GROUP with the gruops belonging to the country(ies).</li>
<li><a href="##(SET_GROUP).FilterPrefixes">SET_GROUP.FilterPrefixes</a>: Builds the SET_GROUP with the groups starting with the same prefix string(s).</li>
</ul>
<p>Once the filter criteria have been set for the SET_GROUP, you can start filtering using:</p>
<ul>
<li><a href="##(SET_GROUP).FilterStart">SET_GROUP.FilterStart</a>: Starts the filtering of the groups within the SET_GROUP and add or remove GROUP objects <strong>dynamically</strong>.</li>
</ul>
<p>Planned filter criteria within development are (so these are not yet available):</p>
<ul>
<li><a href="##(SET_GROUP).FilterZones">SET_GROUP.FilterZones</a>: Builds the SET_GROUP with the groups within a <a href="Zone.html##(ZONE)">Zone#ZONE</a>.</li>
</ul>
<h2>2.4) SET_GROUP iterators</h2>
<p>Once the filters have been defined and the SET<em>GROUP has been built, you can iterate the SET</em>GROUP with the available iterator methods.
The iterator methods will walk the SET<em>GROUP set, and call for each element within the set a function that you provide.
The following iterator methods are currently available within the SET</em>GROUP:</p>
<ul>
<li><a href="##(SET_GROUP).ForEachGroup">SET_GROUP.ForEachGroup</a>: Calls a function for each alive group it finds within the SET_GROUP.</li>
<li><a href="##(SET_GROUP).ForEachGroupCompletelyInZone">SET_GROUP.ForEachGroupCompletelyInZone</a>: Iterate the SET_GROUP and call an iterator function for each <strong>alive</strong> GROUP presence completely in a <a href="Zone.html">Zone</a>, providing the GROUP and optional parameters to the called function.</li>
<li><a href="##(SET_GROUP).ForEachGroupPartlyInZone">SET_GROUP.ForEachGroupPartlyInZone</a>: Iterate the SET_GROUP and call an iterator function for each <strong>alive</strong> GROUP presence partly in a <a href="Zone.html">Zone</a>, providing the GROUP and optional parameters to the called function.</li>
<li><a href="##(SET_GROUP).ForEachGroupNotInZone">SET_GROUP.ForEachGroupNotInZone</a>: Iterate the SET_GROUP and call an iterator function for each <strong>alive</strong> GROUP presence not in a <a href="Zone.html">Zone</a>, providing the GROUP and optional parameters to the called function.</li>
</ul>
<h3>Field(s)</h3>
<dl class="function">
@ -3361,7 +3340,87 @@ A single name or an array of GROUP names.</p>
<h2><a id="#(SET_UNIT)" >Type <code>SET_UNIT</code></a></h2>
<p>SET_UNIT class</p>
<h1>3) SET_UNIT class, extends <a href="Set.html##(SET_BASE)">Set#SET_BASE</a></h1>
<p>Mission designers can use the SET_UNIT class to build sets of units belonging to certain:</p>
<ul>
<li>Coalitions</li>
<li>Categories</li>
<li>Countries</li>
<li>Unit types</li>
<li>Starting with certain prefix strings.</li>
</ul>
<p> </p>
<h2>3.1) SET_UNIT constructor</h2>
<p>Create a new SET_UNIT object with the <a href="##(SET_UNIT).New">SET_UNIT.New</a> method:</p>
<ul>
<li><a href="##(SET_UNIT).New">SET_UNIT.New</a>: Creates a new SET_UNIT object.</li>
</ul>
<h2>3.2) Add or Remove UNIT(s) from SET_UNIT</h2>
<p>UNITs can be added and removed using the <a href="Set.html##(SET_UNIT).AddUnitsByName">Set#SET_UNIT.AddUnitsByName</a> and <a href="Set.html##(SET_UNIT).RemoveUnitsByName">Set#SET_UNIT.RemoveUnitsByName</a> respectively.
These methods take a single UNIT name or an array of UNIT names to be added or removed from SET_UNIT.</p>
<h2>3.3) SET_UNIT filter criteria</h2>
<p>You can set filter criteria to define the set of units within the SET_UNIT.
Filter criteria are defined by:</p>
<ul>
<li><a href="##(SET_UNIT).FilterCoalitions">SET_UNIT.FilterCoalitions</a>: Builds the SET_UNIT with the units belonging to the coalition(s).</li>
<li><a href="##(SET_UNIT).FilterCategories">SET_UNIT.FilterCategories</a>: Builds the SET_UNIT with the units belonging to the category(ies).</li>
<li><a href="##(SET_UNIT).FilterTypes">SET_UNIT.FilterTypes</a>: Builds the SET_UNIT with the units belonging to the unit type(s).</li>
<li><a href="##(SET_UNIT).FilterCountries">SET_UNIT.FilterCountries</a>: Builds the SET_UNIT with the units belonging to the country(ies).</li>
<li><a href="##(SET_UNIT).FilterPrefixes">SET_UNIT.FilterPrefixes</a>: Builds the SET_UNIT with the units starting with the same prefix string(s).</li>
</ul>
<p>Once the filter criteria have been set for the SET_UNIT, you can start filtering using:</p>
<ul>
<li><a href="##(SET_UNIT).FilterStart">SET_UNIT.FilterStart</a>: Starts the filtering of the units within the SET_UNIT.</li>
</ul>
<p>Planned filter criteria within development are (so these are not yet available):</p>
<ul>
<li><a href="##(SET_UNIT).FilterZones">SET_UNIT.FilterZones</a>: Builds the SET_UNIT with the units within a <a href="Zone.html##(ZONE)">Zone#ZONE</a>.</li>
</ul>
<h2>3.4) SET_UNIT iterators</h2>
<p>Once the filters have been defined and the SET<em>UNIT has been built, you can iterate the SET</em>UNIT with the available iterator methods.
The iterator methods will walk the SET<em>UNIT set, and call for each element within the set a function that you provide.
The following iterator methods are currently available within the SET</em>UNIT:</p>
<ul>
<li><a href="##(SET_UNIT).ForEachUnit">SET_UNIT.ForEachUnit</a>: Calls a function for each alive unit it finds within the SET_UNIT.</li>
<li><a href="##(SET_GROUP).ForEachGroupCompletelyInZone">SET_GROUP.ForEachGroupCompletelyInZone</a>: Iterate the SET_GROUP and call an iterator function for each <strong>alive</strong> GROUP presence completely in a <a href="Zone.html">Zone</a>, providing the GROUP and optional parameters to the called function.</li>
<li><a href="##(SET_GROUP).ForEachGroupNotInZone">SET_GROUP.ForEachGroupNotInZone</a>: Iterate the SET_GROUP and call an iterator function for each <strong>alive</strong> GROUP presence not in a <a href="Zone.html">Zone</a>, providing the GROUP and optional parameters to the called function.</li>
</ul>
<p>Planned iterators methods in development are (so these are not yet available):</p>
<ul>
<li><a href="##(SET_UNIT).ForEachUnitInUnit">SET_UNIT.ForEachUnitInUnit</a>: Calls a function for each unit contained within the SET_UNIT.</li>
<li><a href="##(SET_UNIT).ForEachUnitCompletelyInZone">SET_UNIT.ForEachUnitCompletelyInZone</a>: Iterate and call an iterator function for each <strong>alive</strong> UNIT presence completely in a <a href="Zone.html">Zone</a>, providing the UNIT and optional parameters to the called function.</li>
<li><a href="##(SET_UNIT).ForEachUnitNotInZone">SET_UNIT.ForEachUnitNotInZone</a>: Iterate and call an iterator function for each <strong>alive</strong> UNIT presence not in a <a href="Zone.html">Zone</a>, providing the UNIT and optional parameters to the called function.</li>
</ul>
<h2>3.5 ) SET_UNIT atomic methods</h2>
<p>Various methods exist for a SET<em>UNIT to perform actions or calculations and retrieve results from the SET</em>UNIT:</p>
<ul>
<li><a href="##(SET_UNIT).GetTypeNames">SET_UNIT.GetTypeNames</a>(): Retrieve the type names of the <a href="Unit.html">Unit</a>s in the SET, delimited by a comma.</li>
</ul>
<h3>Field(s)</h3>
<dl class="function">
@ -3904,6 +3963,33 @@ self</p>
<dl class="function">
<dt>
<a id="#(SET_UNIT).GetTypeNames" >
<strong>SET_UNIT:GetTypeNames(Delimiter)</strong>
</a>
</dt>
<dd>
<p>Retrieve the type names of the <a href="Unit.html">Unit</a>s in the SET, delimited by an optional delimiter.</p>
<h3>Parameter</h3>
<ul>
<li>
<p><code><em>#string Delimiter </em></code>:
(optional) The delimiter, which is default a comma.</p>
</li>
</ul>
<h3>Return value</h3>
<p><em>#string:</em>
The types of the <a href="Unit.html">Unit</a>s delimited.</p>
</dd>
</dl>
<dl class="function">
<dt>
<a id="#(SET_UNIT).GetUnitThreatLevels" >
<strong>SET_UNIT:GetUnitThreatLevels()</strong>
</a>

View File

@ -2326,6 +2326,9 @@ when nothing was spawned.</p>
<p> Overwrite unit names by default with group name.</p>
</dd>
</dl>
<dl class="function">
@ -2340,6 +2343,9 @@ when nothing was spawned.</p>
<p> By default, no InitLimit</p>
</dd>
</dl>
<dl class="function">
@ -2375,7 +2381,7 @@ when nothing was spawned.</p>
<dl class="function">
<dt>
<em></em>
<em>#number</em>
<a id="#(SPAWN).SpawnMaxGroups" >
<strong>SPAWN.SpawnMaxGroups</strong>
</a>
@ -2392,7 +2398,7 @@ when nothing was spawned.</p>
<dl class="function">
<dt>
<em></em>
<em>#number</em>
<a id="#(SPAWN).SpawnMaxUnitsAlive" >
<strong>SPAWN.SpawnMaxUnitsAlive</strong>
</a>
@ -2710,7 +2716,7 @@ Spawn_BE_KA50 = SPAWN:New( 'BE KA-50@RAMP-Ground Defense' ):Schedule( 600, 0.5 )
<dl class="function">
<dt>
<em></em>
<em>#boolean</em>
<a id="#(SPAWN).SpawnUnControlled" >
<strong>SPAWN.SpawnUnControlled</strong>
</a>

View File

@ -361,7 +361,7 @@ and creates a CSV file logging the scoring events and results for use at team or
<tr>
<td class="name" nowrap="nowrap"><a href="Set.html">Set</a></td>
<td class="summary">
<p><strong>Core</strong> - SET classes define <strong>collections</strong> of objects to perform <strong>bulk actions</strong> and logically <strong>group</strong> objects.</p>
<p><strong>Core</strong> - SET_ classes define <strong>collections</strong> of objects to perform <strong>bulk actions</strong> and logically <strong>group</strong> objects.</p>
</td>
</tr>
<tr>

Binary file not shown.

After

Width:  |  Height:  |  Size: 210 KiB