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
270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 | |
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
244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 | |