1#pragma region HEADER_FILES
6#pragma region INTERFERENCE_PARAMETER
29 if (!temp)
return interference_db;
32 if ((temp->
CellId == gNBiID && temp->
PairId == gNBjID) ||
34 double ratio = (dUEgnbj - dUEgnbi) / dUEgnbj;
36 if (ratio >= 0 && ratio <= temp->
DDRth) {
40 double bi = Band * ((double)i);
51 return interference_db;
56 double* Interference,
int CA_ID,
bool isDownlink) {
58 double Interference_linear = 0;
64 if (info->
ueId == r + 1)
81 Interference_linear +=
DBM_TO_MW((rxPower_dbm - In_db));
88 *Interference =
MW_TO_DBM(Interference_linear);
96 char data[BUFSIZ], input[BUFSIZ];
100 char* filename =
"Graded-Distance-Based-Wyner-Interference-Model.txt";
103 fp = fopen(input,
"r");
111 while (fgets(data, BUFSIZ, fp))
117 if (*temp ==
'#' || *temp == 0)
119 bool dev1 =
false, dev2 =
false;
121 char* newline = strchr(temp,
'\n');
if (newline) *newline = 0;
122 char* token = strtok(temp,
",");
131 fprintf(stderr,
"Invalid Input detected in line %d.\n\"%s\" is not a valid Device Name. Please edit the file and re-run simulation. \n"
132 "Press any key to skip this line and continue simulation.\n", line, token);
148 fprintf(stderr,
"Invalid Input detected in line %d.\n\"%s\" is not a valid gNB Device. Please edit the file and re-run simulation. \n"
149 "Press any key to skip this line and continue simulation.\n", line, token);
158 token = strtok(NULL,
",");
163 fprintf(stderr,
"Invalid Input detected in line %d.\n\"%s\" is not a valid Device Name. Please edit the file and re-run simulation. \n"
164 "Press any key to skip this line and continue simulation.\n", line, token);
180 fprintf(stderr,
"Invalid Input detected in line %d.\n\"%s\" is not a valid LTE NR Device. Please edit the file and re-run simulation. \n"
181 "Press any key to skip this line and continue simulation.\n", line, token);
190 token = strtok(NULL,
",");
192 t->
DDRth = strtod(token, NULL);
195 token = strtok(NULL,
",");
196 int bincount = 4, k = 1;
204 token = strtok(NULL,
",");
206 in = strtod(token, NULL);
209 printf(
"\nIncorrect value of Relative Interference"
210 "has been found in line: %d, for Relative Interference -1 Enter value in range of 0 to 10", line);
212 while (k < bincount + 2) {
214 token = strtok(NULL,
",");
216 in = strtod(token, NULL);
220 printf(
"\nIncorrect value of Relative Interference has been found in line: %d, for In %d", line, k - 1);
235 double* Interference,
int layerId,
int CA_ID,
bool isDownlink) {
237 double Interference_linear = 0;
243 if (info->
ueId == r + 1)
275 *Interference =
MW_TO_DBM(Interference_linear);
281 double* Interference,
int layerId,
int CA_ID,
bool isDownlink) {
@ LTENR_GRADED_DISTANCE_BASED_WYNER_MODEL_INTERFERENCE
@ LTENR_EXACT_GEOMETRIC_MODEL_INTERFERENCE
#define LTENR_UEPHY_GET(d, i)
bool isLTENR_RANInterface(NETSIM_ID d, NETSIM_ID in)
bool isLTE_NRInterface(NETSIM_ID d, NETSIM_ID i)
ptrLTENR_PROTODATA LTENR_PROTODATA_GET(NETSIM_ID d, NETSIM_ID in)
bool fn_NetSim_isDeviceLTENR(NETSIM_ID r, NETSIM_ID rin)
#define LTENR_GNBPHY_GET(d, i)
ptrGRADED_DISTANCE_BASED_WYNER_INTERFERENCE GradedDistanceBasedWynerInterferenceheadDownlink
void LTENR_fn_InterferenceInit()
static void LTENR_fn_Graded_Distance_Based_Wyner_Model_Interference(ptrLTENR_PROPAGATIONINFO info, double rxPower_dbm, double *Interference, int CA_ID, bool isDownlink)
void LTENR_Calculate_Interference(ptrLTENR_PROPAGATIONINFO info, double rxPower_dbm, double *Interference, int layerId, int CA_ID, bool isDownlink)
ptrGRADED_DISTANCE_BASED_WYNER_INTERFERENCE GradedDistanceBasedWynerInterferenceheadUplink
static double fn_GetEdgeInterference(NETSIM_ID gNBiID, NETSIM_ID gNBjID, double dUEgnbi, double dUEgnbj, bool isDownlink)
struct stru_GRADED_DISTANCE_BASED_WYNER_INTERFERENCE * ptrGRADED_DISTANCE_BASED_WYNER_INTERFERENCE
void LTENR_fn_ExactGeometricModelInterference(ptrLTENR_PROPAGATIONINFO info, double rxPower_dbm, double *Interference, int layerId, int CA_ID, bool isDownlink)
struct stru_GRADED_DISTANCE_BASED_WYNER_INTERFERENCE GRADED_DISTANCE_BASED_WYNER_INTERFERENCE
ptrLTENR_ASSOCIATEDUEPHYINFO LTENR_ASSOCIATEDUEPHYINFO_GET(NETSIM_ID gnbId, NETSIM_ID gnbIf, NETSIM_ID ueId, NETSIM_ID ueIf)
static const char pathSeperator[5]
NETSIM_ID fn_NetSim_Stack_GetDeviceId_asName(const char *name)
EXPORTED char * pszIOPath
EXPORTED struct stru_NetSim_Network * NETWORK
double * Relative_Intereference_dB
struct stru_GRADED_DISTANCE_BASED_WYNER_INTERFERENCE * next
LTENR_DEVICETYPE deviceType
LTENR_CELL_TYPES SecCellType
ptrLTENR_PROPAGATIONINFO propagationInfo[MAX_CA_COUNT]
ptrLTENR_PROPAGATIONCONFIG propagationConfig
LTENR_CELL_INTERFERENCEACE_TYPE DownlinkInterferenceModel
struct stru_LTENR_propagationInfo::stru_powers uplink
__IN__ double centralFrequency_MHz
struct stru_LTENR_propagationInfo::stru_powers downlink