Numba random
Numba-accelerated random connection builder for intra-group social networks.
Implements the intra_geo_unit and activity_peers network types.
build_activity_peers(world, network_config)
Random connections among people sharing an activity venue.
Required network_config keys
pool_type – must be "activity" pool.activity – activity key in person.activity_map mean_count – target mean connections per person storage_key – key for person.properties
Optional: degree_variants – list of {probability, count} for heterogeneous degree assign_activity – dict with contact_activity_key and activity_key
Source code in may/social_networks/builder_functions/numba_random.py
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 | |
build_intra_geo_unit(world, network_config)
Random connections within geographic units at a specified level.
Required network_config keys
pool_type – must be "geographic" pool.level – e.g. "SGU", "MGU" mean_count – target mean connections per person storage_key – key for person.properties
Optional: degree_variants – list of {probability, count} for heterogeneous degree assign_activity – dict with contact_activity_key and activity_key
Source code in may/social_networks/builder_functions/numba_random.py
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 | |