Module Detection

This module contains the DETECTION classes.

# 1) #DETECTION_BASE class, extends Fsm#FSM

The #DETECTION_BASE class defines the core functions to administer detected objects. The #DETECTION_BASE class will detect objects within the battle zone for a list of Groups detecting targets following (a) detection method(s).

## 1.1) DETECTION_BASE constructor

Construct a new DETECTION_BASE instance using the DETECTION_BASE.New() method.

## 1.2) DETECTION_BASE initialization

By default, detection will return detected objects with all the detection sensors available. However, you can ask how the objects were found with specific detection methods. If you use one of the below methods, the detection will work with the detection method specified. You can specify to apply multiple detection methods.

Use the following functions to report the objects it detected using the methods Visual, Optical, Radar, IRST, RWR, DLINK:

## 1.3) DETECTION_BASE derived classes group the detected units into a DetectedItems[] list

DETECTIONBASE derived classes build a list called DetectedItems[], which is essentially a first later of grouping of detected units. Each DetectedItem within the DetectedItems[] list contains a SETUNIT object that contains the detected units that belong to that group.

Derived classes will apply different methods to group the detected units. Examples are per area, per quadrant, per distance, per type. See further the derived DETECTION classes on which grouping methods are currently supported.

Various methods exist how to retrieve the grouped items from a DETECTION_BASE derived class:

  • The method Detection#DETECTION_BASE.GetDetectedItems() retrieves the DetectedItems[] list.
  • A DetectedItem from the DetectedItems[] list can be retrieved using the method Detection#DETECTION_BASE.GetDetectedItem( DetectedItemIndex ). Note that this method returns a DetectedItem element from the list, that contains a Set variable and further information about the DetectedItem that is set by the DETECTION_BASE derived classes, used to group the DetectedItem.
  • A DetectedSet from the DetectedItems[] list can be retrieved using the method Detection#DETECTION_BASE.GetDetectedSet( DetectedItemIndex ). This method retrieves the Set from a DetectedItem element from the DetectedItem list (DetectedItems[ DetectedItemIndex ].Set ).

## 1.4) Apply additional Filters to fine-tune the detected objects

By default, DCS World will return any object that is in LOS and within "visual reach", or detectable through one of the electronic detection means. That being said, the DCS World detection algorithm can sometimes be unrealistic. Especially for a visual detection, DCS World is able to report within 1 second a detailed detection of a group of 20 units (including types of the units) that are 10 kilometers away, using only visual capabilities. Additionally, trees and other obstacles are not accounted during the DCS World detection.

Therefore, an additional (optional) filtering has been built into the DETECTION_BASE class, that can be set for visual detected units. For electronic detection, this filtering is not applied, only for visually detected targets.

The following additional filtering can be applied for visual filtering:

  • A probability factor per kilometer distance.
  • A probability factor based on the alpha angle between the detected object and the unit detecting. A detection from a higher altitude allows for better detection than when on the ground.
  • Define a probability factor for "cloudy zones", which are zones where forests or villages are located. In these zones, detection will be much more difficult. The mission designer needs to define these cloudy zones within the mission, and needs to register these zones in the DETECTION_ objects additing a probability factor per zone.

I advise however, that, when you first use the DETECTION derived classes, that you don't use these filters. Only when you experience unrealistic behaviour in your missions, these filters could be applied.

### 1.4.1 ) Distance visual detection probability

Upon a visual detection, the further away a detected object is, the less likely it is to be detected properly. Also, the speed of accurate detection plays a role.

A distance probability factor between 0 and 1 can be given, that will model a linear extrapolated probability over 10 km distance.

For example, if a probability factor of 0.6 (60%) is given, the extrapolated probabilities over 15 kilometers would like like: 1 km: 96%, 2 km: 92%, 3 km: 88%, 4 km: 84%, 5 km: 80%, 6 km: 76%, 7 km: 72%, 8 km: 68%, 9 km: 64%, 10 km: 60%, 11 km: 56%, 12 km: 52%, 13 km: 48%, 14 km: 44%, 15 km: 40%.

Note that based on this probability factor, not only the detection but also the type of the unit will be applied!

Use the method Detection#DETECTION_BASE.SetDistanceProbability() to set the probability factor upon a 10 km distance.

### 1.4.2 ) Alpha Angle visual detection probability

Upon a visual detection, the higher the unit is during the detecting process, the more likely the detected unit is to be detected properly. A detection at a 90% alpha angle is the most optimal, a detection at 10% is less and a detection at 0% is less likely to be correct.

A probability factor between 0 and 1 can be given, that will model a progressive extrapolated probability if the target would be detected at a 0° angle.

For example, if a alpha angle probability factor of 0.7 is given, the extrapolated probabilities of the different angles would look like: 0°: 70%, 10°: 75,21%, 20°: 80,26%, 30°: 85%, 40°: 89,28%, 50°: 92,98%, 60°: 95,98%, 70°: 98,19%, 80°: 99,54%, 90°: 100%

Use the method Detection#DETECTION_BASE.SetAlphaAngleProbability() to set the probability factor if 0°.

### 1.4.3 ) Cloudy Zones detection probability

Upon a visual detection, the more a detected unit is within a cloudy zone, the less likely the detected unit is to be detected successfully. The Cloudy Zones work with the ZONE_BASE derived classes. The mission designer can define within the mission zones that reflect cloudy areas where detected units may not be so easily visually detected.

Use the method Detection#DETECTION_BASE.SetZoneProbability() to set for a defined number of zones, the probability factors.

Note however, that the more zones are defined to be "cloudy" within a detection, the more performance it will take from the DETECTIONBASE to calculate the presence of the detected unit within each zone. Expecially for ZONEPOLYGON, try to limit the amount of nodes of the polygon!

Typically, this kind of filter would be applied for very specific areas were a detection needs to be very realisting for AI not to detect so easily targets within a forrest or village rich area.

## 1.5 ) Accept / Reject detected units

DETECTION_BASE can accept or reject successful detections based on the location of the detected object, if it is located in range or located inside or outside of specific zones.

### 1.5.1 ) Detection acceptance of within range limit

A range can be set that will limit a successful detection for a unit. Use the method Detection#DETECTION_BASE.SetAcceptRange() to apply a range in meters till where detected units will be accepted.

  local SetGroup = SET_GROUP:New():FilterPrefixes( "FAC" ):FilterStart() -- Build a SetGroup of Forward Air Controllers.

  -- Build a detect object.
  local Detection = DETECTION_BASE:New( SetGroup )

  -- This will accept detected units if the range is below 5000 meters.
  Detection:SetAcceptRange( 5000 ) 

  -- Start the Detection.
  Detection:Start()

### 1.5.2 ) Detection acceptance if within zone(s).

Specific ZONEBASE object(s) can be given as a parameter, which will only accept a detection if the unit is within the specified ZONEBASE object(s). Use the method Detection#DETECTION_BASE.SetAcceptZones() will accept detected units if they are within the specified zones.

  local SetGroup = SET_GROUP:New():FilterPrefixes( "FAC" ):FilterStart() -- Build a SetGroup of Forward Air Controllers.

  -- Search fo the zones where units are to be accepted.
  local ZoneAccept1 = ZONE:New( "AcceptZone1" )
  local ZoneAccept2 = ZONE:New( "AcceptZone2" )

  -- Build a detect object.
  local Detection = DETECTION_BASE:New( SetGroup )

  -- This will accept detected units by Detection when the unit is within ZoneAccept1 OR ZoneAccept2.
  Detection:SetAcceptZones( { ZoneAccept1, ZoneAccept2 } ) 

  -- Start the Detection.
  Detection:Start()

### 1.5.3 ) Detection rejectance if within zone(s).

Specific ZONEBASE object(s) can be given as a parameter, which will reject detection if the unit is within the specified ZONEBASE object(s). Use the method Detection#DETECTION_BASE.SetRejectZones() will reject detected units if they are within the specified zones. An example of how to use the method is shown below.

  local SetGroup = SET_GROUP:New():FilterPrefixes( "FAC" ):FilterStart() -- Build a SetGroup of Forward Air Controllers.

  -- Search fo the zones where units are to be rejected.
  local ZoneReject1 = ZONE:New( "RejectZone1" )
  local ZoneReject2 = ZONE:New( "RejectZone2" )

  -- Build a detect object.
  local Detection = DETECTION_BASE:New( SetGroup )

  -- This will reject detected units by Detection when the unit is within ZoneReject1 OR ZoneReject2.
  Detection:SetRejectZones( { ZoneReject1, ZoneReject2 } ) 

  -- Start the Detection.
  Detection:Start()

## 1.6) DETECTION_BASE is a Finite State Machine

Various Events and State Transitions can be tailored using DETECTION_BASE.

### 1.6.1) DETECTION_BASE States

  • Detecting: The detection is running.
  • Stopped: The detection is stopped.

### 1.6.2) DETECTION_BASE Events

  • Start: Start the detection process.
  • Detect: Detect new units.
  • Detected: New units have been detected.
  • Stop: Stop the detection process.

# 2) Detection#DETECTION_UNITS class, extends Detection#DETECTION_BASE

The Detection#DETECTION_UNITS class will detect units within the battle zone. It will build a DetectedItems list filled with DetectedItems. Each DetectedItem will contain a field Set, which contains a Set#SET_UNIT containing ONE UNIT object reference. Beware that when the amount of units detected is large, the DetectedItems list will be large also.

# 3) Detection#DETECTION_TYPES class, extends Detection#DETECTION_BASE

The Detection#DETECTION_TYPES class will detect units within the battle zone. It will build a DetectedItems[] list filled with DetectedItems, grouped by the type of units detected. Each DetectedItem will contain a field Set, which contains a Set#SET_UNIT containing ONE UNIT object reference. Beware that when the amount of different types detected is large, the DetectedItems[] list will be large also.

# 4) Detection#DETECTION_AREAS class, extends Detection#DETECTION_BASE

The Detection#DETECTION_AREAS class will detect units within the battle zone for a list of Groups detecting targets following (a) detection method(s), and will build a list (table) of Set#SET_UNITs containing the Unit#UNITs detected. The class is group the detected units within zones given a DetectedZoneRange parameter. A set with multiple detected zones will be created as there are groups of units detected.

## 4.1) Retrieve the Detected Unit Sets and Detected Zones

The methods to manage the DetectedItems[].Set(s) are implemented in Detection#DECTECTION_BASE and the methods to manage the DetectedItems[].Zone(s) is implemented in Detection#DETECTION_AREAS.

Retrieve the DetectedItems[].Set with the method Detection#DETECTION_BASE.GetDetectedSet(). A Set#SET_UNIT object will be returned.

Retrieve the formed Zones as a result of the grouping the detected units within the DetectionZoneRange, use the method Detection#DETECTION_BASE.GetDetectionZones(). To understand the amount of zones created, use the method Detection#DETECTION_BASE.GetDetectionZoneCount(). If you want to obtain a specific zone from the DetectedZones, use the method Detection#DETECTION_BASE.GetDetectionZone() with a given index.

## 4.4) Flare or Smoke detected units

Use the methods Detection#DETECTION_AREAS.FlareDetectedUnits() or Detection#DETECTION_AREAS.SmokeDetectedUnits() to flare or smoke the detected units when a new detection has taken place.

## 4.5) Flare or Smoke or Bound detected zones

Use the methods:

the detected zones when a new detection has taken place.


### Contributions:

  • Mechanist : Early concept of DETECTION_AREAS.

### Authors:

  • FlightControl : Analysis, Design, Programming, Testing

Global(s)

DETECTION_AREAS
DETECTION_BASE
DETECTION_TYPES
DETECTION_UNITS

Type DETECTION_AREAS

DETECTION_AREAS:BoundDetectedZones()

Bound the detected zones

DETECTION_AREAS:CalculateThreatLevelA2G(DetectedItem)

Calculate the maxium A2G threat level of the DetectedItem.

DETECTION_AREAS.ClassName
DETECTION_AREAS:CreateDetectionSets()

Make a DetectionSet table.

DETECTION_AREAS:DetectedItemReportSummary(Index)

Report summary of a detected item using a given numeric index.

DETECTION_AREAS.DetectedItems

A list of areas containing the set of Units, Zones, the center Unit within the zone, and ID of each area that was detected within a DetectionZoneRange.

DETECTION_AREAS.DetectionZoneRange

The range till which targets are grouped upon the first detected target.

DETECTION_AREAS:FlareDetectedUnits()

Flare the detected units

DETECTION_AREAS:FlareDetectedZones()

Flare the detected zones

DETECTION_AREAS:GetChangeText(DetectedItem)

Make text documenting the changes of the detected zone.

DETECTION_AREAS:GetTreatLevelA2G(DetectedItem)

Returns the A2G threat level of the units in the DetectedItem

DETECTION_AREAS:IsFriendliesNearBy(DetectedItem)

Returns if there are friendlies nearby the FAC units ...

DETECTION_AREAS:NearestFAC(DetectedItem)

Find the nearest FAC of the DetectedItem.

DETECTION_AREAS:New(DetectionSetGroup, DetectionZoneRange)

DETECTION_AREAS constructor.

DETECTION_AREAS:SmokeDetectedUnits()

Smoke the detected units

DETECTION_AREAS:SmokeDetectedZones()

Smoke the detected zones

DETECTION_AREAS._BoundDetectedZones
DETECTION_AREAS._FlareDetectedUnits
DETECTION_AREAS._FlareDetectedZones
DETECTION_AREAS._SmokeDetectedUnits
DETECTION_AREAS._SmokeDetectedZones

Type DETECTION_BASE

DETECTION_BASE:AcceptChanges(DetectedItem)

Accepts changes from the detected item.

DETECTION_BASE.AcceptRange
DETECTION_BASE.AcceptZones
DETECTION_BASE:AddChangeItem(DetectedItem, ChangeCode, ItemUnitType)

Add a change to the detected zone.

DETECTION_BASE:AddChangeUnit(DetectedItem, ChangeCode, ChangeUnitType)

Add a change to the detected zone.

DETECTION_BASE:AddDetectedItem(DetectedItemIndex, Set)

Adds a new DetectedItem to the DetectedItems list.

DETECTION_BASE:AddDetectedItemZone(DetectedItemIndex, Set, Zone)

Adds a new DetectedItem to the DetectedItems list.

DETECTION_BASE.AlphaAngleProbability
DETECTION_BASE.ClassName
DETECTION_BASE.CountryID
DETECTION_BASE:CreateDetectionSets()

Make a DetectionSet table.

DETECTION_BASE:Detect()

Synchronous Event Trigger for Event Detect.

DETECTION_BASE.DetectDLINK
DETECTION_BASE.DetectIRST
DETECTION_BASE.DetectOptical
DETECTION_BASE.DetectRWR
DETECTION_BASE.DetectRadar
DETECTION_BASE.DetectVisual
DETECTION_BASE:Detected()

Synchronous Event Trigger for Event Detected.

DETECTION_BASE.DetectedItemCount
DETECTION_BASE.DetectedItemMax
DETECTION_BASE:DetectedItemReportSummary(Index)

Report summary of a detected item using a given numeric index.

DETECTION_BASE.DetectedItems
DETECTION_BASE.DetectedObjects

The list of detected objects.

DETECTION_BASE.DetectedObjectsIdentified

Map of the DetectedObjects identified.

DETECTION_BASE:DetectedReportDetailed()

Report detailed of a detectedion result.

DETECTION_BASE.DetectionCount
DETECTION_BASE.DetectionInterval
DETECTION_BASE.DetectionRange

The range till which targets are accepted to be detected.

DETECTION_BASE.DetectionRun
DETECTION_BASE.DetectionScheduler
DETECTION_BASE.DetectionSetGroup

The Set of GROUPs in the Forward Air Controller role.

DETECTION_BASE.DistanceProbability
DETECTION_BASE:GetDetectedItem(Index)

Get a detected item using a given numeric index.

DETECTION_BASE:GetDetectedItems()

Get the detected Set#SET_BASEs.

DETECTION_BASE:GetDetectedItemsCount()

Get the amount of SETs with detected objects.

DETECTION_BASE:GetDetectedObject(ObjectName)

Gets a detected object with a given name.

DETECTION_BASE:GetDetectedSet(Index)

Get the Set#SET_UNIT of a detecttion area using a given numeric index.

DETECTION_BASE:GetDetectedZone(Index)

Get the Zone#ZONE_UNIT of a detection area using a given numeric index.

DETECTION_BASE:GetDetectionSetGroup()

Get the detection Groups.

DETECTION_BASE:IdentifyDetectedObject(DetectedObject)

Identifies a detected object during detection processing.

DETECTION_BASE:InitDetectDLINK(DetectDLINK)

Detect DLINK.

DETECTION_BASE:InitDetectIRST(DetectIRST)

Detect IRST.

DETECTION_BASE:InitDetectOptical(DetectOptical)

Detect Optical.

DETECTION_BASE:InitDetectRWR(DetectRWR)

Detect RWR.

DETECTION_BASE:InitDetectRadar(DetectRadar)

Detect Radar.

DETECTION_BASE:InitDetectVisual(DetectVisual)

Detect Visual.

DETECTION_BASE:IsDetectedObjectIdentified(DetectedObject)

Determines if a detected object has already been identified during detection processing.

DETECTION_BASE:IsFriendliesNearBy(DetectedItem)

Returns if there are friendlies nearby the FAC units ...

DETECTION_BASE:New(DetectionSetGroup)

DETECTION constructor.

DETECTION_BASE:OnAfterDetect(From, Event, To)

OnAfter Transition Handler for Event Detect.

DETECTION_BASE:OnAfterDetected(From, Event, To)

OnAfter Transition Handler for Event Detected.

DETECTION_BASE:OnAfterStart(From, Event, To)

OnAfter Transition Handler for Event Start.

DETECTION_BASE:OnAfterStop(From, Event, To)

OnAfter Transition Handler for Event Stop.

DETECTION_BASE:OnBeforeDetect(From, Event, To)

OnBefore Transition Handler for Event Detect.

DETECTION_BASE:OnBeforeDetected(From, Event, To)

OnBefore Transition Handler for Event Detected.

DETECTION_BASE:OnBeforeStart(From, Event, To)

OnBefore Transition Handler for Event Start.

DETECTION_BASE:OnBeforeStop(From, Event, To)

OnBefore Transition Handler for Event Stop.

DETECTION_BASE:OnEnterDetecting(From, Event, To)

OnEnter Transition Handler for State Detecting.

DETECTION_BASE:OnEnterStopped(From, Event, To)

OnEnter Transition Handler for State Stopped.

DETECTION_BASE:OnLeaveDetecting(From, Event, To)

OnLeave Transition Handler for State Detecting.

DETECTION_BASE:OnLeaveStopped(From, Event, To)

OnLeave Transition Handler for State Stopped.

DETECTION_BASE.RejectZones
DETECTION_BASE:RemoveDetectedItem(DetectedItemIndex)

Removes an existing DetectedItem from the DetectedItems list.

DETECTION_BASE:ReportFriendliesNearBy(ReportGroupData)

Background worker function to determine if there are friendlies nearby ...

DETECTION_BASE:Schedule(DelayTime, RepeatInterval)

Schedule the DETECTION construction.

DETECTION_BASE.ScheduleDelayTime
DETECTION_BASE.ScheduleRepeatInterval
DETECTION_BASE:SetAcceptRange(AcceptRange)

Accept detections if within a range in meters.

DETECTION_BASE:SetAcceptZones(AcceptZones)

Accept detections if within the specified zone(s).

DETECTION_BASE:SetAlphaAngleProbability(AlphaAngleProbability)

Upon a visual detection, the higher the unit is during the detecting process, the more likely the detected unit is to be detected properly.

DETECTION_BASE:SetDetectionInterval(DetectionInterval)

Set the detection interval time in seconds.

DETECTION_BASE:SetDistanceProbability(DistanceProbability)

Upon a visual detection, the further away a detected object is, the less likely it is to be detected properly.

DETECTION_BASE:SetRejectZones(RejectZones)

Reject detections if within the specified zone(s).

DETECTION_BASE:SetZoneProbability(ZoneArray)

Upon a visual detection, the more a detected unit is within a cloudy zone, the less likely the detected unit is to be detected successfully.

DETECTION_BASE:Start()

Synchronous Event Trigger for Event Start.

DETECTION_BASE:Stop()

Synchronous Event Trigger for Event Stop.

DETECTION_BASE:UnIdentifyAllDetectedObjects()

UnIdentify all detected objects during detection processing.

DETECTION_BASE:UnIdentifyDetectedObject(DetectedObject)

UnIdentify a detected object during detection processing.

DETECTION_BASE.ZoneProbability
DETECTION_BASE:__Detect(Delay)

Asynchronous Event Trigger for Event Detect.

DETECTION_BASE:__Detected(Delay)

Asynchronous Event Trigger for Event Detected.

DETECTION_BASE:__Start(Delay)

Asynchronous Event Trigger for Event Start.

DETECTION_BASE:__Stop(Delay)

Asynchronous Event Trigger for Event Stop.

DETECTION_BASE:onafterDetect(From, Event, To)
DETECTION_BASE:onafterDetectionGroup(From, Event, To, DetectionGroup)
DETECTION_BASE:onafterStart(From, Event, To)

Type DETECTION_BASE.DetectedItem

DETECTION_BASE.DetectedItem.Changed

Documents if the detected area has changes.

DETECTION_BASE.DetectedItem.Changes

A list of the changes reported on the detected area. (It is up to the user of the detected area to consume those changes).

DETECTION_BASE.DetectedItem.FriendliesNearBy

Indicates if there are friendlies within the detected area.

DETECTION_BASE.DetectedItem.ItemID

-- The identifier of the detected area.

DETECTION_BASE.DetectedItem.MaxThreatLevelA2G
DETECTION_BASE.DetectedItem.NearestFAC

The nearest FAC near the Area.

DETECTION_BASE.DetectedItem.Set

-- The Set of Units in the detected area.

DETECTION_BASE.DetectedItem.Zone

-- The Zone of the detected area.

Type DETECTION_BASE.DetectedObject

DETECTION_BASE.DetectedObject.Distance
DETECTION_BASE.DetectedObject.Identified
DETECTION_BASE.DetectedObject.Name
DETECTION_BASE.DetectedObject.Type
DETECTION_BASE.DetectedObject.Visible

Type DETECTION_TYPES

DETECTION_TYPES.ClassName
DETECTION_TYPES:CreateDetectionSets()

Create the DetectedItems list from the DetectedObjects table.

DETECTION_TYPES:DetectedItemReportSummary(Index, DetectedTypeName)

Report summary of a DetectedItem using a given numeric index.

DETECTION_TYPES:DetectedReportDetailed()

Report detailed of a detection result.

DETECTION_TYPES.DetectionRange
DETECTION_TYPES:GetChangeText(DetectedItem)

Make text documenting the changes of the detected zone.

DETECTION_TYPES:New(DetectionSetGroup)

DETECTION_TYPES constructor.

DETECTION_TYPES._BoundDetectedZones
DETECTION_TYPES._FlareDetectedUnits
DETECTION_TYPES._FlareDetectedZones
DETECTION_TYPES._SmokeDetectedUnits
DETECTION_TYPES._SmokeDetectedZones

Type DETECTION_UNITS

DETECTION_UNITS.ClassName
DETECTION_UNITS:CreateDetectionSets()

Create the DetectedItems list from the DetectedObjects table.

DETECTION_UNITS:DetectedItemReportSummary(Index)

Report summary of a DetectedItem using a given numeric index.

DETECTION_UNITS:DetectedReportDetailed()

Report detailed of a detection result.

DETECTION_UNITS.DetectionRange

The range till which targets are detected.

DETECTION_UNITS:GetChangeText(DetectedItem)

Make text documenting the changes of the detected zone.

DETECTION_UNITS:New(DetectionSetGroup)

DETECTION_UNITS constructor.

DETECTION_UNITS._BoundDetectedZones
DETECTION_UNITS._FlareDetectedUnits
DETECTION_UNITS._FlareDetectedZones
DETECTION_UNITS._SmokeDetectedUnits
DETECTION_UNITS._SmokeDetectedZones

Global(s)

#DETECTION_AREAS DETECTION_AREAS
#DETECTION_BASE DETECTION_BASE
#DETECTION_TYPES DETECTION_TYPES
#DETECTION_UNITS DETECTION_UNITS

Type Detection

Type DETECTION_AREAS

DETECTION_AREAS class

Field(s)

DETECTION_AREAS:BoundDetectedZones()

Bound the detected zones

Return value

#DETECTION_AREAS: self

DETECTION_AREAS:CalculateThreatLevelA2G(DetectedItem)

Calculate the maxium A2G threat level of the DetectedItem.

Parameter

#string DETECTION_AREAS.ClassName
DETECTION_AREAS:CreateDetectionSets()

Make a DetectionSet table.

This function will be overridden in the derived clsses.

Return value

#DETECTION_AREAS: self

DETECTION_AREAS:DetectedItemReportSummary(Index)

Report summary of a detected item using a given numeric index.

Parameter

  • Index :

Return value

#string:

#DETECTION_BASE.DetectedItems DETECTION_AREAS.DetectedItems

A list of areas containing the set of Units, Zones, the center Unit within the zone, and ID of each area that was detected within a DetectionZoneRange.

Dcs.DCSTypes#Distance DETECTION_AREAS.DetectionZoneRange

The range till which targets are grouped upon the first detected target.

DETECTION_AREAS:FlareDetectedUnits()

Flare the detected units

Return value

#DETECTION_AREAS: self

DETECTION_AREAS:FlareDetectedZones()

Flare the detected zones

Return value

#DETECTION_AREAS: self

DETECTION_AREAS:GetChangeText(DetectedItem)

Make text documenting the changes of the detected zone.

Parameter

Return value

#string: The Changes text

DETECTION_AREAS:GetTreatLevelA2G(DetectedItem)

Returns the A2G threat level of the units in the DetectedItem

Parameter

Return value

#number: a scale from 0 to 10.

DETECTION_AREAS:IsFriendliesNearBy(DetectedItem)

Returns if there are friendlies nearby the FAC units ...

Parameter

  • DetectedItem :

Return value

#boolean: trhe if there are friendlies nearby

DETECTION_AREAS:NearestFAC(DetectedItem)

Find the nearest FAC of the DetectedItem.

Parameter

Return value

Wrapper.Unit#UNIT: The nearest FAC unit

DETECTION_AREAS:New(DetectionSetGroup, DetectionZoneRange)

DETECTION_AREAS constructor.

Parameters

  • Core.Set#SET_GROUP DetectionSetGroup : The Set of GROUPs in the Forward Air Controller role.

  • Dcs.DCSTypes#Distance DetectionZoneRange : The range till which targets are grouped upon the first detected target.

Return value

#DETECTION_AREAS:

DETECTION_AREAS:SmokeDetectedUnits()

Smoke the detected units

Return value

#DETECTION_AREAS: self

DETECTION_AREAS:SmokeDetectedZones()

Smoke the detected zones

Return value

#DETECTION_AREAS: self

#boolean DETECTION_AREAS._BoundDetectedZones
#boolean DETECTION_AREAS._FlareDetectedUnits
#boolean DETECTION_AREAS._FlareDetectedZones
#boolean DETECTION_AREAS._SmokeDetectedUnits
#boolean DETECTION_AREAS._SmokeDetectedZones

Type DETECTION_BASE

DETECTION_BASE class

Field(s)

DETECTION_BASE:AcceptChanges(DetectedItem)

Accepts changes from the detected item.

Parameter

Return value

#DETECTION_BASE: self

DETECTION_BASE.AcceptRange
DETECTION_BASE.AcceptZones
DETECTION_BASE:AddChangeItem(DetectedItem, ChangeCode, ItemUnitType)

Add a change to the detected zone.

Parameters

Return value

#DETECTION_BASE: self

DETECTION_BASE:AddChangeUnit(DetectedItem, ChangeCode, ChangeUnitType)

Add a change to the detected zone.

Parameters

Return value

#DETECTION_BASE: self

DETECTION_BASE:AddDetectedItem(DetectedItemIndex, Set)

Adds a new DetectedItem to the DetectedItems list.

The DetectedItem is a table and contains a SET_UNIT in the field Set.

Parameters

  • #string DetectedItemIndex : The index of the DetectedItem.

  • Core.Set#SET_UNIT Set : (optional) The Set of Units to be added.

Return value

#DETECTION_BASE.DetectedItem:

DETECTION_BASE:AddDetectedItemZone(DetectedItemIndex, Set, Zone)

Adds a new DetectedItem to the DetectedItems list.

The DetectedItem is a table and contains a SET_UNIT in the field Set.

Parameters

  • #string DetectedItemIndex : The index of the DetectedItem.

  • Core.Set#SET_UNIT Set : (optional) The Set of Units to be added.

  • Core.Zone#ZONE_UNIT Zone : (optional) The Zone to be added where the Units are located.

Return value

#DETECTION_BASE.DetectedItem:

DETECTION_BASE.AlphaAngleProbability
#string DETECTION_BASE.ClassName
DETECTION_BASE.CountryID
DETECTION_BASE:CreateDetectionSets()

Make a DetectionSet table.

This function will be overridden in the derived clsses.

Return value

#DETECTION_BASE: self

DETECTION_BASE:Detect()

Synchronous Event Trigger for Event Detect.

DETECTION_BASE.DetectDLINK
DETECTION_BASE.DetectIRST
DETECTION_BASE.DetectOptical
DETECTION_BASE.DetectRWR
DETECTION_BASE.DetectRadar
DETECTION_BASE.DetectVisual
DETECTION_BASE:Detected()

Synchronous Event Trigger for Event Detected.

DETECTION_BASE.DetectedItemCount
DETECTION_BASE.DetectedItemMax
DETECTION_BASE:DetectedItemReportSummary(Index)

Report summary of a detected item using a given numeric index.

Parameter

  • Index :

Return value

#string:

DETECTION_BASE.DetectedItems
#DETECTION_BASE.DetectedObjects DETECTION_BASE.DetectedObjects

The list of detected objects.

#table DETECTION_BASE.DetectedObjectsIdentified

Map of the DetectedObjects identified.

DETECTION_BASE:DetectedReportDetailed()

Report detailed of a detectedion result.

Return value

#string:

#number DETECTION_BASE.DetectionCount
DETECTION_BASE.DetectionInterval
Dcs.DCSTypes#Distance DETECTION_BASE.DetectionRange

The range till which targets are accepted to be detected.

#number DETECTION_BASE.DetectionRun
DETECTION_BASE.DetectionScheduler
Core.Set#SET_GROUP DETECTION_BASE.DetectionSetGroup

The Set of GROUPs in the Forward Air Controller role.

DETECTION_BASE.DistanceProbability
DETECTION_BASE:GetDetectedItem(Index)

Get a detected item using a given numeric index.

Parameter

  • #number Index :

Return value

DETECTION_BASE.DetectedItem

DETECTION_BASE:GetDetectedItems()

Get the detected Set#SET_BASEs.

Return value

#DETECTION_BASE.DetectedItems:

DETECTION_BASE:GetDetectedItemsCount()

Get the amount of SETs with detected objects.

Return value

#number: Count

DETECTION_BASE:GetDetectedObject(ObjectName)

Gets a detected object with a given name.

Parameter

  • #string ObjectName :

Return value

#DETECTION_BASE.DetectedObject:

DETECTION_BASE:GetDetectedSet(Index)

Get the Set#SET_UNIT of a detecttion area using a given numeric index.

Parameter

  • #number Index :

Return value

Core.Set#SET_UNIT: DetectedSet

DETECTION_BASE:GetDetectedZone(Index)

Get the Zone#ZONE_UNIT of a detection area using a given numeric index.

Parameter

  • #number Index :

Return value

Core.Zone#ZONE_UNIT: DetectedZone

DETECTION_BASE:GetDetectionSetGroup()

Get the detection Groups.

Return value

Wrapper.Group#GROUP:

DETECTION_BASE:IdentifyDetectedObject(DetectedObject)

Identifies a detected object during detection processing.

Parameter

DETECTION_BASE:InitDetectDLINK(DetectDLINK)

Detect DLINK.

Parameter

  • #boolean DetectDLINK :

Return value

#DETECTION_BASE: self

DETECTION_BASE:InitDetectIRST(DetectIRST)

Detect IRST.

Parameter

  • #boolean DetectIRST :

Return value

#DETECTION_BASE: self

DETECTION_BASE:InitDetectOptical(DetectOptical)

Detect Optical.

Parameter

  • #boolean DetectOptical :

Return value

#DETECTION_BASE: self

DETECTION_BASE:InitDetectRWR(DetectRWR)

Detect RWR.

Parameter

  • #boolean DetectRWR :

Return value

#DETECTION_BASE: self

DETECTION_BASE:InitDetectRadar(DetectRadar)

Detect Radar.

Parameter

  • #boolean DetectRadar :

Return value

#DETECTION_BASE: self

DETECTION_BASE:InitDetectVisual(DetectVisual)

Detect Visual.

Parameter

  • #boolean DetectVisual :

Return value

#DETECTION_BASE: self

DETECTION_BASE:IsDetectedObjectIdentified(DetectedObject)

Determines if a detected object has already been identified during detection processing.

Parameter

Return value

#boolean: true if already identified.

DETECTION_BASE:IsFriendliesNearBy(DetectedItem)

Returns if there are friendlies nearby the FAC units ...

Parameter

  • DetectedItem :

Return value

#boolean: trhe if there are friendlies nearby

DETECTION_BASE:New(DetectionSetGroup)

DETECTION constructor.

Parameter

Return value

#DETECTION_BASE: self

DETECTION_BASE:OnAfterDetect(From, Event, To)

OnAfter Transition Handler for Event Detect.

Parameters

  • #string From : The From State string.

  • #string Event : The Event string.

  • #string To : The To State string.

DETECTION_BASE:OnAfterDetected(From, Event, To)

OnAfter Transition Handler for Event Detected.

Parameters

  • #string From : The From State string.

  • #string Event : The Event string.

  • #string To : The To State string.

DETECTION_BASE:OnAfterStart(From, Event, To)

OnAfter Transition Handler for Event Start.

Parameters

  • #string From : The From State string.

  • #string Event : The Event string.

  • #string To : The To State string.

DETECTION_BASE:OnAfterStop(From, Event, To)

OnAfter Transition Handler for Event Stop.

Parameters

  • #string From : The From State string.

  • #string Event : The Event string.

  • #string To : The To State string.

DETECTION_BASE:OnBeforeDetect(From, Event, To)

OnBefore Transition Handler for Event Detect.

Parameters

  • #string From : The From State string.

  • #string Event : The Event string.

  • #string To : The To State string.

Return value

#boolean: Return false to cancel Transition.

DETECTION_BASE:OnBeforeDetected(From, Event, To)

OnBefore Transition Handler for Event Detected.

Parameters

  • #string From : The From State string.

  • #string Event : The Event string.

  • #string To : The To State string.

Return value

#boolean: Return false to cancel Transition.

DETECTION_BASE:OnBeforeStart(From, Event, To)

OnBefore Transition Handler for Event Start.

Parameters

  • #string From : The From State string.

  • #string Event : The Event string.

  • #string To : The To State string.

Return value

#boolean: Return false to cancel Transition.

DETECTION_BASE:OnBeforeStop(From, Event, To)

OnBefore Transition Handler for Event Stop.

Parameters

  • #string From : The From State string.

  • #string Event : The Event string.

  • #string To : The To State string.

Return value

#boolean: Return false to cancel Transition.

DETECTION_BASE:OnEnterDetecting(From, Event, To)

OnEnter Transition Handler for State Detecting.

Parameters

  • #string From : The From State string.

  • #string Event : The Event string.

  • #string To : The To State string.

DETECTION_BASE:OnEnterStopped(From, Event, To)

OnEnter Transition Handler for State Stopped.

Parameters

  • #string From : The From State string.

  • #string Event : The Event string.

  • #string To : The To State string.

DETECTION_BASE:OnLeaveDetecting(From, Event, To)

OnLeave Transition Handler for State Detecting.

Parameters

  • #string From : The From State string.

  • #string Event : The Event string.

  • #string To : The To State string.

Return value

#boolean: Return false to cancel Transition.

DETECTION_BASE:OnLeaveStopped(From, Event, To)

OnLeave Transition Handler for State Stopped.

Parameters

  • #string From : The From State string.

  • #string Event : The Event string.

  • #string To : The To State string.

Return value

#boolean: Return false to cancel Transition.

DETECTION_BASE.RejectZones
DETECTION_BASE:RemoveDetectedItem(DetectedItemIndex)

Removes an existing DetectedItem from the DetectedItems list.

The DetectedItem is a table and contains a SET_UNIT in the field Set.

Parameter

  • #number DetectedItemIndex : The index or position in the DetectedItems list where the item needs to be removed.

DETECTION_BASE:ReportFriendliesNearBy(ReportGroupData)

Background worker function to determine if there are friendlies nearby ...

Parameter

  • ReportGroupData :

DETECTION_BASE:Schedule(DelayTime, RepeatInterval)

Schedule the DETECTION construction.

Parameters

  • #number DelayTime : The delay in seconds to wait the reporting.

  • #number RepeatInterval : The repeat interval in seconds for the reporting to happen repeatedly.

Return value

#DETECTION_BASE: self

DETECTION_BASE.ScheduleDelayTime
DETECTION_BASE.ScheduleRepeatInterval
DETECTION_BASE:SetAcceptRange(AcceptRange)

Accept detections if within a range in meters.

Parameter

  • #number AcceptRange : Accept a detection if the unit is within the AcceptRange in meters.

Return value

#DETECTION_BASE: self

DETECTION_BASE:SetAcceptZones(AcceptZones)

Accept detections if within the specified zone(s).

Parameter

  • AcceptZones : Can be a list or ZONEBASE objects, or a single ZONEBASE object.

Return value

#DETECTION_BASE: self

DETECTION_BASE:SetAlphaAngleProbability(AlphaAngleProbability)

Upon a visual detection, the higher the unit is during the detecting process, the more likely the detected unit is to be detected properly.

A detection at a 90% alpha angle is the most optimal, a detection at 10% is less and a detection at 0% is less likely to be correct.

A probability factor between 0 and 1 can be given, that will model a progressive extrapolated probability if the target would be detected at a 0° angle.

For example, if a alpha angle probability factor of 0.7 is given, the extrapolated probabilities of the different angles would look like: 0°: 70%, 10°: 75,21%, 20°: 80,26%, 30°: 85%, 40°: 89,28%, 50°: 92,98%, 60°: 95,98%, 70°: 98,19%, 80°: 99,54%, 90°: 100%

Parameter

  • AlphaAngleProbability : The probability factor.

Return value

#DETECTION_BASE: self

DETECTION_BASE:SetDetectionInterval(DetectionInterval)

Set the detection interval time in seconds.

Parameter

  • #number DetectionInterval : Interval in seconds.

Return value

#DETECTION_BASE: self

DETECTION_BASE:SetDistanceProbability(DistanceProbability)

Upon a visual detection, the further away a detected object is, the less likely it is to be detected properly.

Also, the speed of accurate detection plays a role. A distance probability factor between 0 and 1 can be given, that will model a linear extrapolated probability over 10 km distance. For example, if a probability factor of 0.6 (60%) is given, the extrapolated probabilities over 15 kilometers would like like: 1 km: 96%, 2 km: 92%, 3 km: 88%, 4 km: 84%, 5 km: 80%, 6 km: 76%, 7 km: 72%, 8 km: 68%, 9 km: 64%, 10 km: 60%, 11 km: 56%, 12 km: 52%, 13 km: 48%, 14 km: 44%, 15 km: 40%.

Parameter

  • DistanceProbability : The probability factor.

Return value

#DETECTION_BASE: self

DETECTION_BASE:SetRejectZones(RejectZones)

Reject detections if within the specified zone(s).

Parameter

  • RejectZones : Can be a list or ZONEBASE objects, or a single ZONEBASE object.

Return value

#DETECTION_BASE: self

DETECTION_BASE:SetZoneProbability(ZoneArray)

Upon a visual detection, the more a detected unit is within a cloudy zone, the less likely the detected unit is to be detected successfully.

The Cloudy Zones work with the ZONE_BASE derived classes. The mission designer can define within the mission zones that reflect cloudy areas where detected units may not be so easily visually detected.

Parameter

  • ZoneArray : Aray of a The ZONE_BASE object and a ZoneProbability pair..

Return value

#DETECTION_BASE: self

DETECTION_BASE:Start()

Synchronous Event Trigger for Event Start.

DETECTION_BASE:Stop()

Synchronous Event Trigger for Event Stop.

DETECTION_BASE:UnIdentifyAllDetectedObjects()

UnIdentify all detected objects during detection processing.

DETECTION_BASE:UnIdentifyDetectedObject(DetectedObject)

UnIdentify a detected object during detection processing.

Parameter

DETECTION_BASE.ZoneProbability
DETECTION_BASE:__Detect(Delay)

Asynchronous Event Trigger for Event Detect.

Parameter

  • #number Delay : The delay in seconds.

DETECTION_BASE:__Detected(Delay)

Asynchronous Event Trigger for Event Detected.

Parameter

  • #number Delay : The delay in seconds.

DETECTION_BASE:__Start(Delay)

Asynchronous Event Trigger for Event Start.

Parameter

  • #number Delay : The delay in seconds.

DETECTION_BASE:__Stop(Delay)

Asynchronous Event Trigger for Event Stop.

Parameter

  • #number Delay : The delay in seconds.

DETECTION_BASE:onafterDetect(From, Event, To)

Parameters

  • #string From : The From State string.

  • #string Event : The Event string.

  • #string To : The To State string.

DETECTION_BASE:onafterDetectionGroup(From, Event, To, DetectionGroup)

Parameters

  • #string From : The From State string.

  • #string Event : The Event string.

  • #string To : The To State string.

  • Wrapper.Group#GROUP DetectionGroup : The Group detecting.

DETECTION_BASE:onafterStart(From, Event, To)

Parameters

  • #string From : The From State string.

  • #string Event : The Event string.

  • #string To : The To State string.

Type DETECTION_BASE.DetectedItem

Field(s)

#boolean DETECTION_BASE.DetectedItem.Changed

Documents if the detected area has changes.

#table DETECTION_BASE.DetectedItem.Changes

A list of the changes reported on the detected area. (It is up to the user of the detected area to consume those changes).

#boolean DETECTION_BASE.DetectedItem.FriendliesNearBy

Indicates if there are friendlies within the detected area.

#number DETECTION_BASE.DetectedItem.ItemID

-- The identifier of the detected area.

DETECTION_BASE.DetectedItem.MaxThreatLevelA2G
Wrapper.Unit#UNIT DETECTION_BASE.DetectedItem.NearestFAC

The nearest FAC near the Area.

Core.Set#SET_UNIT DETECTION_BASE.DetectedItem.Set

-- The Set of Units in the detected area.

Core.Zone#ZONE_UNIT DETECTION_BASE.DetectedItem.Zone

-- The Zone of the detected area.

Type DETECTION_BASE.DetectedItems

Type DETECTION_BASE.DetectedObject

Field(s)

#number DETECTION_BASE.DetectedObject.Distance
#boolean DETECTION_BASE.DetectedObject.Identified
#string DETECTION_BASE.DetectedObject.Name
#string DETECTION_BASE.DetectedObject.Type
#boolean DETECTION_BASE.DetectedObject.Visible

Type DETECTION_BASE.DetectedObjects

Type DETECTION_TYPES

DETECTION_TYPES class

Field(s)

#string DETECTION_TYPES.ClassName
DETECTION_TYPES:CreateDetectionSets()

Create the DetectedItems list from the DetectedObjects table.

For each DetectedItem, a one field array is created containing the Unit detected.

Return value

#DETECTION_TYPES: self

DETECTION_TYPES:DetectedItemReportSummary(Index, DetectedTypeName)

Report summary of a DetectedItem using a given numeric index.

Parameters

  • Index :

  • DetectedTypeName :

Return value

#string:

DETECTION_TYPES:DetectedReportDetailed()

Report detailed of a detection result.

Return value

#string:

DETECTION_TYPES.DetectionRange
DETECTION_TYPES:GetChangeText(DetectedItem)

Make text documenting the changes of the detected zone.

Parameter

Return value

#string: The Changes text

DETECTION_TYPES:New(DetectionSetGroup)

DETECTION_TYPES constructor.

Parameter

Return value

Functional.Detection#DETECTION_TYPES: self

#boolean DETECTION_TYPES._BoundDetectedZones
#boolean DETECTION_TYPES._FlareDetectedUnits
#boolean DETECTION_TYPES._FlareDetectedZones
#boolean DETECTION_TYPES._SmokeDetectedUnits
#boolean DETECTION_TYPES._SmokeDetectedZones

Type DETECTION_TYPES.DetectedItem

Type DETECTION_UNITS

DETECTION_UNITS class

Field(s)

#string DETECTION_UNITS.ClassName
DETECTION_UNITS:CreateDetectionSets()

Create the DetectedItems list from the DetectedObjects table.

For each DetectedItem, a one field array is created containing the Unit detected.

Return value

#DETECTION_UNITS: self

DETECTION_UNITS:DetectedItemReportSummary(Index)

Report summary of a DetectedItem using a given numeric index.

Parameter

  • Index :

Return value

#string:

DETECTION_UNITS:DetectedReportDetailed()

Report detailed of a detection result.

Return value

#string:

Dcs.DCSTypes#Distance DETECTION_UNITS.DetectionRange

The range till which targets are detected.

DETECTION_UNITS:GetChangeText(DetectedItem)

Make text documenting the changes of the detected zone.

Parameter

Return value

#string: The Changes text

DETECTION_UNITS:New(DetectionSetGroup)

DETECTION_UNITS constructor.

Parameter

Return value

Functional.Detection#DETECTION_UNITS: self

#boolean DETECTION_UNITS._BoundDetectedZones
#boolean DETECTION_UNITS._FlareDetectedUnits
#boolean DETECTION_UNITS._FlareDetectedZones
#boolean DETECTION_UNITS._SmokeDetectedUnits
#boolean DETECTION_UNITS._SmokeDetectedZones

Type DETECTION_UNITS.DetectedItem