Tasking and Functional

This commit is contained in:
FlightControl_Master 2018-05-23 13:51:47 +02:00
parent 1b39f5d6e6
commit 5e2a5cf5e8
34 changed files with 34 additions and 166 deletions

View File

@ -11,7 +11,7 @@
-- --
-- === -- ===
-- --
-- @module ATC_Ground -- @module Functional.ATC_Ground
--- @type ATC_GROUND --- @type ATC_GROUND

View File

@ -38,7 +38,7 @@
-- ### Contributions: [FlightControl](https://forums.eagle.ru/member.php?u=89536) -- ### Contributions: [FlightControl](https://forums.eagle.ru/member.php?u=89536)
-- --
-- ==== -- ====
-- @module Arty -- @module Functional.Arty
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
--- ARTY class --- ARTY class

View File

@ -7,7 +7,7 @@
-- --
-- === -- ===
-- --
-- @module CleanUp -- @module Functional.CleanUp
--- @type CLEANUP_AIRBASE.__ Methods which are not intended for mission designers, but which are used interally by the moose designer :-) --- @type CLEANUP_AIRBASE.__ Methods which are not intended for mission designers, but which are used interally by the moose designer :-)
-- @field #map<#string,Wrapper.Airbase#AIRBASE> Airbases Map of Airbases. -- @field #map<#string,Wrapper.Airbase#AIRBASE> Airbases Map of Airbases.

View File

@ -28,7 +28,7 @@
-- --
-- * **FlightControl**: Design & Programming -- * **FlightControl**: Design & Programming
-- --
-- @module Designate -- @module Functional.Designate
do -- DESIGNATE do -- DESIGNATE

View File

@ -29,7 +29,7 @@
-- --
-- * FlightControl : Analysis, Design, Programming, Testing -- * FlightControl : Analysis, Design, Programming, Testing
-- --
-- @module Detection -- @module Functional.Detection
----BASE:TraceClass("DETECTION_BASE") ----BASE:TraceClass("DETECTION_BASE")
----BASE:TraceClass("DETECTION_AREAS") ----BASE:TraceClass("DETECTION_AREAS")

View File

@ -114,8 +114,7 @@
-- --
-- --
-- --
-- @module Escort -- @module Functional.Escort
-- @author FlightControl
--- ESCORT class --- ESCORT class
-- @type ESCORT -- @type ESCORT

View File

@ -77,8 +77,7 @@
-- Danny has shared his ideas and together we made a design. -- Danny has shared his ideas and together we made a design.
-- Together with the **476 virtual team**, we tested the MISSILETRAINER class, and got much positive feedback! -- Together with the **476 virtual team**, we tested the MISSILETRAINER class, and got much positive feedback!
-- --
-- @module MissileTrainer -- @module Functional.MissileTrainer
-- @author FlightControl
--- The MISSILETRAINER class --- The MISSILETRAINER class

View File

@ -7,7 +7,7 @@
-- Performance: If in a DCSRTE there are a lot of moving GROUND units, then in a multi player mission, this WILL create lag if -- Performance: If in a DCSRTE there are a lot of moving GROUND units, then in a multi player mission, this WILL create lag if
-- the main DCS execution core of your CPU is fully utilized. So, this class will limit the amount of simultaneous moving GROUND units -- the main DCS execution core of your CPU is fully utilized. So, this class will limit the amount of simultaneous moving GROUND units
-- on defined intervals (currently every minute). -- on defined intervals (currently every minute).
-- @module Movement -- @module Functional.Movement
--- the MOVEMENT class --- the MOVEMENT class
-- @type MOVEMENT -- @type MOVEMENT

View File

@ -7,7 +7,7 @@
-- --
-- === -- ===
-- --
-- @module Protect -- @module Functional.Protect
--- @type PROTECT.__ Methods which are not intended for mission designers, but which are used interally by the moose designer :-) --- @type PROTECT.__ Methods which are not intended for mission designers, but which are used interally by the moose designer :-)
-- @extends Core.Fsm#FSM -- @extends Core.Fsm#FSM

View File

@ -38,7 +38,7 @@
-- ### Contributions: [FlightControl](https://forums.eagle.ru/member.php?u=89536) -- ### Contributions: [FlightControl](https://forums.eagle.ru/member.php?u=89536)
-- --
-- ==== -- ====
-- @module PseudoATC -- @module Functional.PseudoATC
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
--- PSEUDOATC class --- PSEUDOATC class

View File

@ -59,7 +59,7 @@
-- ### Contributions: [FlightControl](https://forums.eagle.ru/member.php?u=89536) -- ### Contributions: [FlightControl](https://forums.eagle.ru/member.php?u=89536)
-- --
-- === -- ===
-- @module Rat -- @module Functional.Rat
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
--- RAT class --- RAT class

View File

@ -48,7 +48,7 @@
-- ### Contributions: [FlightControl](https://forums.eagle.ru/member.php?u=89536), [Ciribob](https://forums.eagle.ru/member.php?u=112175) -- ### Contributions: [FlightControl](https://forums.eagle.ru/member.php?u=89536), [Ciribob](https://forums.eagle.ru/member.php?u=112175)
-- --
-- === -- ===
-- @module Range -- @module Functional.Range
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
--- RANGE class --- RANGE class

View File

@ -206,7 +206,7 @@
-- --
-- * **FlightControl**: Concept, Design & Programming. -- * **FlightControl**: Concept, Design & Programming.
-- --
-- @module Scoring -- @module Functional.Scoring
--- The Scoring class --- The Scoring class

View File

@ -2,7 +2,7 @@
-- --
-- === -- ===
-- --
-- @module Sead -- @module Functional.Sead
--- The SEAD class --- The SEAD class
-- @type SEAD -- @type SEAD

View File

@ -31,7 +31,7 @@
-- ### Contributions: [FlightControl](https://forums.eagle.ru/member.php?u=89536) -- ### Contributions: [FlightControl](https://forums.eagle.ru/member.php?u=89536)
-- --
-- ==== -- ====
-- @module Suppression -- @module Functional.Suppression
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

View File

@ -21,7 +21,7 @@
-- --
-- === -- ===
-- --
-- @module ZoneCaptureCoalition -- @module Functional.ZoneCaptureCoalition
do -- ZONE_CAPTURE_COALITION do -- ZONE_CAPTURE_COALITION

View File

@ -11,7 +11,7 @@
-- --
-- === -- ===
-- --
-- @module ZoneGoal -- @module Functional.ZoneGoal
do -- Zone do -- Zone

View File

@ -11,7 +11,7 @@
-- --
-- === -- ===
-- --
-- @module ZoneGoalCargo -- @module Functional.ZoneGoalCargo
do -- ZoneGoal do -- ZoneGoal

View File

@ -11,7 +11,7 @@
-- --
-- === -- ===
-- --
-- @module ZoneGoalCoalition -- @module Functional.ZoneGoalCoalition
do -- ZoneGoal do -- ZoneGoal

View File

@ -9,7 +9,7 @@
-- --
-- === -- ===
-- --
-- @module CommandCenter -- @module Tasking.CommandCenter

View File

@ -40,7 +40,7 @@
-- ### Contributions: Mechanist, Prof_Hilactic, FlightControl - Concept & Testing -- ### Contributions: Mechanist, Prof_Hilactic, FlightControl - Concept & Testing
-- ### Author: FlightControl - Framework Design & Programming -- ### Author: FlightControl - Framework Design & Programming
-- --
-- @module DetectionManager -- @module Tasking.DetectionManager
do -- DETECTION MANAGER do -- DETECTION MANAGER

View File

@ -8,7 +8,7 @@
-- --
-- === -- ===
-- --
-- @module Mission -- @module Tasking.Mission
--- The MISSION class --- The MISSION class
-- @type MISSION -- @type MISSION

View File

@ -8,7 +8,7 @@
-- --
-- === -- ===
-- --
-- @module Task -- @module Tasking.Task
--- @type TASK --- @type TASK
-- @field Core.Scheduler#SCHEDULER TaskScheduler -- @field Core.Scheduler#SCHEDULER TaskScheduler

View File

@ -8,7 +8,7 @@
-- --
-- === -- ===
-- --
-- @module TaskInfo -- @module Tasking.TaskInfo
--- @type TASKINFO --- @type TASKINFO
-- @extends Core.Base#BASE -- @extends Core.Base#BASE

View File

@ -8,7 +8,7 @@
-- --
-- === -- ===
-- --
-- @module TaskZoneCapture -- @module Tasking.TaskZoneCapture
do -- TASK_ZONE_GOAL do -- TASK_ZONE_GOAL

View File

@ -8,7 +8,7 @@
-- --
-- === -- ===
-- --
-- @module Task_A2A -- @module Tasking.Tasking.Task_A2A
do -- TASK_A2A do -- TASK_A2A

View File

@ -10,7 +10,7 @@
-- --
-- === -- ===
-- --
-- @module Task_A2A_Dispatcher -- @module Tasking.Task_A2A_Dispatcher
do -- TASK_A2A_DISPATCHER do -- TASK_A2A_DISPATCHER

View File

@ -8,7 +8,7 @@
-- --
-- === -- ===
-- --
-- @module Task_A2G -- @module Tasking.Task_A2G
do -- TASK_A2G do -- TASK_A2G

View File

@ -8,7 +8,7 @@
-- --
-- === -- ===
-- --
-- @module Task_A2G_Dispatcher -- @module Tasking.Task_A2G_Dispatcher
do -- TASK_A2G_DISPATCHER do -- TASK_A2G_DISPATCHER

View File

@ -3,6 +3,8 @@
-- ![Banner Image](..\Presentations\TASK_CARGO\Dia1.JPG) -- ![Banner Image](..\Presentations\TASK_CARGO\Dia1.JPG)
-- --
-- === -- ===
--
-- @module Tasking.Task_Cargo_CSAR
do -- TASK_CARGO_CSAR do -- TASK_CARGO_CSAR

View File

@ -8,7 +8,7 @@
-- --
-- === -- ===
-- --
-- @module Task_Cargo_Dispatcher -- @module Tasking.Task_Cargo_Dispatcher
do -- TASK_CARGO_DISPATCHER do -- TASK_CARGO_DISPATCHER

View File

@ -3,7 +3,7 @@
-- ![Banner Image](..\Presentations\TASK_CARGO\Dia1.JPG) -- ![Banner Image](..\Presentations\TASK_CARGO\Dia1.JPG)
-- --
-- === -- ===
-- @module -- @module Tasking.Task_Cargo_Transport
do -- TASK_CARGO_TRANSPORT do -- TASK_CARGO_TRANSPORT

View File

@ -29,7 +29,7 @@
-- ### Contributions: Mechanist, Prof_Hilactic, FlightControl - Concept & Testing -- ### Contributions: Mechanist, Prof_Hilactic, FlightControl - Concept & Testing
-- ### Author: FlightControl - Framework Design & Programming -- ### Author: FlightControl - Framework Design & Programming
-- --
-- @module Task_Manager -- @module Tasking.Task_Manager
do -- TASK_MANAGER do -- TASK_MANAGER

View File

@ -1,132 +0,0 @@
--- This module contains the TASK_PICKUP classes.
--
-- 1) @{#TASK_PICKUP} class, extends @{Task#TASK}
-- ===
-- The @{#TASK_PICKUP} class defines a pickup task of a @{Set} of @{CARGO} objects defined within the mission.
-- based on the tasking capabilities defined in @{Task#TASK}.
-- The TASK_PICKUP is implemented using a @{Statemachine#FSM_TASK}, and has the following statuses:
--
-- * **None**: Start of the process
-- * **Planned**: The SEAD task is planned. Upon Planned, the sub-process @{Process_Fsm.Assign#ACT_ASSIGN_ACCEPT} is started to accept the task.
-- * **Assigned**: The SEAD task is assigned to a @{Wrapper.Group#GROUP}. Upon Assigned, the sub-process @{Process_Fsm.Route#ACT_ROUTE} is started to route the active Units in the Group to the attack zone.
-- * **Success**: The SEAD task is successfully completed. Upon Success, the sub-process @{Process_SEAD#PROCESS_SEAD} is started to follow-up successful SEADing of the targets assigned in the task.
-- * **Failed**: The SEAD task has failed. This will happen if the player exists the task early, without communicating a possible cancellation to HQ.
--
-- ===
--
-- ### Authors: FlightControl - Design and Programming
--
-- @module Task_PICKUP
do -- TASK_PICKUP
--- The TASK_PICKUP class
-- @type TASK_PICKUP
-- @extends Tasking.Task#TASK
TASK_PICKUP = {
ClassName = "TASK_PICKUP",
}
--- Instantiates a new TASK_PICKUP.
-- @param #TASK_PICKUP self
-- @param Tasking.Mission#MISSION Mission
-- @param Core.Set#SET_GROUP AssignedSetGroup The set of groups for which the Task can be assigned.
-- @param #string TaskName The name of the Task.
-- @param #string TaskType BAI or CAS
-- @param Core.Set#SET_UNIT UnitSetTargets
-- @param Core.Zone#ZONE_BASE TargetZone
-- @return #TASK_PICKUP self
function TASK_PICKUP:New( Mission, AssignedSetGroup, TaskName, TaskType )
local self = BASE:Inherit( self, TASK:New( Mission, AssignedSetGroup, TaskName, TaskType, "PICKUP" ) )
self:F()
return self
end
--- Removes a TASK_PICKUP.
-- @param #TASK_PICKUP self
-- @return #nil
function TASK_PICKUP:CleanUp()
self:GetParent( self ):CleanUp()
return nil
end
--- Assign the @{Task} to a @{Wrapper.Unit}.
-- @param #TASK_PICKUP self
-- @param Wrapper.Unit#UNIT TaskUnit
-- @return #TASK_PICKUP self
function TASK_PICKUP:AssignToUnit( TaskUnit )
self:F( TaskUnit:GetName() )
local ProcessAssign = self:AddProcess( TaskUnit, ACT_ASSIGN_ACCEPT:New( self, TaskUnit, self.TaskBriefing ) )
local ProcessPickup = self:AddProcess( TaskUnit, PROCESS_PICKUP:New( self, self.TaskType, TaskUnit ) )
local Process = self:AddStateMachine( TaskUnit, FSM_TASK:New( self, TaskUnit, {
initial = 'None',
events = {
{ name = 'Next', from = 'None', to = 'Planned' },
{ name = 'Next', from = 'Planned', to = 'Assigned' },
{ name = 'Next', from = 'Assigned', to = 'Success' },
{ name = 'Fail', from = 'Assigned', to = 'Failed' },
},
callbacks = {
onNext = self.OnNext,
},
subs = {
Assign = { onstateparent = 'Planned', oneventparent = 'Next', fsm = ProcessAssign.Fsm, event = 'Start', returnevents = { 'Next', 'Reject' } },
Pickup = { onstateparent = 'Assigned', oneventparent = 'Next', fsm = ProcessDestroy.Fsm, event = 'Start', returnevents = { 'Next' } },
}
} ) )
ProcessRoute:AddScore( "Failed", "failed to destroy a ground unit", -100 )
ProcessDestroy:AddScore( "Pickup", "Picked-Up a Cargo", 25 )
ProcessDestroy:AddScore( "Failed", "failed to destroy a ground unit", -100 )
Process:Next()
return self
end
--- StateMachine callback function for a TASK
-- @param #TASK_PICKUP self
-- @param Core.Fsm#FSM_TASK Fsm
-- @param #string Event
-- @param #string From
-- @param #string To
-- @param Core.Event#EVENTDATA Event
function TASK_PICKUP:OnNext( Fsm, From, Event, To, Event )
self:SetState( self, "State", To )
end
--- @param #TASK_PICKUP self
function TASK_PICKUP:GetPlannedMenuText()
return self:GetStateString() .. " - " .. self:GetTaskName() .. " ( " .. self.TargetSetUnit:GetUnitTypesText() .. " )"
end
--- @param #TASK_PICKUP self
function TASK_PICKUP:_Schedule()
self:F2()
self.TaskScheduler = SCHEDULER:New( self, _Scheduler, {}, 15, 15 )
return self
end
--- @param #TASK_PICKUP self
function TASK_PICKUP._Scheduler()
self:F2()
return true
end
end