Class ImmutableOutbreakState
- All Implemented Interfaces:
Abstraction.TemporalState<Outbreak>
,OutbreakState
,OutbreakTemporalState
,Serializable
,Cloneable
OutbreakState
.
Use the builder to create immutable instances:
ImmutableOutbreakState.builder()
.
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final class
Builds instances of typeImmutableOutbreakState
. -
Method Summary
Modifier and TypeMethodDescriptionbuilder()
Creates a builder forImmutableOutbreakState
.static ImmutableOutbreakState
copyOf
(OutbreakState instance) Creates an immutable copy of aOutbreakState
value.boolean
This instance is equal to all instances ofImmutableOutbreakState
that have equal attribute values.long
Count of people newly requiring hospitalisation at any given time point.double
double
Average absolute loss of mobility compared to baseline.double
double
Average absolute loss of mobility compared to baseline.double
double
A probability that if two people are in contact and both using apps How likely is it that the app will detect the contact?long
double
long
long
double
long
Count of people requiring hospitalisation at any given time point.long
long
long
long
double
int
The estimate of the incubation period is important as it puts a time on how long to isolate and when to test after exposure.int
The estimate of the infectious period is important because it informs the policy and behavioural guidance on a whole range of things, from self isolation duration to maximum time that an infectious contact is deemed relevant.double
An estimate of how sensitive symptoms are is part of determining their significance if they are being recorded by an smart agent.double
An estimate of how specific symptoms are is part of determining their significance if they are being recorded by an smart agent.double
Sum of all the people who tested positive over the last infectious period.double
long
long
Count of people with test negatives in their results that become available todaylong
Count of people with test positives in the results that become available today.getTime()
long
double
An odds ratio describing day to day changes in the transmission due to exogenous factors such as weather, or potentially viral evolution.getUrn()
int
hashCode()
Computes a hash code from attributes:entity
,time
,urn
,transmissibilityModifier
,contactDetectedProbability
,presumedInfectiousPeriod
,presumedIncubationPeriod
,presumedSymptomSpecificity
,presumedSymptomSensitivity
.Creates a builder forImmutableOutbreakState
.prefilled with attibute values ofthis
instance to easily create modified copies.toString()
Prints the immutable valueOutbreakState
with attribute values.final ImmutableOutbreakState
withContactDetectedProbability
(double value) Copy the current immutable object by setting a value for thecontactDetectedProbability
attribute.final ImmutableOutbreakState
withEntity
(Outbreak value) Copy the current immutable object by setting a value for theentity
attribute.final ImmutableOutbreakState
withPresumedIncubationPeriod
(int value) Copy the current immutable object by setting a value for thepresumedIncubationPeriod
attribute.final ImmutableOutbreakState
withPresumedInfectiousPeriod
(int value) Copy the current immutable object by setting a value for thepresumedInfectiousPeriod
attribute.final ImmutableOutbreakState
withPresumedSymptomSensitivity
(double value) Copy the current immutable object by setting a value for thepresumedSymptomSensitivity
attribute.final ImmutableOutbreakState
withPresumedSymptomSpecificity
(double value) Copy the current immutable object by setting a value for thepresumedSymptomSpecificity
attribute.final ImmutableOutbreakState
Copy the current immutable object by setting a value for thetime
attribute.final ImmutableOutbreakState
withTransmissibilityModifier
(double value) Copy the current immutable object by setting a value for thetransmissibilityModifier
attribute.Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface io.github.ai4ci.abm.mechanics.Abstraction.TemporalState
getExperimentName, getExperimentReplica, getModelName, getModelReplica
Methods inherited from interface io.github.ai4ci.abm.OutbreakState
getRtEffective
-
Method Details
-
getEntity
- Specified by:
getEntity
in interfaceAbstraction.TemporalState<Outbreak>
- Returns:
- The value of the
entity
attribute
-
getTime
- Specified by:
getTime
in interfaceAbstraction.TemporalState<Outbreak>
- Returns:
- The value of the
time
attribute
-
getUrn
- Specified by:
getUrn
in interfaceAbstraction.TemporalState<Outbreak>
- Returns:
- The computed-at-construction value of the
urn
attribute
-
getTransmissibilityModifier
public double getTransmissibilityModifier()An odds ratio describing day to day changes in the transmission due to exogenous factors such as weather, or potentially viral evolution. None of these are yet defined butModelUpdate
will be where they are implemented and configured as a function of time similar to the wayDemographicAdjustment
are handled (although that has an additional override that I don't think we will need here).- Specified by:
getTransmissibilityModifier
in interfaceOutbreakState
-
getContactDetectedProbability
public double getContactDetectedProbability()A probability that if two people are in contact and both using apps How likely is it that the app will detect the contact? The contact detected probability is a system wide parameter and describes how technically effective the app is. Then there is individual probability of app use, which covers phone actually switched on, app installed, and working:PersonState.getAdjustedAppUseProbability()
- Specified by:
getContactDetectedProbability
in interfaceOutbreakState
-
getPresumedInfectiousPeriod
public int getPresumedInfectiousPeriod()The estimate of the infectious period is important because it informs the policy and behavioural guidance on a whole range of things, from self isolation duration to maximum time that an infectious contact is deemed relevant. A grossly mis-specified value could lead to a decrease in effectiveness of behavioural interventions.- Specified by:
getPresumedInfectiousPeriod
in interfaceOutbreakState
-
getPresumedIncubationPeriod
public int getPresumedIncubationPeriod()The estimate of the incubation period is important as it puts a time on how long to isolate and when to test after exposure.- Specified by:
getPresumedIncubationPeriod
in interfaceOutbreakState
-
getPresumedSymptomSpecificity
public double getPresumedSymptomSpecificity()An estimate of how specific symptoms are is part of determining their significance if they are being recorded by an smart agent.- Specified by:
getPresumedSymptomSpecificity
in interfaceOutbreakState
-
getPresumedSymptomSensitivity
public double getPresumedSymptomSensitivity()An estimate of how sensitive symptoms are is part of determining their significance if they are being recorded by an smart agent.- Specified by:
getPresumedSymptomSensitivity
in interfaceOutbreakState
-
withEntity
Copy the current immutable object by setting a value for theentity
attribute. A shallow reference equality check is used to prevent copying of the same value by returningthis
.- Parameters:
value
- A new value for entity- Returns:
- A modified copy of the
this
object
-
withTime
Copy the current immutable object by setting a value for thetime
attribute. An equals check used to prevent copying of the same value by returningthis
.- Parameters:
value
- A new value for time- Returns:
- A modified copy of the
this
object
-
withTransmissibilityModifier
Copy the current immutable object by setting a value for thetransmissibilityModifier
attribute. A value strict bits equality used to prevent copying of the same value by returningthis
.- Parameters:
value
- A new value for transmissibilityModifier- Returns:
- A modified copy of the
this
object
-
withContactDetectedProbability
Copy the current immutable object by setting a value for thecontactDetectedProbability
attribute. A value strict bits equality used to prevent copying of the same value by returningthis
.- Parameters:
value
- A new value for contactDetectedProbability- Returns:
- A modified copy of the
this
object
-
withPresumedInfectiousPeriod
Copy the current immutable object by setting a value for thepresumedInfectiousPeriod
attribute. A value equality check is used to prevent copying of the same value by returningthis
.- Parameters:
value
- A new value for presumedInfectiousPeriod- Returns:
- A modified copy of the
this
object
-
withPresumedIncubationPeriod
Copy the current immutable object by setting a value for thepresumedIncubationPeriod
attribute. A value equality check is used to prevent copying of the same value by returningthis
.- Parameters:
value
- A new value for presumedIncubationPeriod- Returns:
- A modified copy of the
this
object
-
withPresumedSymptomSpecificity
Copy the current immutable object by setting a value for thepresumedSymptomSpecificity
attribute. A value strict bits equality used to prevent copying of the same value by returningthis
.- Parameters:
value
- A new value for presumedSymptomSpecificity- Returns:
- A modified copy of the
this
object
-
withPresumedSymptomSensitivity
Copy the current immutable object by setting a value for thepresumedSymptomSensitivity
attribute. A value strict bits equality used to prevent copying of the same value by returningthis
.- Parameters:
value
- A new value for presumedSymptomSensitivity- Returns:
- A modified copy of the
this
object
-
equals
This instance is equal to all instances ofImmutableOutbreakState
that have equal attribute values. -
hashCode
public int hashCode()Computes a hash code from attributes:entity
,time
,urn
,transmissibilityModifier
,contactDetectedProbability
,presumedInfectiousPeriod
,presumedIncubationPeriod
,presumedSymptomSpecificity
,presumedSymptomSensitivity
. -
toString
Prints the immutable valueOutbreakState
with attribute values. -
getAverageMobility
public double getAverageMobility()Returns a lazily initialized value of the
averageMobility
attribute. Initialized once and only once and stored for subsequent access with proper synchronization. In case of any exception or error thrown by the lazy value initializer, the result will not be memoised (i.e. remembered) and on next call computation will be attempted again.- Specified by:
getAverageMobility
in interfaceOutbreakState
- Returns:
- A lazily initialized value of the
averageMobility
attribute
-
getAverageViralLoad
public double getAverageViralLoad()Returns a lazily initialized value of the
averageViralLoad
attribute. Initialized once and only once and stored for subsequent access with proper synchronization. In case of any exception or error thrown by the lazy value initializer, the result will not be memoised (i.e. remembered) and on next call computation will be attempted again.- Specified by:
getAverageViralLoad
in interfaceOutbreakState
- Returns:
- A lazily initialized value of the
averageViralLoad
attribute
-
getAverageCompliance
public double getAverageCompliance()Returns a lazily initialized value of the
averageCompliance
attribute. Initialized once and only once and stored for subsequent access with proper synchronization. In case of any exception or error thrown by the lazy value initializer, the result will not be memoised (i.e. remembered) and on next call computation will be attempted again.- Specified by:
getAverageCompliance
in interfaceOutbreakState
- Returns:
- A lazily initialized value of the
averageCompliance
attribute
-
getCumulativeInfections
public long getCumulativeInfections()Returns a lazily initialized value of the
cumulativeInfections
attribute. Initialized once and only once and stored for subsequent access with proper synchronization. In case of any exception or error thrown by the lazy value initializer, the result will not be memoised (i.e. remembered) and on next call computation will be attempted again.- Specified by:
getCumulativeInfections
in interfaceOutbreakState
- Specified by:
getCumulativeInfections
in interfaceOutbreakTemporalState
- Returns:
- A lazily initialized value of the
cumulativeInfections
attribute
-
getMaximumIncidence
public long getMaximumIncidence()Returns a lazily initialized value of the
maximumIncidence
attribute. Initialized once and only once and stored for subsequent access with proper synchronization. In case of any exception or error thrown by the lazy value initializer, the result will not be memoised (i.e. remembered) and on next call computation will be attempted again.- Specified by:
getMaximumIncidence
in interfaceOutbreakState
- Specified by:
getMaximumIncidence
in interfaceOutbreakTemporalState
- Returns:
- A lazily initialized value of the
maximumIncidence
attribute
-
getTimeToMaximumIncidence
public long getTimeToMaximumIncidence()Returns a lazily initialized value of the
timeToMaximumIncidence
attribute. Initialized once and only once and stored for subsequent access with proper synchronization. In case of any exception or error thrown by the lazy value initializer, the result will not be memoised (i.e. remembered) and on next call computation will be attempted again.- Specified by:
getTimeToMaximumIncidence
in interfaceOutbreakState
- Specified by:
getTimeToMaximumIncidence
in interfaceOutbreakTemporalState
- Returns:
- A lazily initialized value of the
timeToMaximumIncidence
attribute
-
getTestPositivesByResultDate
public long getTestPositivesByResultDate()Count of people with test positives in the results that become available today.Returns a lazily initialized value of the
testPositivesByResultDate
attribute. Initialized once and only once and stored for subsequent access with proper synchronization. In case of any exception or error thrown by the lazy value initializer, the result will not be memoised (i.e. remembered) and on next call computation will be attempted again.- Specified by:
getTestPositivesByResultDate
in interfaceOutbreakState
- Specified by:
getTestPositivesByResultDate
in interfaceOutbreakTemporalState
- Returns:
- A lazily initialized value of the
testPositivesByResultDate
attribute
-
getTestNegativesByResultDate
public long getTestNegativesByResultDate()Count of people with test negatives in their results that become available todayReturns a lazily initialized value of the
testNegativesByResultDate
attribute. Initialized once and only once and stored for subsequent access with proper synchronization. In case of any exception or error thrown by the lazy value initializer, the result will not be memoised (i.e. remembered) and on next call computation will be attempted again.- Specified by:
getTestNegativesByResultDate
in interfaceOutbreakState
- Specified by:
getTestNegativesByResultDate
in interfaceOutbreakTemporalState
- Returns:
- A lazily initialized value of the
testNegativesByResultDate
attribute
-
getInfectedCount
public long getInfectedCount()Returns a lazily initialized value of the
infectedCount
attribute. Initialized once and only once and stored for subsequent access with proper synchronization. In case of any exception or error thrown by the lazy value initializer, the result will not be memoised (i.e. remembered) and on next call computation will be attempted again.- Specified by:
getInfectedCount
in interfaceOutbreakState
- Specified by:
getInfectedCount
in interfaceOutbreakTemporalState
- Returns:
- A lazily initialized value of the
infectedCount
attribute
-
getMaximumPrevalence
public double getMaximumPrevalence()Returns a lazily initialized value of the
maximumPrevalence
attribute. Initialized once and only once and stored for subsequent access with proper synchronization. In case of any exception or error thrown by the lazy value initializer, the result will not be memoised (i.e. remembered) and on next call computation will be attempted again.- Specified by:
getMaximumPrevalence
in interfaceOutbreakState
- Specified by:
getMaximumPrevalence
in interfaceOutbreakTemporalState
- Returns:
- A lazily initialized value of the
maximumPrevalence
attribute
-
getIncidence
public long getIncidence()Returns a lazily initialized value of the
incidence
attribute. Initialized once and only once and stored for subsequent access with proper synchronization. In case of any exception or error thrown by the lazy value initializer, the result will not be memoised (i.e. remembered) and on next call computation will be attempted again.- Specified by:
getIncidence
in interfaceOutbreakState
- Specified by:
getIncidence
in interfaceOutbreakTemporalState
- Returns:
- A lazily initialized value of the
incidence
attribute
-
getSymptomaticCount
public long getSymptomaticCount()Returns a lazily initialized value of the
symptomaticCount
attribute. Initialized once and only once and stored for subsequent access with proper synchronization. In case of any exception or error thrown by the lazy value initializer, the result will not be memoised (i.e. remembered) and on next call computation will be attempted again.- Specified by:
getSymptomaticCount
in interfaceOutbreakState
- Returns:
- A lazily initialized value of the
symptomaticCount
attribute
-
getAdmissionIncidence
public long getAdmissionIncidence()Count of people newly requiring hospitalisation at any given time point. This would be equivalent to hospital admission incidence.Returns a lazily initialized value of the
admissionIncidence
attribute. Initialized once and only once and stored for subsequent access with proper synchronization. In case of any exception or error thrown by the lazy value initializer, the result will not be memoised (i.e. remembered) and on next call computation will be attempted again.- Specified by:
getAdmissionIncidence
in interfaceOutbreakState
- Returns:
- A lazily initialized value of the
admissionIncidence
attribute
-
getCumulativeAdmissions
public long getCumulativeAdmissions()Returns a lazily initialized value of the
cumulativeAdmissions
attribute. Initialized once and only once and stored for subsequent access with proper synchronization. In case of any exception or error thrown by the lazy value initializer, the result will not be memoised (i.e. remembered) and on next call computation will be attempted again.- Specified by:
getCumulativeAdmissions
in interfaceOutbreakState
- Specified by:
getCumulativeAdmissions
in interfaceOutbreakTemporalState
- Returns:
- A lazily initialized value of the
cumulativeAdmissions
attribute
-
getMaximumHospitalBurden
public long getMaximumHospitalBurden()Returns a lazily initialized value of the
maximumHospitalBurden
attribute. Initialized once and only once and stored for subsequent access with proper synchronization. In case of any exception or error thrown by the lazy value initializer, the result will not be memoised (i.e. remembered) and on next call computation will be attempted again.- Specified by:
getMaximumHospitalBurden
in interfaceOutbreakState
- Specified by:
getMaximumHospitalBurden
in interfaceOutbreakTemporalState
- Returns:
- A lazily initialized value of the
maximumHospitalBurden
attribute
-
getAverageMobilityDecrease
public double getAverageMobilityDecrease()Average absolute loss of mobility compared to baseline.Returns a lazily initialized value of the
averageMobilityDecrease
attribute. Initialized once and only once and stored for subsequent access with proper synchronization. In case of any exception or error thrown by the lazy value initializer, the result will not be memoised (i.e. remembered) and on next call computation will be attempted again.- Specified by:
getAverageMobilityDecrease
in interfaceOutbreakState
- Returns:
- A lazily initialized value of the
averageMobilityDecrease
attribute
-
getCumulativeMobilityDecrease
public double getCumulativeMobilityDecrease()Returns a lazily initialized value of the
cumulativeMobilityDecrease
attribute. Initialized once and only once and stored for subsequent access with proper synchronization. In case of any exception or error thrown by the lazy value initializer, the result will not be memoised (i.e. remembered) and on next call computation will be attempted again.- Specified by:
getCumulativeMobilityDecrease
in interfaceOutbreakState
- Specified by:
getCumulativeMobilityDecrease
in interfaceOutbreakTemporalState
- Returns:
- A lazily initialized value of the
cumulativeMobilityDecrease
attribute
-
getAverageComplianceDecrease
public double getAverageComplianceDecrease()Average absolute loss of mobility compared to baseline.Returns a lazily initialized value of the
averageComplianceDecrease
attribute. Initialized once and only once and stored for subsequent access with proper synchronization. In case of any exception or error thrown by the lazy value initializer, the result will not be memoised (i.e. remembered) and on next call computation will be attempted again.- Specified by:
getAverageComplianceDecrease
in interfaceOutbreakState
- Returns:
- A lazily initialized value of the
averageComplianceDecrease
attribute
-
getCumulativeComplianceDecrease
public double getCumulativeComplianceDecrease()Returns a lazily initialized value of the
cumulativeComplianceDecrease
attribute. Initialized once and only once and stored for subsequent access with proper synchronization. In case of any exception or error thrown by the lazy value initializer, the result will not be memoised (i.e. remembered) and on next call computation will be attempted again.- Specified by:
getCumulativeComplianceDecrease
in interfaceOutbreakState
- Specified by:
getCumulativeComplianceDecrease
in interfaceOutbreakTemporalState
- Returns:
- A lazily initialized value of the
cumulativeComplianceDecrease
attribute
-
getHospitalisedCount
public long getHospitalisedCount()Count of people requiring hospitalisation at any given time point. This would be equivalent to hospital occupancy.Returns a lazily initialized value of the
hospitalisedCount
attribute. Initialized once and only once and stored for subsequent access with proper synchronization. In case of any exception or error thrown by the lazy value initializer, the result will not be memoised (i.e. remembered) and on next call computation will be attempted again.- Specified by:
getHospitalisedCount
in interfaceOutbreakState
- Returns:
- A lazily initialized value of the
hospitalisedCount
attribute
-
getCumulativeDeaths
public long getCumulativeDeaths()Returns a lazily initialized value of the
cumulativeDeaths
attribute. Initialized once and only once and stored for subsequent access with proper synchronization. In case of any exception or error thrown by the lazy value initializer, the result will not be memoised (i.e. remembered) and on next call computation will be attempted again.- Specified by:
getCumulativeDeaths
in interfaceOutbreakState
- Returns:
- A lazily initialized value of the
cumulativeDeaths
attribute
-
getPolicy
Returns a lazily initialized value of the
policy
attribute. Initialized once and only once and stored for subsequent access with proper synchronization. In case of any exception or error thrown by the lazy value initializer, the result will not be memoised (i.e. remembered) and on next call computation will be attempted again.- Specified by:
getPolicy
in interfaceOutbreakState
- Returns:
- A lazily initialized value of the
policy
attribute
-
getPresumedTestPositivePrevalence
public double getPresumedTestPositivePrevalence()Sum of all the people who tested positive over the last infectious period. This could potentially count people multiple times if they have multiple tests. Testing protocols may prevent this from happening. This is one of the key determinants of thePolicyModel
lockdown decision making.Returns a lazily initialized value of the
presumedTestPositivePrevalence
attribute. Initialized once and only once and stored for subsequent access with proper synchronization. In case of any exception or error thrown by the lazy value initializer, the result will not be memoised (i.e. remembered) and on next call computation will be attempted again.- Specified by:
getPresumedTestPositivePrevalence
in interfaceOutbreakState
- Returns:
- A lazily initialized value of the
presumedTestPositivePrevalence
attribute
-
getPrevalence
public double getPrevalence()Returns a lazily initialized value of the
prevalence
attribute. Initialized once and only once and stored for subsequent access with proper synchronization. In case of any exception or error thrown by the lazy value initializer, the result will not be memoised (i.e. remembered) and on next call computation will be attempted again.- Specified by:
getPrevalence
in interfaceOutbreakState
- Returns:
- A lazily initialized value of the
prevalence
attribute
-
copyOf
Creates an immutable copy of aOutbreakState
value. Uses accessors to get values to initialize the new immutable instance. If an instance is already immutable, it is returned as is.- Parameters:
instance
- The instance to copy- Returns:
- A copied immutable OutbreakState instance
-
toBuilder
Creates a builder forImmutableOutbreakState
.prefilled with attibute values ofthis
instance to easily create modified copies.- Returns:
- A new ImmutableOutbreakState builder with attributes of
this
instance
-
builder
Creates a builder forImmutableOutbreakState
.ImmutableOutbreakState.builder() .setEntity(io.github.ai4ci.abm.Outbreak) // required
entity
.setTime(Integer) // requiredtime
.setTransmissibilityModifier(double) // requiredtransmissibilityModifier
.setContactDetectedProbability(double) // requiredcontactDetectedProbability
.setPresumedInfectiousPeriod(int) // requiredpresumedInfectiousPeriod
.setPresumedIncubationPeriod(int) // requiredpresumedIncubationPeriod
.setPresumedSymptomSpecificity(double) // requiredpresumedSymptomSpecificity
.setPresumedSymptomSensitivity(double) // requiredpresumedSymptomSensitivity
.build();- Returns:
- A new ImmutableOutbreakState builder
-