Files
qt5-legatus-legacy/Lts/Services/AreaEffectSimulation/Utils/tne_algorithmen.h
T
2026-08-13 18:33:10 +02:00

84 lines
2.7 KiB
C++
Executable File

/**
* @RDE_HEADER@
* TNE_Algorithemn zur Nachbildung von TNE-Funktionalität, hier Berechnung der Einschlagkoordinaten eines Flächenfeuers
* $Id$
* $HeadURL$
* $Author$
*/
#pragma once
#include <AreaEffectSimulation/aes_export.h>
#include <QVector>
#include <QPointF>
namespace AreaEffectSimulation
{
/**
* @brief This namespace contains some algorithms, which must behave identical on both sides!!!
* Therefore the is an UnitTest with values taken from the TNE: ../UnitTests/UnitTests_TneAlgo
* That was created while Michael Moetje was implementing that code at the TNE (PlayerUnit)
*/
namespace TNE_ALGORITHMEN
{
//
// Hinweise für die Übernahme/Updates des wesentlichen Codes (AWES_FF_IteriereEinschlagkoordinaten2)
//
/* moetje:
"long" -> 32Bit
MTP -> MittlerTrefferPunkt
*/
// some using/typedef to ease updates
using SHORT = qint16;
using USHORT = quint16;
using ULONG = quint32; // TNE ist auf 32Bit Plattform
using LONG = qint32; // TNE ist auf 32Bit Plattform
using INT_AS_CHAR = int;
//
// basic TNE wrapper:
//
/**
* @brief areaExlosionsGAUSS berechnet die Einschläge eines Flächenfeuers entsprechend der Normal-Verteilung, siehe auch TNGUEZSB60__TN-0006_Wirksimulationsmodelle.docx
* @param wirkfeldKennung dient als Startwert für den Zufallzahlen-Generator.
* @param breite in Meter, sollte aber ein Vielfaches von 5m sein, vergleiche ICD.
* @param tiefe in Meter, sollte aber ein Vielfaches von 5m sein, vergleiche ICD.
* @param anzahl_einschlaege Die Anzahl der gewuenschten Einschläge
* @return Einschläge entsprechend der Normal-Verteilung
*/
AES_COMMON_EXPORT QVector<QPointF> areaExlosionsGAUSS(int wirkfeldKennung, int breite_m, int tiefe_m, short anzahl_einschlaege);
/**
* @brief areaExlosionsGAUSS berechnet die Einschläge eines Flächenfeuers entsprechend der Normal-Verteilung, siehe auch TNGUEZSB60__TN-0006_Wirksimulationsmodelle.docx
* @param wirkfeldKennung dient als Startwert für den Zufallzahlen-Generator.
* @param breite in Meter, sollte aber ein Vielfaches von 5m sein, vergleiche ICD.
* @param tiefe in Meter, sollte aber ein Vielfaches von 5m sein, vergleiche ICD.
* @param anzahl_einschlaege Die Anzahl der gewuenschten Einschläge
* @return Einschläge entsprechend der Normal-Verteilung
*/
AES_COMMON_EXPORT QVector<QPointF> areaExlosionsGAUSS_aroundCenter(int wirkfeldKennung, int breite_m, int tiefe_m, short anzahl_einschlaege);
AES_COMMON_EXPORT USHORT xorshift32(ULONG *_px);
AES_COMMON_EXPORT SHORT xorshift32_nv(ULONG *_generator, SHORT _bereich, INT_AS_CHAR _sigmaGrenze);
AES_COMMON_EXPORT SHORT xorshift32_nv_limited(ULONG *_generator, SHORT _bereich, INT_AS_CHAR _sigmaGrenze);
} // namespace TNE_ALGORITHMEN
} // namespace AreaEffectSimulation