mirror of
https://github.com/FlightControl-Master/MOOSE.git
synced 2026-08-27 15:37:28 +00:00
Updates
This commit is contained in:
BIN
Binary file not shown.
+56
@@ -0,0 +1,56 @@
|
||||
---
|
||||
-- Name: DET-100 - Detection Probability Distance
|
||||
-- Author: FlightControl
|
||||
-- Date Created: 04 Feb 2017
|
||||
--
|
||||
-- # Situation:
|
||||
--
|
||||
-- Demonstrates the DistanceProbability factor during the detection of units.
|
||||
--
|
||||
-- Two JTAC are detecting 4 units, which are 10 km away.
|
||||
-- The first JTAC has no DistanceProbability set.
|
||||
-- The second JTAC has a DistanceProbability set.
|
||||
--
|
||||
-- # Test cases:
|
||||
--
|
||||
-- 1. Observe the reporting of both the first and second JTAC. The second should report slower the detection than the first.
|
||||
-- 2. Eventually all units should be detected by both JTAC.
|
||||
|
||||
local RecceSetGroup1 = SET_GROUP:New():FilterPrefixes( "Recce 1" ):FilterStart()
|
||||
local RecceSetGroup2 = SET_GROUP:New():FilterPrefixes( "Recce 2" ):FilterStart()
|
||||
|
||||
local HQ = GROUP:FindByName( "HQ" )
|
||||
|
||||
local CC = COMMANDCENTER:New( HQ, "HQ" )
|
||||
|
||||
local RecceDetection1 = DETECTION_UNITS:New( RecceSetGroup1 )
|
||||
|
||||
local RecceDetection2 = DETECTION_UNITS:New( RecceSetGroup2 )
|
||||
RecceDetection2:SetDistanceProbability( 0.2 ) -- Set a 20% probability that a vehicle can be detected at 4km distance.
|
||||
|
||||
RecceDetection1:Start()
|
||||
RecceDetection2:Start()
|
||||
|
||||
--- OnAfter Transition Handler for Event Detect.
|
||||
-- @param Functional.Detection#DETECTION_UNITS self
|
||||
-- @param #string From The From State string.
|
||||
-- @param #string Event The Event string.
|
||||
-- @param #string To The To State string.
|
||||
function RecceDetection1:OnAfterDetect(From,Event,To)
|
||||
|
||||
local DetectionReport = RecceDetection1:DetectedReportDetailed()
|
||||
|
||||
HQ:MessageToAll( DetectionReport, 15, "Detection 1 - No distance Probability" )
|
||||
end
|
||||
|
||||
--- OnAfter Transition Handler for Event Detect.
|
||||
-- @param Functional.Detection#DETECTION_UNITS self
|
||||
-- @param #string From The From State string.
|
||||
-- @param #string Event The Event string.
|
||||
-- @param #string To The To State string.
|
||||
function RecceDetection2:OnAfterDetect(From,Event,To)
|
||||
|
||||
local DetectionReport = RecceDetection2:DetectedReportDetailed()
|
||||
|
||||
HQ:MessageToAll( DetectionReport, 15, "Detection 2 - Distance Probability" )
|
||||
end
|
||||
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
+62
@@ -0,0 +1,62 @@
|
||||
---
|
||||
-- Name: DET-120 - Detection Probability Zones
|
||||
-- Author: FlightControl
|
||||
-- Date Created: 04 Feb 2017
|
||||
--
|
||||
-- # Situation:
|
||||
--
|
||||
-- Demonstrates the DistanceProbability factor during the detection of units.
|
||||
--
|
||||
-- Two JTAC are detecting 4 units, which are 10 km away.
|
||||
-- The first JTAC has no DistanceProbability set.
|
||||
-- The second JTAC has a DistanceProbability set.
|
||||
--
|
||||
-- # Test cases:
|
||||
--
|
||||
-- 1. Observe the reporting of both the first and second JTAC. The second should report slower the detection than the first.
|
||||
-- 2. Eventually all units should be detected by both JTAC.
|
||||
|
||||
local RecceSetGroup1 = SET_GROUP:New():FilterPrefixes( "Recce 1" ):FilterStart()
|
||||
local RecceSetGroup2 = SET_GROUP:New():FilterPrefixes( "Recce 2" ):FilterStart()
|
||||
|
||||
local HQ = GROUP:FindByName( "HQ" )
|
||||
|
||||
local CC = COMMANDCENTER:New( HQ, "HQ" )
|
||||
|
||||
local RecceDetection1 = DETECTION_UNITS:New( RecceSetGroup1 )
|
||||
|
||||
local RecceDetection2 = DETECTION_UNITS:New( RecceSetGroup2 )
|
||||
|
||||
local ForestZone = ZONE_POLYGON:New( "ForestZone", GROUP:FindByName( "ForestZone" ) )
|
||||
|
||||
RecceDetection2:SetZoneProbability( { { ForestZone, 0.1 } } ) -- Set a 10% probability that a vehicle can be detected within the forest.
|
||||
|
||||
|
||||
RecceDetection1:Start()
|
||||
RecceDetection2:Start()
|
||||
|
||||
--- OnAfter Transition Handler for Event Detect.
|
||||
-- @param Functional.Detection#DETECTION_UNITS self
|
||||
-- @param #string From The From State string.
|
||||
-- @param #string Event The Event string.
|
||||
-- @param #string To The To State string.
|
||||
function RecceDetection1:OnAfterDetect(From,Event,To)
|
||||
|
||||
local DetectionReport = self:DetectedReportDetailed()
|
||||
|
||||
HQ:MessageToAll( DetectionReport, 15, "Detection 1 - No Zone Probability" )
|
||||
end
|
||||
|
||||
--- OnAfter Transition Handler for Event Detect.
|
||||
-- @param Functional.Detection#DETECTION_UNITS self
|
||||
-- @param #string From The From State string.
|
||||
-- @param #string Event The Event string.
|
||||
-- @param #string To The To State string.
|
||||
function RecceDetection2:OnAfterDetect(From,Event,To)
|
||||
|
||||
local DetectionReport = self:DetectedReportDetailed()
|
||||
|
||||
HQ:MessageToAll( DetectionReport, 15, "Detection 2 - Forest Zone Probability" )
|
||||
end
|
||||
|
||||
garbagecollect()
|
||||
BIN
Binary file not shown.
+40
@@ -0,0 +1,40 @@
|
||||
---
|
||||
-- Name: DET-200 - Detection UNITS
|
||||
-- Author: FlightControl
|
||||
-- Date Created: 13 Feb 2017
|
||||
--
|
||||
-- # Situation:
|
||||
--
|
||||
-- Demonstrates the detection of units.
|
||||
--
|
||||
-- A Set of Recce are detecting a large group of units, which are 5 km away.
|
||||
-- Select one of the blue Recce, and press F7. Watch the reporting of the detection evolve.
|
||||
-- The enemy is approaching.
|
||||
--
|
||||
-- # Test cases:
|
||||
--
|
||||
-- 1. Observe the detection reporting of both the Recce.
|
||||
-- 2. Eventually all units should be detected by both Recce.
|
||||
|
||||
local RecceSetGroup = SET_GROUP:New():FilterPrefixes( "Recce" ):FilterStart()
|
||||
|
||||
local HQ = GROUP:FindByName( "HQ" )
|
||||
|
||||
local CC = COMMANDCENTER:New( HQ, "HQ" )
|
||||
|
||||
local RecceDetection = DETECTION_UNITS:New( RecceSetGroup )
|
||||
|
||||
RecceDetection:Start()
|
||||
|
||||
--- OnAfter Transition Handler for Event Detect.
|
||||
-- @param Functional.Detection#DETECTION_UNITS self
|
||||
-- @param #string From The From State string.
|
||||
-- @param #string Event The Event string.
|
||||
-- @param #string To The To State string.
|
||||
function RecceDetection:OnAfterDetect(From,Event,To)
|
||||
|
||||
local DetectionReport = RecceDetection:DetectedReportDetailed()
|
||||
|
||||
CC:MessageToAll( DetectionReport, 15, "" )
|
||||
end
|
||||
|
||||
BIN
Binary file not shown.
+42
@@ -0,0 +1,42 @@
|
||||
---
|
||||
-- Name: DET-210 - Detection TYPES
|
||||
-- Author: FlightControl
|
||||
-- Date Created: 13 Feb 2017
|
||||
--
|
||||
-- # Situation:
|
||||
--
|
||||
-- Demonstrates the detection of units.
|
||||
--
|
||||
-- A Set of Recce are detecting a large group of units, which are 5 km away.
|
||||
-- Select one of the blue Recce, and press F7. Watch the reporting of the detection evolve.
|
||||
-- The enemy is approaching.
|
||||
--
|
||||
-- The blue Recce will report the detected units grouped per vehicle type!
|
||||
--
|
||||
-- # Test cases:
|
||||
--
|
||||
-- 1. Observe the detection reporting of both the Recce.
|
||||
-- 2. Eventually all units should be detected by both Recce.
|
||||
|
||||
local RecceSetGroup = SET_GROUP:New():FilterPrefixes( "Recce" ):FilterStart()
|
||||
|
||||
local HQ = GROUP:FindByName( "HQ" )
|
||||
|
||||
local CC = COMMANDCENTER:New( HQ, "HQ" )
|
||||
|
||||
local RecceDetection = DETECTION_TYPES:New( RecceSetGroup )
|
||||
|
||||
RecceDetection:Start()
|
||||
|
||||
--- OnAfter Transition Handler for Event Detect.
|
||||
-- @param Functional.Detection#DETECTION_UNITS self
|
||||
-- @param #string From The From State string.
|
||||
-- @param #string Event The Event string.
|
||||
-- @param #string To The To State string.
|
||||
function RecceDetection:OnAfterDetect(From,Event,To)
|
||||
|
||||
local DetectionReport = RecceDetection:DetectedReportDetailed()
|
||||
|
||||
CC:MessageToAll( DetectionReport, 15, "" )
|
||||
end
|
||||
|
||||
BIN
Binary file not shown.
+56
@@ -0,0 +1,56 @@
|
||||
---
|
||||
-- Name: DET-100 - Detection Probability Distance
|
||||
-- Author: FlightControl
|
||||
-- Date Created: 04 Feb 2017
|
||||
--
|
||||
-- # Situation:
|
||||
--
|
||||
-- Demonstrates the DistanceProbability factor during the detection of units.
|
||||
--
|
||||
-- Two JTAC are detecting 4 units, which are 10 km away.
|
||||
-- The first JTAC has no DistanceProbability set.
|
||||
-- The second JTAC has a DistanceProbability set.
|
||||
--
|
||||
-- # Test cases:
|
||||
--
|
||||
-- 1. Observe the reporting of both the first and second JTAC. The second should report slower the detection than the first.
|
||||
-- 2. Eventually all units should be detected by both JTAC.
|
||||
|
||||
local RecceSetGroup1 = SET_GROUP:New():FilterPrefixes( "Recce 1" ):FilterStart()
|
||||
local RecceSetGroup2 = SET_GROUP:New():FilterPrefixes( "Recce 2" ):FilterStart()
|
||||
|
||||
local HQ = GROUP:FindByName( "HQ" )
|
||||
|
||||
local CC = COMMANDCENTER:New( HQ, "HQ" )
|
||||
|
||||
local RecceDetection1 = DETECTION_UNITS:New( RecceSetGroup1 )
|
||||
|
||||
local RecceDetection2 = DETECTION_UNITS:New( RecceSetGroup2 )
|
||||
RecceDetection2:SetDistanceProbability( 0.2 ) -- Set a 20% probability that a vehicle can be detected at 4km distance.
|
||||
|
||||
RecceDetection1:Start()
|
||||
RecceDetection2:Start()
|
||||
|
||||
--- OnAfter Transition Handler for Event Detect.
|
||||
-- @param Functional.Detection#DETECTION_UNITS self
|
||||
-- @param #string From The From State string.
|
||||
-- @param #string Event The Event string.
|
||||
-- @param #string To The To State string.
|
||||
function RecceDetection1:OnAfterDetect(From,Event,To)
|
||||
|
||||
local DetectionReport = RecceDetection1:DetectedReportDetailed()
|
||||
|
||||
HQ:MessageToAll( DetectionReport, 15, "Detection 1 - No distance Probability" )
|
||||
end
|
||||
|
||||
--- OnAfter Transition Handler for Event Detect.
|
||||
-- @param Functional.Detection#DETECTION_UNITS self
|
||||
-- @param #string From The From State string.
|
||||
-- @param #string Event The Event string.
|
||||
-- @param #string To The To State string.
|
||||
function RecceDetection2:OnAfterDetect(From,Event,To)
|
||||
|
||||
local DetectionReport = RecceDetection2:DetectedReportDetailed()
|
||||
|
||||
HQ:MessageToAll( DetectionReport, 15, "Detection 2 - Distance Probability" )
|
||||
end
|
||||
BIN
Binary file not shown.
+61
@@ -0,0 +1,61 @@
|
||||
---
|
||||
-- Name: DET-500 - Handle Detected Event - Govern Artillery Demo
|
||||
-- Author: FlightControl
|
||||
-- Date Created: 13 Feb 2017
|
||||
--
|
||||
-- # Situation:
|
||||
--
|
||||
-- Demonstrates the detection of units.
|
||||
--
|
||||
-- A Set of Recces are detecting a large group of units, which are 5 km away.
|
||||
-- Once the Recces detect the enemy, the artilley units are controlled and will fire a missile to the target.
|
||||
--
|
||||
-- # Test cases:
|
||||
--
|
||||
-- 1. Observe the detected reporting of the recces.
|
||||
-- 2. When one Recce group detects a target, it will select an artillery unit and fire a missile.
|
||||
-- 3. This will run until all Recces have eliminated the targets.
|
||||
|
||||
local RecceSetGroup = SET_GROUP:New():FilterCoalitions( "blue" ):FilterPrefixes( "Recce" ):FilterStart()
|
||||
local ArtillerySetGroup = SET_GROUP:New():FilterCoalitions( "blue" ):FilterPrefixes( "Artillery" ):FilterStart()
|
||||
|
||||
local HQ = GROUP:FindByName( "HQ" )
|
||||
|
||||
local CC = COMMANDCENTER:New( HQ, "HQ" )
|
||||
|
||||
local RecceDetection = DETECTION_UNITS:New( RecceSetGroup )
|
||||
RecceDetection:SetDetectionInterval( 5 )
|
||||
|
||||
RecceDetection:Start()
|
||||
|
||||
--- OnAfter Transition Handler for Event Detect.
|
||||
-- @param Functional.Detection#DETECTION_UNITS self
|
||||
-- @param #string From The From State string.
|
||||
-- @param #string Event The Event string.
|
||||
-- @param #string To The To State string.
|
||||
function RecceDetection:OnAfterDetect(From,Event,To)
|
||||
|
||||
local DetectionReport = RecceDetection:DetectedReportDetailed()
|
||||
|
||||
CC:MessageToAll( DetectionReport, 15, "" )
|
||||
end
|
||||
|
||||
|
||||
--- OnAfter Transition Handler for Event Detect.
|
||||
-- @param Functional.Detection#DETECTION_UNITS self
|
||||
-- @param #string From The From State string.
|
||||
-- @param #string Event The Event string.
|
||||
-- @param #string To The To State string.
|
||||
-- @param Wrapper.Unit#UNIT DetectedUnits
|
||||
function RecceDetection:OnAfterDetected( From, Event, To, DetectedUnits )
|
||||
|
||||
local ArtilleryArray = ArtillerySetGroup:GetSet()
|
||||
local ArtilleryArrayCount = ArtillerySetGroup:Count()
|
||||
|
||||
for DetectedUnitID, DetectedUnit in pairs( DetectedUnits ) do
|
||||
local DetectedUnit = DetectedUnit -- Wrapper.Unit#UNIT
|
||||
local Artillery = ArtilleryArray[ math.random( 1, ArtilleryArrayCount ) ] -- Wrapper.Group#GROUP
|
||||
local Task = Artillery:TaskFireAtPoint( DetectedUnit:GetVec2(), 500, 2 ) -- Fire 2 rockets to the target point.
|
||||
Artillery:SetTask( Task, 0.5 )
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user