Package io.github.ai4ci.abm
Interface PersonState
- All Superinterfaces:
Abstraction.TemporalState<Person>
,PersonTemporalState
,Serializable
- All Known Implementing Classes:
ImmutablePersonState
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 Summary
FieldsModifier and TypeFieldDescriptionstatic final double
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. -
Method Summary
Modifier and TypeMethodDescriptiondefault double
default double
default double
Probability of use of an app at any given point in time on a per day basis.default double
A probability that a person is compliant to guidance on any give day.default double
Probability of contact given a fully mobile partner on a per day basis.default double
Probability of transmission given a contact with a completely unprotected person.default double
An odds ratio that modifies the baseline probability that the person is using a smart agent to record data, and get personalised guidancedefault String
default double
An odds ratio of compliance that modifies the baseline compliance probability that the person is going to follow guidance.default long
A contact count for understanding the contact degree distribution.default double
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.Reassemble the weighted contacts from the PersonHistory contact graph within the limit of the expected infectious period.default long
A count of infectious contacts made todayReassemble the exposures from the PersonHistory exposure graph within the infectious period.default double
An immunisation dose is a fraction of dormant immune cells that are activated by any immunising exposure in the previous day.default double
A viral exposure as a result of importation this may be the result of a time varying function representing external drivers.default Optional<TestResult>
Most recent test with a result, so excluding pending results.default Optional<TestResult>
Most recent (relevant) test whether or not there is a result.default double
An odds ratio of mobility that modifies the baseline contact probabilitydefault double
A normalised severity index where 1 is symptomatic (excepting symptom ascertainment error.)default double
A normalised viral load index where 1 is infectious.default double
Estimate the local prevalence for an individual.default double
This is the risk that this individual is infectious today.default Stream<TestResult>
All the tests done in the last incubation period.default RiskModel
default Stream<TestResult>
All the tests done in the last presumed infectious perioddefault double
An odds ratio of that modifies the baseline probability of transmission from another person to this onedefault double
Exposure due to contact and importationdefault double
An odds ratio of transmission that modifies the baseline probability of transmission to another persondefault double
How many people in this persons recent contacts are infectious regardless of whether on not the contact is detected.default PersonHistory
use with extreme caution: prefer the Optional ModelNav version.default boolean
default boolean
isCompliant
(Sampler rng) default boolean
isDead()
The person is deaddefault boolean
Is the persons internal viral load above the threshold for potential infectivity.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.default boolean
Looks at whether there are any tests of specified type within the last x days.default boolean
isRecentlyTested
(TestResult.Type type, int days) default boolean
The user has reported symptoms via the app.default boolean
Is the persons in-host state above the threshold for requiring hospitalisation on this day.default boolean
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.default boolean
isSymptomaticConsecutively
(int days) Is a person symptomatic for a number of days in a rowdefault boolean
default boolean
isUsingAppToday
(Sampler rng) Methods inherited from interface io.github.ai4ci.abm.mechanics.Abstraction.TemporalState
getEntity, getExperimentName, getExperimentReplica, getModelName, getModelReplica, getTime, getUrn
Methods inherited from interface io.github.ai4ci.abm.PersonTemporalState
incubPeriod, infPeriod
-
Field Details
-
MAX_EXPOSURE
static final double MAX_EXPOSUREThis 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
-
getNormalisedSeverity
default double getNormalisedSeverity()A normalised severity index where 1 is symptomatic (excepting symptom ascertainment error.)- Specified by:
getNormalisedSeverity
in interfacePersonTemporalState
-
getNormalisedViralLoad
default double getNormalisedViralLoad()A normalised viral load index where 1 is infectious.- Specified by:
getNormalisedViralLoad
in interfacePersonTemporalState
-
isInfectious
@Derived default boolean isInfectious()Is the persons internal viral load above the threshold for potential infectivity.- Specified by:
isInfectious
in interfacePersonTemporalState
-
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 interfacePersonTemporalState
-
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 interfacePersonTemporalState
-
isDead
@Derived default boolean isDead()The person is dead- Specified by:
isDead
in interfacePersonTemporalState
-
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 interfacePersonTemporalState
-
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
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
-
isCompliant
@Derived default boolean isCompliant() -
isUsingAppToday
-
isUsingAppToday
@Derived default boolean isUsingAppToday() -
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 interfacePersonTemporalState
- Returns:
-
getTotalExposure
default double getTotalExposure()Exposure due to contact and importation -
isRecentlyTested
Looks at whether there are any tests of specified type within the last x days. -
isRecentlyTested
-
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 interfacePersonTemporalState
-
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
All the tests done in the last presumed infectious period- Returns:
-
getRecentRuleOutTests
All the tests done in the last incubation period. The results here can rule out doing another test.- Returns:
-
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
Most recent test with a result, so excluding pending results. -
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
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
use with extreme caution: prefer the Optional ModelNav version. This is only here for the CSV mapper.
-