synthetic_network
Module that generates a MNO synthetic network.
CellIDGenerator
Abstract class for cell ID generation.
Source code in multimno/components/ingestion/synthetic/synthetic_network.py
19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 |
|
__init__(rng)
Cell ID Generator constructor
Parameters:
Name | Type | Description | Default |
---|---|---|---|
rng
|
Union[int, Random]
|
either an integer to act as a seed for RNG, or an instantiated Random object. |
required |
Source code in multimno/components/ingestion/synthetic/synthetic_network.py
24 25 26 27 28 29 30 31 32 33 |
|
generate_cell_ids(n_cells)
abstractmethod
Method that generates random cell IDs.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
n_cells
|
int
|
number of cell IDs to generate. |
required |
Returns:
Type | Description |
---|---|
List[str]
|
List[str]: list of cell IDs. |
Source code in multimno/components/ingestion/synthetic/synthetic_network.py
35 36 37 38 39 40 41 42 43 44 45 |
|
CellIDGeneratorBuilder
Type/method of cell ID generation enumeration class.
Source code in multimno/components/ingestion/synthetic/synthetic_network.py
66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 |
|
build(constructor_key, rng)
staticmethod
Method that builds a CellIDGenerator.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
constructor_key
|
str
|
Key of the constructor |
required |
rng
|
Union[int, Random]
|
either an integer to act as a seed for RNG, or an instantiated Random object. |
required |
Raises:
Type | Description |
---|---|
ValueError
|
If the given constructor_key is not supported |
Returns:
Name | Type | Description |
---|---|---|
CellIDGenerator |
CellIDGenerator
|
Class that generates random cell_id's |
Source code in multimno/components/ingestion/synthetic/synthetic_network.py
75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 |
|
RandomCellIDGenerator
Bases: CellIDGenerator
Class that generates completely random cell IDs. Inherits from the AbstractCellIDGenerator class.
Source code in multimno/components/ingestion/synthetic/synthetic_network.py
48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 |
|
generate_cell_ids(n_cells)
Generate UNIQUE random cell IDs with no logic behind it, i.e. not following CGI/eCGI standards. The resuling cell IDs are 14- or 15-digit strings.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
n_cells
|
int
|
number of cell IDs to generate. |
required |
Returns:
Type | Description |
---|---|
List[str]
|
List[str]: list of cell IDs. |
Source code in multimno/components/ingestion/synthetic/synthetic_network.py
53 54 55 56 57 58 59 60 61 62 63 |
|
SyntheticNetwork
Bases: Component
Class that generates the synthetic network topology data. It inherits from the Component abstract class.
Source code in multimno/components/ingestion/synthetic/synthetic_network.py
98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 |
|
clean_cells_generator()
Method that generates valid and fully complete (mandatory and optional) cell physical attibutes.
An underlying set of cells are created, covering the config-specified date interval. Then, for each cell and date, the valid_date_start and valid_date_end fields, marking the time interval in which the cell is operational, are comparted with the date: a) If date < valid_date_start, the cell-date row will not appear. b) If valid_date_start <= date < valid_date_end, the cell-date row will appear and the valid_date_end will be null, as the cell was currently operational c) If valid_date_end <= date, the cell-date row will appear and the valid_date_end will NOT be null, marking the past, now known, time interval of operation.
Yields:
Type | Description |
---|---|
( cell_id (str), latitude (float), longitude (float), altitudes (float), antenna_height (float), directionality (int), azimuth_angle (float | None), elevation_angle (float), hor_beam_width (float), ver_beam_width (float), power (float), range (float), frequency (int), technology (str), valid_date_start (str), valid_date_end (str | None) cell_type (str), year (int), month (int), day (int) |
|
) |
Source code in multimno/components/ingestion/synthetic/synthetic_network.py
192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 |
|
generate_erroneous_values(df)
Function that generates erroneous values in the cell_id, valid_date_start and valid_date_end columns
Parameters:
Name | Type | Description | Default |
---|---|---|---|
df
|
DataFrame
|
DataFrame before the generation of erroneous values |
required |
Returns:
Name | Type | Description |
---|---|---|
DataFrame |
DataFrame
|
DataFrame with erroneous values |
Source code in multimno/components/ingestion/synthetic/synthetic_network.py
491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 |
|
generate_errors(df)
Function handling the generation of out-of-bounds, null and erroneous values in different columns according to the config-specified probabilities
Parameters:
Name | Type | Description | Default |
---|---|---|---|
df
|
DataFrame
|
clean DataFrame |
required |
Returns:
Name | Type | Description |
---|---|---|
DataFrame |
DataFrame
|
DataFrame after the generation of different invalid or null values |
Source code in multimno/components/ingestion/synthetic/synthetic_network.py
332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 |
|
generate_nulls_in_mandatory_columns(df)
Generates null values in the mandatory fields based on probabilities form config
Parameters:
Name | Type | Description | Default |
---|---|---|---|
df
|
DataFrame
|
synthetic dataframe |
required |
Returns:
Name | Type | Description |
---|---|---|
DataFrame |
DataFrame
|
synthetic dataframe with nulls in some mandatory fields |
Source code in multimno/components/ingestion/synthetic/synthetic_network.py
354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 |
|
generate_out_of_bounds_values(df)
Function that generates out-of-bounds values for the appropriate columns of the data object
Parameters:
Name | Type | Description | Default |
---|---|---|---|
df
|
DataFrame
|
cell dataframe with in-bound values |
required |
Returns:
Name | Type | Description |
---|---|---|
DataFrame |
DataFrame
|
cell dataframe with some out-of-bounds values |
Source code in multimno/components/ingestion/synthetic/synthetic_network.py
374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 |
|