Interface PersonState

All Superinterfaces:
Abstraction.TemporalState<Person>, PersonTemporalState, Serializable
All Known Implementing Classes:
ImmutablePersonState

@Immutable public interface PersonState extends PersonTemporalState
The person's current state is updated in each round of the simulation. It holds data on transmission, mobility, compliance, app use, and transient values such as exposure to virus and immunisation doses. It also holds the in host viral load model which is also updated on each round of simulation. The current state also includes a risk model which analyses current observed data about the patient's history.
  • Field Details

    • MAX_EXPOSURE

      static final double MAX_EXPOSURE
      This is the maximum exposure an individual can experience in a single day in normalised units, where 1 is an average dose, and 0 is the minimum. If this value is too high multiple exposures aggregate and dose dependent effects become important
      See Also:
  • Method Details

    • getTransmissibilityModifier

      @Default default double getTransmissibilityModifier()
      An odds ratio of transmission that modifies the baseline probability of transmission to another person
    • getMobilityModifier

      @Default default double getMobilityModifier()
      An odds ratio of mobility that modifies the baseline contact probability
    • getComplianceModifier

      @Default default double getComplianceModifier()
      An odds ratio of compliance that modifies the baseline compliance probability that the person is going to follow guidance.
    • getSusceptibilityModifier

      @Default default double getSusceptibilityModifier()
      An odds ratio of that modifies the baseline probability of transmission from another person to this one
    • getAppUseModifier

      @Default default double getAppUseModifier()
      An odds ratio that modifies the baseline probability that the person is using a smart agent to record data, and get personalised guidance
    • getImportationExposure

      @Default default double getImportationExposure()
      A viral exposure as a result of importation this may be the result of a time varying function representing external drivers.
    • getImmunisationDose

      @Default default double getImmunisationDose()
      An immunisation dose is a fraction of dormant immune cells that are activated by any immunising exposure in the previous day. Setting this to something non zero implies that the person was immunised at this time point. It is cleared after every timestep by the Updater.
    • getInHostModel

      InHostModelState<?> getInHostModel()
    • getRiskModel

      @Default default RiskModel getRiskModel()
    • getNormalisedSeverity

      default double getNormalisedSeverity()
      A normalised severity index where 1 is symptomatic (excepting symptom ascertainment error.)
      Specified by:
      getNormalisedSeverity in interface PersonTemporalState
    • getNormalisedViralLoad

      default double getNormalisedViralLoad()
      A normalised viral load index where 1 is infectious.
      Specified by:
      getNormalisedViralLoad in interface PersonTemporalState
    • isInfectious

      @Derived default boolean isInfectious()
      Is the persons internal viral load above the threshold for potential infectivity.
      Specified by:
      isInfectious in interface PersonTemporalState
    • isSymptomatic

      @Derived default boolean isSymptomatic()
      Is the persons in-host state above the calibrated threshold for exhibiting symptoms on this day and symptom sensitivity and specificity are taken into account. This will be non deterministic
      Specified by:
      isSymptomatic in interface PersonTemporalState
    • isRequiringHospitalisation

      @Derived default boolean isRequiringHospitalisation()
      Is the persons in-host state above the threshold for requiring hospitalisation on this day. This is deterministic on the result of the in-host model at the moment.
      Specified by:
      isRequiringHospitalisation in interface PersonTemporalState
    • isDead

      @Derived default boolean isDead()
      The person is dead
      Specified by:
      isDead in interface PersonTemporalState
    • isReportedSymptomatic

      @Derived default boolean isReportedSymptomatic()
      The user has reported symptoms via the app. This means their symptom state can inform local estimates of prevalence.
      Specified by:
      isReportedSymptomatic in interface PersonTemporalState
    • isSymptomaticConsecutively

      default boolean isSymptomaticConsecutively(int days)
      Is a person symptomatic for a number of days in a row
    • getAdjustedMobility

      default double getAdjustedMobility()
      Probability of contact given a fully mobile partner on a per day basis. The joint probability between 2 people within a social network will define the likelihood of a contact (Plus some randomness). A high mobility means a high probability of contact.
    • getAbsoluteMobilityDecrease

      default double getAbsoluteMobilityDecrease()
    • getAdjustedAppUseProbability

      default double getAdjustedAppUseProbability()
      Probability of use of an app at any given point in time on a per day basis.
    • getAdjustedTransmissibility

      default double getAdjustedTransmissibility()
      Probability of transmission given a contact with a completely unprotected person. A lower value means less likely transmission. This is a combination of several factors, the R0 and structure of the social network, the exogenous factors such as weather, endogenous factors such as inherent susceptibility due to age, and time varying behavioural factors such as mask wearing.
    • getAdjustedCompliance

      default double getAdjustedCompliance()
      A probability that a person is compliant to guidance on any give day.
    • getAbsoluteComplianceDecrease

      default double getAbsoluteComplianceDecrease()
    • isLastTestExactly

      default boolean isLastTestExactly(TestResult.Result result)
      It determines if the most recent test regardless of whether there is a result or it is still pending. This is how it needs to be for determining whether or not to do another test and is used in the testing strategies. It is a bad choice for anything else.
    • isCompliant

      default boolean isCompliant(Sampler rng)
    • isCompliant

      @Derived default boolean isCompliant()
    • isUsingAppToday

      default boolean isUsingAppToday(Sampler rng)
    • isUsingAppToday

      @Derived default boolean isUsingAppToday()
    • getBehaviour

      @Lazy default String getBehaviour()
    • getContactExposure

      @Lazy default double getContactExposure()
      A normalised viral load dose, this is converted into virion numbers later and it is the sum of all the exposures over the course of a day. This is always going to work one day behind as the viral load model can only pick up the change for the next day. This is derived form the contact network when that is initialised. N.B. the dose maxes out at 20 times the infectious viral load. This prevents ridiculously large initial viral doses when uncontrolled exponential growth. I could have done this in the getEposure() method of contact to control the maximum amount one individual can expose another by.
      Specified by:
      getContactExposure in interface PersonTemporalState
      Returns:
    • getTotalExposure

      default double getTotalExposure()
      Exposure due to contact and importation
    • isRecentlyTested

      default boolean isRecentlyTested(TestResult.Type type)
      Looks at whether there are any tests of specified type within the last x days.
    • isRecentlyTested

      default boolean isRecentlyTested(TestResult.Type type, int days)
    • getPresumedLocalPrevalence

      @Lazy default double getPresumedLocalPrevalence()
      Estimate the local prevalence for an individual. This is average of all this person's contacts presumed probability of being infectious. I.e. if a contact has a positive test result their risk will be higher, and this will .
      Specified by:
      getPresumedLocalPrevalence in interface PersonTemporalState
    • getTrueLocalPrevalence

      @Lazy default double getTrueLocalPrevalence()
      How many people in this persons recent contacts are infectious regardless of whether on not the contact is detected. This integrates over approx one infectious period (0.95 quantile) so will be lagged.
    • getProbabilityInfectiousToday

      default double getProbabilityInfectiousToday()
      This is the risk that this individual is infectious today. This is the risk calculated from observable data such as reported symptoms, test results and detected contacts, as calculated by the risk model.
      Returns:
    • getStillRelevantTests

      default Stream<TestResult> getStillRelevantTests()
      All the tests done in the last presumed infectious period
      Returns:
    • getRecentRuleOutTests

      default Stream<TestResult> getRecentRuleOutTests()
      All the tests done in the last incubation period. The results here can rule out doing another test.
      Returns:
    • getLastTest

      @Lazy default Optional<TestResult> getLastTest()
      Most recent (relevant) test whether or not there is a result. This is not particularly deterministic and weakly assumes there is only one test per day.
    • getLastResult

      @Lazy default Optional<TestResult> getLastResult()
      Most recent test with a result, so excluding pending results.
    • getContactHistory

      default Stream<Contact> getContactHistory()
      Reassemble the weighted contacts from the PersonHistory contact graph within the limit of the expected infectious period. This is the contact history as the app might collect it, except it does not filter for detected contacts
    • getExposureHistory

      default Stream<Exposure> getExposureHistory()
      Reassemble the exposures from the PersonHistory exposure graph within the infectious period. This is the true exposure history as the app might see it but the app would not usually know that these are exposures and not non-infectious contacts.
    • getContactCount

      default long getContactCount()
      A contact count for understanding the contact degree distribution. This is the number of contacts made today
    • getExposureCount

      default long getExposureCount()
      A count of infectious contacts made today
    • getYesterday

      default PersonHistory getYesterday()
      use with extreme caution: prefer the Optional ModelNav version. This is only here for the CSV mapper.