class BaseVaccination(vaccine, label=None, **kwargs)[source]#

Bases: Intervention

Apply a vaccine to a subset of the population.

This base class implements the mechanism of vaccinating people to modify their immunity. It does not implement allocation of the vaccines, which is implemented by derived classes such as cv.vaccinate. The idea is that vaccination involves a series of standard operations to modify cv.People and applications will likely need to modify the vaccine parameters and test potentially complex allocation strategies. These should be accounted for by:

  • Custom vaccine parameters being passed in as a dictionary to the vaccine intervention

  • Custom vaccine allocations being implemented by a derived class overloading BaseVaccination.select_people. Any additional attributes required to manage the allocation can be defined in the derived class. Refer to cv.vaccinate or cv.vaccinate_sequential for an example of how to implement this.

Some quantities are tracked during execution for reporting after running the simulation. These are:

  • doses: the number of vaccine doses per person

  • vaccination_dates: integer; dates of all doses for this vaccine

  • vaccine (dict/str) – which vaccine to use; see below for dict parameters

  • label (str) – if vaccine is supplied as a dict, the name of the vaccine

  • booster (boolean) – whether the vaccine is a booster, i.e. whether vaccinated people are eligible

  • kwargs (dict) – passed to Intervention()

If vaccine is supplied as a dictionary, it must have the following parameters:

EITHER - nab_init: the initial antibody level (higher = more protection) - nab_boost: how much of a boost being vaccinated on top of a previous dose or natural infection provides OR - target_eff: the target efficacy from which to calculate initial antibody and boosting. must be supplied as a list, where length of list is equal to number of doses - nab_eff: the waning efficacy of neutralizing antibodies at preventing infection - doses: the number of doses required to be fully vaccinated with this vaccine - interval: the interval between doses (integer) - entries for efficacy against each of the variants (e.g. b117)

See for additional examples of these parameters.



Ensure variables with large memory footprints get erased


Return an array of indices of people to vaccinate Derived classes must implement this function to determine who to vaccinate at each timestep :type sim: :param sim: A cv.Sim instance

Returns: Array of person indices

vaccinate(sim, vacc_inds, t=None)[source]#

Vaccinate people

This method applies the vaccine to the requested people indices. The indices of people vaccinated is returned. These may be different to the requested indices, because anyone that is dead will be skipped, as well as anyone already fully vaccinated (if booster=False). This could occur if a derived class does not filter out such people in its select_people method.

  • sim – A cv.Sim instance

  • vacc_inds – An array of person indices to vaccinate

  • t – Optionally override the day on which vaccinations are recorded for historical vaccination

Returns: An array of person indices of people vaccinated


Perform vaccination each timestep


Shrink vaccination intervention