Auxiliary methods

Auxiliary methods#

Functions for the auxiliary operations.

set_rng_seed(seed: int) None#

Fix pseudo-random number generator seed for reproducible tests.

Metrics used to assess the diffusion.

compute_area(expositions_rec: list[int], actors_nb: int, trim_tail: bool) float | None#

Compute norm. AuC from expositions while seed set impact is discarded.

Parameters:
  • expositions_rec – record of NEW activations in each simulation step

  • actors_nb – number of actors in the network

  • trim_tail – a flag indicating whether to consider last elements of the record which have the same value

Returns:

area under the cumulated activations curve in range [0, 1]

compute_gain(exposed_nb: int, seeds_nb: int, actors_nb: int) float#

Compute gain from simulation to reflect relative spreading coverage.

Parameters:
  • exposed_nb – number of activated actors during simulation

  • seeds_nb – size of the seed set

  • actors_nb – total number of actors in the network

Returns:

gain in range [0, 1]