Class ImmutableOutbreakHistory

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

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

Use the builder to create immutable instances: ImmutableOutbreakHistory.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
    • getInfectedCount

      public long getInfectedCount()
      Specified by:
      getInfectedCount in interface OutbreakTemporalState
      Returns:
      The value of the infectedCount attribute
    • getIncidence

      public long getIncidence()
      Specified by:
      getIncidence in interface OutbreakTemporalState
      Returns:
      The value of the incidence attribute
    • getTestPositivesByResultDate

      public long getTestPositivesByResultDate()
      The number of tests reported positive on the current simulation date. This is reported on the date the test result is available (not when the test was taken).
      Specified by:
      getTestPositivesByResultDate in interface OutbreakTemporalState
    • getTestNegativesByResultDate

      public long getTestNegativesByResultDate()
      The number of tests reported negative on the current simulation date. This is reported on the date the test result is available (not when the test was taken).
      Specified by:
      getTestNegativesByResultDate in interface OutbreakTemporalState
    • getCumulativeInfections

      public long getCumulativeInfections()
      Specified by:
      getCumulativeInfections in interface OutbreakTemporalState
      Returns:
      The value of the cumulativeInfections attribute
    • getCumulativeAdmissions

      public long getCumulativeAdmissions()
      Specified by:
      getCumulativeAdmissions in interface OutbreakTemporalState
      Returns:
      The value of the cumulativeAdmissions attribute
    • getMaximumIncidence

      public long getMaximumIncidence()
      Specified by:
      getMaximumIncidence in interface OutbreakTemporalState
      Returns:
      The value of the maximumIncidence attribute
    • getTimeToMaximumIncidence

      public long getTimeToMaximumIncidence()
      Specified by:
      getTimeToMaximumIncidence in interface OutbreakTemporalState
      Returns:
      The value of the timeToMaximumIncidence attribute
    • getMaximumHospitalBurden

      public long getMaximumHospitalBurden()
      Specified by:
      getMaximumHospitalBurden in interface OutbreakTemporalState
      Returns:
      The value of the maximumHospitalBurden attribute
    • getMaximumPrevalence

      public double getMaximumPrevalence()
      Specified by:
      getMaximumPrevalence in interface OutbreakTemporalState
      Returns:
      The value of the maximumPrevalence attribute
    • getCumulativeMobilityDecrease

      public double getCumulativeMobilityDecrease()
      Specified by:
      getCumulativeMobilityDecrease in interface OutbreakTemporalState
      Returns:
      The value of the cumulativeMobilityDecrease attribute
    • getCumulativeComplianceDecrease

      public double getCumulativeComplianceDecrease()
      Specified by:
      getCumulativeComplianceDecrease in interface OutbreakTemporalState
      Returns:
      The value of the cumulativeComplianceDecrease attribute
    • withEntity

      public final ImmutableOutbreakHistory 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 ImmutableOutbreakHistory 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
    • withInfectedCount

      public final ImmutableOutbreakHistory withInfectedCount(long value)
      Copy the current immutable object by setting a value for the infectedCount attribute. A value equality check is used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for infectedCount
      Returns:
      A modified copy of the this object
    • withIncidence

      public final ImmutableOutbreakHistory withIncidence(long value)
      Copy the current immutable object by setting a value for the incidence attribute. A value equality check is used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for incidence
      Returns:
      A modified copy of the this object
    • withTestPositivesByResultDate

      public final ImmutableOutbreakHistory withTestPositivesByResultDate(long value)
      Copy the current immutable object by setting a value for the testPositivesByResultDate attribute. A value equality check is used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for testPositivesByResultDate
      Returns:
      A modified copy of the this object
    • withTestNegativesByResultDate

      public final ImmutableOutbreakHistory withTestNegativesByResultDate(long value)
      Copy the current immutable object by setting a value for the testNegativesByResultDate attribute. A value equality check is used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for testNegativesByResultDate
      Returns:
      A modified copy of the this object
    • withCumulativeInfections

      public final ImmutableOutbreakHistory withCumulativeInfections(long value)
      Copy the current immutable object by setting a value for the cumulativeInfections attribute. A value equality check is used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for cumulativeInfections
      Returns:
      A modified copy of the this object
    • withCumulativeAdmissions

      public final ImmutableOutbreakHistory withCumulativeAdmissions(long value)
      Copy the current immutable object by setting a value for the cumulativeAdmissions attribute. A value equality check is used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for cumulativeAdmissions
      Returns:
      A modified copy of the this object
    • withMaximumIncidence

      public final ImmutableOutbreakHistory withMaximumIncidence(long value)
      Copy the current immutable object by setting a value for the maximumIncidence attribute. A value equality check is used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for maximumIncidence
      Returns:
      A modified copy of the this object
    • withTimeToMaximumIncidence

      public final ImmutableOutbreakHistory withTimeToMaximumIncidence(long value)
      Copy the current immutable object by setting a value for the timeToMaximumIncidence attribute. A value equality check is used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for timeToMaximumIncidence
      Returns:
      A modified copy of the this object
    • withMaximumHospitalBurden

      public final ImmutableOutbreakHistory withMaximumHospitalBurden(long value)
      Copy the current immutable object by setting a value for the maximumHospitalBurden attribute. A value equality check is used to prevent copying of the same value by returning this.
      Parameters:
      value - A new value for maximumHospitalBurden
      Returns:
      A modified copy of the this object
    • withMaximumPrevalence

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

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

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

      public boolean equals(@Nullable Object another)
      This instance is equal to all instances of ImmutableOutbreakHistory 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, infectedCount, incidence, testPositivesByResultDate, testNegativesByResultDate, cumulativeInfections, cumulativeAdmissions, maximumIncidence, timeToMaximumIncidence, maximumHospitalBurden, maximumPrevalence, cumulativeMobilityDecrease, cumulativeComplianceDecrease.
      Overrides:
      hashCode in class Object
      Returns:
      hashCode value
    • toString

      public String toString()
      Prints the immutable value OutbreakHistory with attribute values.
      Overrides:
      toString in class Object
      Returns:
      A string representation of the value
    • getMaxDelay

      public int getMaxDelay()
      Internal helper function for looking at delay of test results

      Returns a lazily initialized value of the maxDelay 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:
      getMaxDelay in interface OutbreakHistory
      Returns:
      A lazily initialized value of the maxDelay attribute
    • getTestPositivesBySampleDate

      public List<Integer> getTestPositivesBySampleDate()
      The number of tests reported as positive on the day of testing is looking forward through time until the result is available. The result is a forward distribution of positive test counts indexed by delay. So first is the tests with positive results available today, second is those with results tomorrow etc.

      Returns a lazily initialized value of the testPositivesBySampleDate 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:
      getTestPositivesBySampleDate in interface OutbreakHistory
      Returns:
      A lazily initialized value of the testPositivesBySampleDate attribute
    • getTestNegativesBySampleDate

      public List<Integer> getTestNegativesBySampleDate()
      The number of tests reported as positive on the given day

      Returns a lazily initialized value of the testNegativesBySampleDate 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:
      getTestNegativesBySampleDate in interface OutbreakHistory
      Returns:
      A lazily initialized value of the testNegativesBySampleDate attribute
      See Also:
    • copyOf

      public static ImmutableOutbreakHistory copyOf(OutbreakHistory instance)
      Creates an immutable copy of a OutbreakHistory 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 OutbreakHistory instance
    • toBuilder

      Creates a builder for ImmutableOutbreakHistory.prefilled with attibute values of this instance to easily create modified copies.
      Returns:
      A new ImmutableOutbreakHistory builder with attributes of this instance
    • builder

      public static ImmutableOutbreakHistory.Builder builder()
      Creates a builder for ImmutableOutbreakHistory.
       ImmutableOutbreakHistory.builder()
          .setEntity(io.github.ai4ci.abm.Outbreak) // required entity
          .setTime(Integer) // required time
          .setInfectedCount(long) // required infectedCount
          .setIncidence(long) // required incidence
          .setTestPositivesByResultDate(long) // required testPositivesByResultDate
          .setTestNegativesByResultDate(long) // required testNegativesByResultDate
          .setCumulativeInfections(long) // required cumulativeInfections
          .setCumulativeAdmissions(long) // required cumulativeAdmissions
          .setMaximumIncidence(long) // required maximumIncidence
          .setTimeToMaximumIncidence(long) // required timeToMaximumIncidence
          .setMaximumHospitalBurden(long) // required maximumHospitalBurden
          .setMaximumPrevalence(double) // required maximumPrevalence
          .setCumulativeMobilityDecrease(double) // required cumulativeMobilityDecrease
          .setCumulativeComplianceDecrease(double) // required cumulativeComplianceDecrease
          .build();
       
      Returns:
      A new ImmutableOutbreakHistory builder