Class ImmutableOutbreakState

java.lang.Object
io.github.ai4ci.abm.ImmutableOutbreakState
All Implemented Interfaces:
Abstraction.TemporalState<Outbreak>, OutbreakState, OutbreakTemporalState, Serializable, Cloneable

@ParametersAreNonnullByDefault @Generated("org.immutables.processor.ProxyProcessor") @Immutable @CheckReturnValue public final class ImmutableOutbreakState extends Object implements OutbreakState
Immutable implementation of OutbreakState.

Use the builder to create immutable instances: ImmutableOutbreakState.builder().

See Also:
  • Method Details

    • getEntity

      public Outbreak getEntity()
      Specified by:
      getEntity in interface Abstraction.TemporalState<Outbreak>
      Returns:
      The value of the entity attribute
    • getTime

      public Integer getTime()
      Specified by:
      getTime in interface Abstraction.TemporalState<Outbreak>
      Returns:
      The value of the time attribute
    • getUrn

      public String getUrn()
      Specified by:
      getUrn in interface Abstraction.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 but ModelUpdate will be where they are implemented and configured as a function of time similar to the way DemographicAdjustment are handled (although that has an additional override that I don't think we will need here).
      Specified by:
      getTransmissibilityModifier in interface OutbreakState
    • 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 interface OutbreakState
    • 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 interface OutbreakState
    • 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 interface OutbreakState
    • 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 interface OutbreakState
    • 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 interface OutbreakState
    • withEntity

      public final ImmutableOutbreakState withEntity(Outbreak value)
      Copy the current immutable object by setting a value for the entity attribute. A shallow reference equality check is used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for entity
      Returns:
      A modified copy of the this object
    • withTime

      public final ImmutableOutbreakState withTime(Integer value)
      Copy the current immutable object by setting a value for the time attribute. An equals check used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for time
      Returns:
      A modified copy of the this object
    • withTransmissibilityModifier

      public final ImmutableOutbreakState withTransmissibilityModifier(double value)
      Copy the current immutable object by setting a value for the transmissibilityModifier attribute. A value strict bits equality used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for transmissibilityModifier
      Returns:
      A modified copy of the this object
    • withContactDetectedProbability

      public final ImmutableOutbreakState withContactDetectedProbability(double value)
      Copy the current immutable object by setting a value for the contactDetectedProbability attribute. A value strict bits equality used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for contactDetectedProbability
      Returns:
      A modified copy of the this object
    • withPresumedInfectiousPeriod

      public final ImmutableOutbreakState withPresumedInfectiousPeriod(int value)
      Copy the current immutable object by setting a value for the presumedInfectiousPeriod attribute. A value equality check is used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for presumedInfectiousPeriod
      Returns:
      A modified copy of the this object
    • withPresumedIncubationPeriod

      public final ImmutableOutbreakState withPresumedIncubationPeriod(int value)
      Copy the current immutable object by setting a value for the presumedIncubationPeriod attribute. A value equality check is used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for presumedIncubationPeriod
      Returns:
      A modified copy of the this object
    • withPresumedSymptomSpecificity

      public final ImmutableOutbreakState withPresumedSymptomSpecificity(double value)
      Copy the current immutable object by setting a value for the presumedSymptomSpecificity attribute. A value strict bits equality used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for presumedSymptomSpecificity
      Returns:
      A modified copy of the this object
    • withPresumedSymptomSensitivity

      public final ImmutableOutbreakState withPresumedSymptomSensitivity(double value)
      Copy the current immutable object by setting a value for the presumedSymptomSensitivity attribute. A value strict bits equality used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for presumedSymptomSensitivity
      Returns:
      A modified copy of the this object
    • equals

      public boolean equals(@Nullable Object another)
      This instance is equal to all instances of ImmutableOutbreakState that have equal attribute values.
      Overrides:
      equals in class Object
      Returns:
      true if this is equal to another instance
    • hashCode

      public int hashCode()
      Computes a hash code from attributes: entity, time, urn, transmissibilityModifier, contactDetectedProbability, presumedInfectiousPeriod, presumedIncubationPeriod, presumedSymptomSpecificity, presumedSymptomSensitivity.
      Overrides:
      hashCode in class Object
      Returns:
      hashCode value
    • toString

      public String toString()
      Prints the immutable value OutbreakState with attribute values.
      Overrides:
      toString in class Object
      Returns:
      A string representation of the value
    • 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 interface OutbreakState
      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 interface OutbreakState
      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 interface OutbreakState
      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 interface OutbreakState
      Specified by:
      getCumulativeInfections in interface OutbreakTemporalState
      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 interface OutbreakState
      Specified by:
      getMaximumIncidence in interface OutbreakTemporalState
      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 interface OutbreakState
      Specified by:
      getTimeToMaximumIncidence in interface OutbreakTemporalState
      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 interface OutbreakState
      Specified by:
      getTestPositivesByResultDate in interface OutbreakTemporalState
      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 today

      Returns 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 interface OutbreakState
      Specified by:
      getTestNegativesByResultDate in interface OutbreakTemporalState
      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 interface OutbreakState
      Specified by:
      getInfectedCount in interface OutbreakTemporalState
      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 interface OutbreakState
      Specified by:
      getMaximumPrevalence in interface OutbreakTemporalState
      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 interface OutbreakState
      Specified by:
      getIncidence in interface OutbreakTemporalState
      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 interface OutbreakState
      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 interface OutbreakState
      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 interface OutbreakState
      Specified by:
      getCumulativeAdmissions in interface OutbreakTemporalState
      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 interface OutbreakState
      Specified by:
      getMaximumHospitalBurden in interface OutbreakTemporalState
      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 interface OutbreakState
      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 interface OutbreakState
      Specified by:
      getCumulativeMobilityDecrease in interface OutbreakTemporalState
      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 interface OutbreakState
      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 interface OutbreakState
      Specified by:
      getCumulativeComplianceDecrease in interface OutbreakTemporalState
      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 interface OutbreakState
      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 interface OutbreakState
      Returns:
      A lazily initialized value of the cumulativeDeaths attribute
    • getPolicy

      public String 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 interface OutbreakState
      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 the PolicyModel 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 interface OutbreakState
      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 interface OutbreakState
      Returns:
      A lazily initialized value of the prevalence attribute
    • copyOf

      public static ImmutableOutbreakState copyOf(OutbreakState instance)
      Creates an immutable copy of a OutbreakState 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

      public ImmutableOutbreakState.Builder toBuilder()
      Creates a builder for ImmutableOutbreakState.prefilled with attibute values of this instance to easily create modified copies.
      Returns:
      A new ImmutableOutbreakState builder with attributes of this instance
    • builder

      public static ImmutableOutbreakState.Builder builder()
      Creates a builder for ImmutableOutbreakState.
       ImmutableOutbreakState.builder()
          .setEntity(io.github.ai4ci.abm.Outbreak) // required entity
          .setTime(Integer) // required time
          .setTransmissibilityModifier(double) // required transmissibilityModifier
          .setContactDetectedProbability(double) // required contactDetectedProbability
          .setPresumedInfectiousPeriod(int) // required presumedInfectiousPeriod
          .setPresumedIncubationPeriod(int) // required presumedIncubationPeriod
          .setPresumedSymptomSpecificity(double) // required presumedSymptomSpecificity
          .setPresumedSymptomSensitivity(double) // required presumedSymptomSensitivity
          .build();
       
      Returns:
      A new ImmutableOutbreakState builder