laser.measles.mixing.base
laser.measles.mixing.base
laser.measles.mixing.base.BaseMixing(scenario, params)
Bases: ABC
Base class for migration models.
laser.measles.mixing.base.BaseMixing.migration_matrix
property
Migration matrix computed from get_migration_matrix().
Returns:
| Type | Description |
|---|---|
ndarray
|
np.ndarray: The migration matrix with lazy computation and caching. |
laser.measles.mixing.base.BaseMixing.mixing_matrix
property
Mixing matrix computed from get_mixing_matrix().
Returns:
| Type | Description |
|---|---|
ndarray
|
np.ndarray: The mixing matrix with lazy computation and caching. |
laser.measles.mixing.base.BaseMixing.get_migration_matrix()
abstractmethod
Initialize a migration/diffusion matrix for population mixing. The diffusion matrix is a square matrix where each row represents the outbound migration from a given patch to all other patches e.g., [i,j] = [from_i, to_j].
Convention is: - Trips into node j: N_i @ M[i,j] - Trips out of node i: np.sum(M[i,j] * N_i[:,np.newaxis], axis=1)
Returns:
| Type | Description |
|---|---|
ndarray
|
np.ndarray: The diffusion matrix: (N, N) |
laser.measles.mixing.base.BaseMixing.get_mixing_matrix()
Initialize a mixing matrix for population mixing.
The mixing matrix is a square matrix where each row represents the mixing of a given patch to all other patches e.g., [i,j] = [from_i, to_j]. It also includes internal mixing within a patch.
laser.measles.mixing.base.BaseMixing.trips_into()
Returns the number of trips into each patch per tick.
laser.measles.mixing.base.BaseMixing.trips_out_of()
Returns the number of trips out of each patch per tick.