mirror of
https://github.com/FlightControl-Master/MOOSE.git
synced 2025-10-29 16:58:06 +00:00
Merge remote-tracking branch 'origin/master' into develop
This commit is contained in:
commit
6e917049af
@ -22,7 +22,7 @@
|
||||
-- @module Functional.Mantis
|
||||
-- @image Functional.Mantis.jpg
|
||||
--
|
||||
-- Last Update: May 2024
|
||||
-- Last Update: July 2024
|
||||
|
||||
-------------------------------------------------------------------------
|
||||
--- **MANTIS** class, extends Core.Base#BASE
|
||||
@ -59,6 +59,7 @@
|
||||
-- @field #number ShoradTime Timer in seconds, how long #SHORAD will be active after a detection inside of the defense range
|
||||
-- @field #number ShoradActDistance Distance of an attacker in meters from a Mantis SAM site, on which Shorad will be switched on. Useful to not give away Shorad sites too early. Default 15km. Should be smaller than checkradius.
|
||||
-- @field #boolean checkforfriendlies If true, do not activate a SAM installation if a friendly aircraft is in firing range.
|
||||
-- @field #table FilterZones Table of Core.Zone#ZONE Zones Consider SAM groups in this zone(s) only for this MANTIS instance, must be handed as #table of Zone objects.
|
||||
-- @extends Core.Base#BASE
|
||||
|
||||
|
||||
|
||||
@ -4049,3 +4049,25 @@ function UTILS.ReadCSV(filename)
|
||||
|
||||
return csvdata
|
||||
end
|
||||
|
||||
--- Seed the LCG random number generator.
|
||||
-- @param #number seed Seed value. Default is a random number using math.random()
|
||||
function UTILS.LCGRandomSeed(seed)
|
||||
UTILS.lcg = {
|
||||
seed = seed or math.random(1, 2^32 - 1),
|
||||
a = 1664525,
|
||||
c = 1013904223,
|
||||
m = 2^32
|
||||
}
|
||||
end
|
||||
|
||||
--- Return a pseudo-random number using the LCG algorithm.
|
||||
-- @return #number Random number between 0 and 1.
|
||||
function UTILS.LCGRandom()
|
||||
if UTILS.lcg == nil then
|
||||
UTILS.LCGRandomSeed()
|
||||
end
|
||||
UTILS.lcg.seed = (UTILS.lcg.a * UTILS.lcg.seed + UTILS.lcg.c) % UTILS.lcg.m
|
||||
return UTILS.lcg.seed / UTILS.lcg.m
|
||||
end
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user