class update_peak_immunity(people, inds, imm_pars, imm_source, offset=None, infection=True)[source]#

Update immunity level

This function updates the immunity for individuals when an infection is cleared or vaccination occurs.
  • individuals that are infected and already have immunity from a previous vaccination/infection have their immunity level;

  • individuals without prior immunity are assigned an initial level drawn from a distribution. This level

    depends on whether the immunity is from a natural infection or from a vaccination (and if so, on the type of vaccine).

  • people – A people object

  • inds – Array of people indices

  • imm_pars – Parameters from which to draw values for quantities like [‘imm_init’] - either sim pars (for natural immunity) or vaccine pars

  • imm_source – index of either genotype or vaccine where immunity is coming from

Returns: None