mirror of
https://github.com/FlightControl-Master/MOOSE.git
synced 2025-10-29 16:58:06 +00:00
Updated Scheduler and documentation.
-- Added SCHEDULER.Schedule method. -- Reworked SCHEDULER.New method. -- Renamed Mechanic to Mechanist.
This commit is contained in:
parent
cf8d105b33
commit
b283406274
@ -23,22 +23,24 @@
|
||||
-- 1.3) AIBALANCER allows AI to patrol specific zones:
|
||||
-- ---------------------------------------------------
|
||||
-- Use @{AIBalancer#AIBALANCER.SetPatrolZone}() to specify a zone where the AI needs to patrol.
|
||||
--
|
||||
--
|
||||
-- ===
|
||||
--
|
||||
-- CREDITS
|
||||
-- =======
|
||||
-- **Dutch_Baron (James)** Who you can search on the Eagle Dynamics Forums.
|
||||
-- Working together with James has resulted in the creation of the AIBALANCER class.
|
||||
-- James has shared his ideas on balancing AI with air units, and together we made a first design which you can use now :-)
|
||||
-- ### Contributions:
|
||||
--
|
||||
-- **SNAFU**
|
||||
-- Had a couple of mails with the guys to validate, if the same concept in the GCI/CAP script could be reworked within MOOSE.
|
||||
-- None of the script code has been used however within the new AIBALANCER moose class.
|
||||
-- * **Dutch_Baron (James)** Who you can search on the Eagle Dynamics Forums.
|
||||
-- Working together with James has resulted in the creation of the AIBALANCER class.
|
||||
-- James has shared his ideas on balancing AI with air units, and together we made a first design which you can use now :-)
|
||||
--
|
||||
-- * **SNAFU**
|
||||
-- Had a couple of mails with the guys to validate, if the same concept in the GCI/CAP script could be reworked within MOOSE.
|
||||
-- None of the script code has been used however within the new AIBALANCER moose class.
|
||||
--
|
||||
-- ### Authors:
|
||||
--
|
||||
-- * FlightControl - Framework Design & Programming
|
||||
--
|
||||
-- @module AIBalancer
|
||||
-- @author FlightControl
|
||||
|
||||
--- AIBALANCER class
|
||||
-- @type AIBALANCER
|
||||
|
||||
@ -49,8 +49,10 @@
|
||||
-- * Creech
|
||||
-- * Groom Lake
|
||||
--
|
||||
-- ### Contributions: Dutch Baron - Concept & Testing
|
||||
-- ### Author: FlightControl - Framework Design & Programming
|
||||
--
|
||||
-- @module AirbasePolice
|
||||
-- @author Flight Control & DUTCH BARON
|
||||
|
||||
|
||||
|
||||
|
||||
@ -63,8 +63,13 @@
|
||||
--
|
||||
-- ===
|
||||
--
|
||||
-- ### Contributions: Mechanic - Concept & Testing
|
||||
-- ### Authors: FlightControl : Design & Programming
|
||||
-- ### Contributions:
|
||||
--
|
||||
-- * Mechanist : Concept & Testing
|
||||
--
|
||||
-- ### Authors:
|
||||
--
|
||||
-- * FlightControl : Design & Programming
|
||||
--
|
||||
-- @module Detection
|
||||
|
||||
|
||||
@ -54,7 +54,7 @@
|
||||
--
|
||||
-- ===
|
||||
--
|
||||
-- ### Contributions: Mechanic, Prof_Hilactic, FlightControl - Concept & Testing
|
||||
-- ### Contributions: Mechanist, Prof_Hilactic, FlightControl - Concept & Testing
|
||||
-- ### Author: FlightControl - Framework Design & Programming
|
||||
--
|
||||
-- @module DetectionManager
|
||||
|
||||
@ -33,27 +33,20 @@ function PROCESS:New( ProcessName, Task, ProcessUnit )
|
||||
self.Task = Task
|
||||
self.ProcessName = ProcessName
|
||||
|
||||
self.AllowEvents = true
|
||||
self.ProcessScheduler = SCHEDULER:New( self.Fsm, self.NextEvent )
|
||||
|
||||
return self
|
||||
end
|
||||
|
||||
--- @param #PROCESS self
|
||||
function PROCESS:NextEvent( NextEvent, ... )
|
||||
if self.AllowEvents == true then
|
||||
self.ProcessScheduler = SCHEDULER:New( self.Fsm, NextEvent, arg, 1 )
|
||||
end
|
||||
self.ProcessScheduler:Schedule( arg, 1 ) -- This schedules the next event, but only if scheduling is activated.
|
||||
end
|
||||
|
||||
--- @param #PROCESS self
|
||||
function PROCESS:StopEvents( )
|
||||
self:F2()
|
||||
if self.ProcessScheduler then
|
||||
self:E( "Stop" )
|
||||
self.ProcessScheduler:Stop()
|
||||
self.ProcessScheduler = nil
|
||||
self.AllowEvents = false
|
||||
end
|
||||
function PROCESS:StopEvents()
|
||||
self:F( { "Stop Process ", self.ProcessName } )
|
||||
self.ProcessScheduler:Stop()
|
||||
end
|
||||
|
||||
--- Adds a score for the PROCESS to be achieved.
|
||||
|
||||
@ -17,8 +17,23 @@
|
||||
-- * @{Scheduler#SCHEDULER.Start}: (Re-)Start the scheduler.
|
||||
-- * @{Scheduler#SCHEDULER.Stop}: Stop the scheduler.
|
||||
--
|
||||
-- 1.3) Reschedule new time event
|
||||
-- ------------------------------
|
||||
-- With @{Scheduler#SCHEDULER.Schedule} a new time event can be scheduled.
|
||||
--
|
||||
-- ===
|
||||
--
|
||||
-- ### Contributions:
|
||||
--
|
||||
-- * Mechanist : Concept & Testing
|
||||
--
|
||||
-- ### Authors:
|
||||
--
|
||||
-- * FlightControl : Design & Programming
|
||||
--
|
||||
-- ===
|
||||
--
|
||||
-- @module Scheduler
|
||||
-- @author FlightControl
|
||||
|
||||
|
||||
--- The SCHEDULER class
|
||||
@ -45,31 +60,34 @@ function SCHEDULER:New( TimeEventObject, TimeEventFunction, TimeEventFunctionArg
|
||||
|
||||
self.TimeEventObject = TimeEventObject
|
||||
self.TimeEventFunction = TimeEventFunction
|
||||
|
||||
self:Schedule( TimeEventFunctionArguments, StartSeconds, RepeatSecondsInterval, RandomizationFactor, StopSeconds )
|
||||
|
||||
self:Start()
|
||||
|
||||
return self
|
||||
end
|
||||
|
||||
--- Schedule a new time event. Note that the schedule will only take place if the scheduler is *started*. Even for a single schedule event, the scheduler needs to be started also.
|
||||
-- @param #SCHEDULER self
|
||||
-- @param #table TimeEventFunctionArguments Optional arguments that can be given as part of scheduler. The arguments need to be given as a table { param1, param 2, ... }.
|
||||
-- @param #number StartSeconds Specifies the amount of seconds that will be waited before the scheduling is started, and the event function is called.
|
||||
-- @param #number RepeatSecondsInterval Specifies the interval in seconds when the scheduler will call the event function.
|
||||
-- @param #number RandomizationFactor Specifies a randomization factor between 0 and 1 to randomize the RepeatSecondsInterval.
|
||||
-- @param #number StopSeconds Specifies the amount of seconds when the scheduler will be stopped.
|
||||
-- @return #SCHEDULER self
|
||||
function SCHEDULER:Schedule( TimeEventFunctionArguments, StartSeconds, RepeatSecondsInterval, RandomizationFactor, StopSeconds )
|
||||
self:F2( { TimeEventFunctionArguments, StartSeconds, RepeatSecondsInterval, RandomizationFactor, StopSeconds } )
|
||||
|
||||
self.TimeEventFunctionArguments = TimeEventFunctionArguments
|
||||
self.StartSeconds = StartSeconds
|
||||
self.Repeat = false
|
||||
|
||||
if RepeatSecondsInterval then
|
||||
self.RepeatSecondsInterval = RepeatSecondsInterval
|
||||
else
|
||||
self.RepeatSecondsInterval = 0
|
||||
end
|
||||
|
||||
if RandomizationFactor then
|
||||
self.RandomizationFactor = RandomizationFactor
|
||||
else
|
||||
self.RandomizationFactor = 0
|
||||
end
|
||||
|
||||
if StopSeconds then
|
||||
self.StopSeconds = StopSeconds
|
||||
end
|
||||
|
||||
self.RepeatSecondsInterval = RepeatSecondsInterval or 0
|
||||
self.RandomizationFactor = RandomizationFactor or 0
|
||||
self.StopSeconds = StopSeconds
|
||||
|
||||
self.StartTime = timer.getTime()
|
||||
|
||||
self:Start()
|
||||
|
||||
return self
|
||||
end
|
||||
|
||||
|
||||
@ -218,8 +218,15 @@
|
||||
--
|
||||
-- ====
|
||||
--
|
||||
-- ### Contributions:
|
||||
--
|
||||
-- * Mechanist : Concept & Testing
|
||||
--
|
||||
-- ### Authors:
|
||||
--
|
||||
-- * FlightControl : Design & Programming
|
||||
--
|
||||
-- @module Set
|
||||
-- @author FlightControl
|
||||
|
||||
|
||||
--- SET_BASE class
|
||||
|
||||
@ -22984,7 +22984,7 @@ end
|
||||
-- It suports the following functionality:
|
||||
--
|
||||
-- * Track the missiles fired at you and other players, providing bearing and range information of the missiles towards the airplanes.
|
||||
-- * Provide alerts of missile launches, including detailed information of the units launching, including bearing, range …
|
||||
-- * Provide alerts of missile launches, including detailed information of the units launching, including bearing, range <EFBFBD>
|
||||
-- * Provide alerts when a missile would have killed your aircraft.
|
||||
-- * Provide alerts when the missile self destructs.
|
||||
-- * Enable / Disable and Configure the Missile Trainer using the various menu options.
|
||||
@ -25434,7 +25434,7 @@ end
|
||||
--
|
||||
-- ===
|
||||
--
|
||||
-- ### Contributions: Mechanic - Concept & Testing
|
||||
-- ### Contributions: Mechanist - Concept & Testing
|
||||
-- ### Authors: FlightControl : Design & Programming
|
||||
--
|
||||
-- @module Detection
|
||||
@ -26405,7 +26405,7 @@ end
|
||||
--
|
||||
-- ===
|
||||
--
|
||||
-- ### Contributions: Mechanic, Prof_Hilactic, FlightControl - Concept & Testing
|
||||
-- ### Contributions: Mechanist, Prof_Hilactic, FlightControl - Concept & Testing
|
||||
-- ### Author: FlightControl - Framework Design & Programming
|
||||
--
|
||||
-- @module DetectionManager
|
||||
|
||||
@ -22984,7 +22984,7 @@ end
|
||||
-- It suports the following functionality:
|
||||
--
|
||||
-- * Track the missiles fired at you and other players, providing bearing and range information of the missiles towards the airplanes.
|
||||
-- * Provide alerts of missile launches, including detailed information of the units launching, including bearing, range …
|
||||
-- * Provide alerts of missile launches, including detailed information of the units launching, including bearing, range <EFBFBD>
|
||||
-- * Provide alerts when a missile would have killed your aircraft.
|
||||
-- * Provide alerts when the missile self destructs.
|
||||
-- * Enable / Disable and Configure the Missile Trainer using the various menu options.
|
||||
@ -25434,7 +25434,7 @@ end
|
||||
--
|
||||
-- ===
|
||||
--
|
||||
-- ### Contributions: Mechanic - Concept & Testing
|
||||
-- ### Contributions: Mechanist - Concept & Testing
|
||||
-- ### Authors: FlightControl : Design & Programming
|
||||
--
|
||||
-- @module Detection
|
||||
@ -26405,7 +26405,7 @@ end
|
||||
--
|
||||
-- ===
|
||||
--
|
||||
-- ### Contributions: Mechanic, Prof_Hilactic, FlightControl - Concept & Testing
|
||||
-- ### Contributions: Mechanist, Prof_Hilactic, FlightControl - Concept & Testing
|
||||
-- ### Author: FlightControl - Framework Design & Programming
|
||||
--
|
||||
-- @module DetectionManager
|
||||
|
||||
@ -22761,7 +22761,7 @@ end
|
||||
-- It suports the following functionality:
|
||||
--
|
||||
-- * Track the missiles fired at you and other players, providing bearing and range information of the missiles towards the airplanes.
|
||||
-- * Provide alerts of missile launches, including detailed information of the units launching, including bearing, range …
|
||||
-- * Provide alerts of missile launches, including detailed information of the units launching, including bearing, range <EFBFBD>
|
||||
-- * Provide alerts when a missile would have killed your aircraft.
|
||||
-- * Provide alerts when the missile self destructs.
|
||||
-- * Enable / Disable and Configure the Missile Trainer using the various menu options.
|
||||
@ -25211,7 +25211,7 @@ end
|
||||
--
|
||||
-- ===
|
||||
--
|
||||
-- ### Contributions: Mechanic - Concept & Testing
|
||||
-- ### Contributions: Mechanist - Concept & Testing
|
||||
-- ### Authors: FlightControl : Design & Programming
|
||||
--
|
||||
-- @module Detection
|
||||
@ -26184,7 +26184,7 @@ end
|
||||
--
|
||||
-- ===
|
||||
--
|
||||
-- ### Contributions: Mechanic, Prof_Hilactic, FlightControl - Concept & Testing
|
||||
-- ### Contributions: Mechanist, Prof_Hilactic, FlightControl - Concept & Testing
|
||||
-- ### Author: FlightControl - Framework Design & Programming
|
||||
--
|
||||
-- @module DetectionManager
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user