Class ImmutableOutbreakHistory
- All Implemented Interfaces:
Abstraction.TemporalState<Outbreak>
,OutbreakHistory
,OutbreakTemporalState
,Serializable
,Cloneable
OutbreakHistory
.
Use the builder to create immutable instances:
ImmutableOutbreakHistory.builder()
.
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final class
Builds instances of typeImmutableOutbreakHistory
. -
Method Summary
Modifier and TypeMethodDescriptionbuilder()
Creates a builder forImmutableOutbreakHistory
.static ImmutableOutbreakHistory
copyOf
(OutbreakHistory instance) Creates an immutable copy of aOutbreakHistory
value.boolean
This instance is equal to all instances ofImmutableOutbreakHistory
that have equal attribute values.long
double
long
double
long
long
int
Internal helper function for looking at delay of test resultslong
long
double
long
The number of tests reported negative on the current simulation date.The number of tests reported as positive on the given daylong
The number of tests reported positive on the current simulation date.The number of tests reported as positive on the day of testing is looking forward through time until the result is available.getTime()
long
getUrn()
int
hashCode()
Computes a hash code from attributes:entity
,time
,urn
,infectedCount
,incidence
,testPositivesByResultDate
,testNegativesByResultDate
,cumulativeInfections
,cumulativeAdmissions
,maximumIncidence
,timeToMaximumIncidence
,maximumHospitalBurden
,maximumPrevalence
,cumulativeMobilityDecrease
,cumulativeComplianceDecrease
.Creates a builder forImmutableOutbreakHistory
.prefilled with attibute values ofthis
instance to easily create modified copies.toString()
Prints the immutable valueOutbreakHistory
with attribute values.final ImmutableOutbreakHistory
withCumulativeAdmissions
(long value) Copy the current immutable object by setting a value for thecumulativeAdmissions
attribute.final ImmutableOutbreakHistory
withCumulativeComplianceDecrease
(double value) Copy the current immutable object by setting a value for thecumulativeComplianceDecrease
attribute.final ImmutableOutbreakHistory
withCumulativeInfections
(long value) Copy the current immutable object by setting a value for thecumulativeInfections
attribute.final ImmutableOutbreakHistory
withCumulativeMobilityDecrease
(double value) Copy the current immutable object by setting a value for thecumulativeMobilityDecrease
attribute.final ImmutableOutbreakHistory
withEntity
(Outbreak value) Copy the current immutable object by setting a value for theentity
attribute.final ImmutableOutbreakHistory
withIncidence
(long value) Copy the current immutable object by setting a value for theincidence
attribute.final ImmutableOutbreakHistory
withInfectedCount
(long value) Copy the current immutable object by setting a value for theinfectedCount
attribute.final ImmutableOutbreakHistory
withMaximumHospitalBurden
(long value) Copy the current immutable object by setting a value for themaximumHospitalBurden
attribute.final ImmutableOutbreakHistory
withMaximumIncidence
(long value) Copy the current immutable object by setting a value for themaximumIncidence
attribute.final ImmutableOutbreakHistory
withMaximumPrevalence
(double value) Copy the current immutable object by setting a value for themaximumPrevalence
attribute.final ImmutableOutbreakHistory
withTestNegativesByResultDate
(long value) Copy the current immutable object by setting a value for thetestNegativesByResultDate
attribute.final ImmutableOutbreakHistory
withTestPositivesByResultDate
(long value) Copy the current immutable object by setting a value for thetestPositivesByResultDate
attribute.final ImmutableOutbreakHistory
Copy the current immutable object by setting a value for thetime
attribute.final ImmutableOutbreakHistory
withTimeToMaximumIncidence
(long value) Copy the current immutable object by setting a value for thetimeToMaximumIncidence
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.OutbreakHistory
getCurrentTestNegativesBySampleDate, getCurrentTestPositivesBySampleDate, getPrevious, getTestNegativesBySampleDate, getTestPositivesBySampleDate
-
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
-
getInfectedCount
public long getInfectedCount()- Specified by:
getInfectedCount
in interfaceOutbreakTemporalState
- Returns:
- The value of the
infectedCount
attribute
-
getIncidence
public long getIncidence()- Specified by:
getIncidence
in interfaceOutbreakTemporalState
- 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 interfaceOutbreakTemporalState
-
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 interfaceOutbreakTemporalState
-
getCumulativeInfections
public long getCumulativeInfections()- Specified by:
getCumulativeInfections
in interfaceOutbreakTemporalState
- Returns:
- The value of the
cumulativeInfections
attribute
-
getCumulativeAdmissions
public long getCumulativeAdmissions()- Specified by:
getCumulativeAdmissions
in interfaceOutbreakTemporalState
- Returns:
- The value of the
cumulativeAdmissions
attribute
-
getMaximumIncidence
public long getMaximumIncidence()- Specified by:
getMaximumIncidence
in interfaceOutbreakTemporalState
- Returns:
- The value of the
maximumIncidence
attribute
-
getTimeToMaximumIncidence
public long getTimeToMaximumIncidence()- Specified by:
getTimeToMaximumIncidence
in interfaceOutbreakTemporalState
- Returns:
- The value of the
timeToMaximumIncidence
attribute
-
getMaximumHospitalBurden
public long getMaximumHospitalBurden()- Specified by:
getMaximumHospitalBurden
in interfaceOutbreakTemporalState
- Returns:
- The value of the
maximumHospitalBurden
attribute
-
getMaximumPrevalence
public double getMaximumPrevalence()- Specified by:
getMaximumPrevalence
in interfaceOutbreakTemporalState
- Returns:
- The value of the
maximumPrevalence
attribute
-
getCumulativeMobilityDecrease
public double getCumulativeMobilityDecrease()- Specified by:
getCumulativeMobilityDecrease
in interfaceOutbreakTemporalState
- Returns:
- The value of the
cumulativeMobilityDecrease
attribute
-
getCumulativeComplianceDecrease
public double getCumulativeComplianceDecrease()- Specified by:
getCumulativeComplianceDecrease
in interfaceOutbreakTemporalState
- Returns:
- The value of the
cumulativeComplianceDecrease
attribute
-
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
-
withInfectedCount
Copy the current immutable object by setting a value for theinfectedCount
attribute. A value equality check is used to prevent copying of the same value by returningthis
.- Parameters:
value
- A new value for infectedCount- Returns:
- A modified copy of the
this
object
-
withIncidence
Copy the current immutable object by setting a value for theincidence
attribute. A value equality check is used to prevent copying of the same value by returningthis
.- Parameters:
value
- A new value for incidence- Returns:
- A modified copy of the
this
object
-
withTestPositivesByResultDate
Copy the current immutable object by setting a value for thetestPositivesByResultDate
attribute. A value equality check is used to prevent copying of the same value by returningthis
.- Parameters:
value
- A new value for testPositivesByResultDate- Returns:
- A modified copy of the
this
object
-
withTestNegativesByResultDate
Copy the current immutable object by setting a value for thetestNegativesByResultDate
attribute. A value equality check is used to prevent copying of the same value by returningthis
.- Parameters:
value
- A new value for testNegativesByResultDate- Returns:
- A modified copy of the
this
object
-
withCumulativeInfections
Copy the current immutable object by setting a value for thecumulativeInfections
attribute. A value equality check is used to prevent copying of the same value by returningthis
.- Parameters:
value
- A new value for cumulativeInfections- Returns:
- A modified copy of the
this
object
-
withCumulativeAdmissions
Copy the current immutable object by setting a value for thecumulativeAdmissions
attribute. A value equality check is used to prevent copying of the same value by returningthis
.- Parameters:
value
- A new value for cumulativeAdmissions- Returns:
- A modified copy of the
this
object
-
withMaximumIncidence
Copy the current immutable object by setting a value for themaximumIncidence
attribute. A value equality check is used to prevent copying of the same value by returningthis
.- Parameters:
value
- A new value for maximumIncidence- Returns:
- A modified copy of the
this
object
-
withTimeToMaximumIncidence
Copy the current immutable object by setting a value for thetimeToMaximumIncidence
attribute. A value equality check is used to prevent copying of the same value by returningthis
.- Parameters:
value
- A new value for timeToMaximumIncidence- Returns:
- A modified copy of the
this
object
-
withMaximumHospitalBurden
Copy the current immutable object by setting a value for themaximumHospitalBurden
attribute. A value equality check is used to prevent copying of the same value by returningthis
.- Parameters:
value
- A new value for maximumHospitalBurden- Returns:
- A modified copy of the
this
object
-
withMaximumPrevalence
Copy the current immutable object by setting a value for themaximumPrevalence
attribute. A value strict bits equality used to prevent copying of the same value by returningthis
.- Parameters:
value
- A new value for maximumPrevalence- Returns:
- A modified copy of the
this
object
-
withCumulativeMobilityDecrease
Copy the current immutable object by setting a value for thecumulativeMobilityDecrease
attribute. A value strict bits equality used to prevent copying of the same value by returningthis
.- Parameters:
value
- A new value for cumulativeMobilityDecrease- Returns:
- A modified copy of the
this
object
-
withCumulativeComplianceDecrease
Copy the current immutable object by setting a value for thecumulativeComplianceDecrease
attribute. A value strict bits equality used to prevent copying of the same value by returningthis
.- Parameters:
value
- A new value for cumulativeComplianceDecrease- Returns:
- A modified copy of the
this
object
-
equals
This instance is equal to all instances ofImmutableOutbreakHistory
that have equal attribute values. -
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
. -
toString
Prints the immutable valueOutbreakHistory
with attribute values. -
getMaxDelay
public int getMaxDelay()Internal helper function for looking at delay of test resultsReturns 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 interfaceOutbreakHistory
- Returns:
- A lazily initialized value of the
maxDelay
attribute
-
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 interfaceOutbreakHistory
- Returns:
- A lazily initialized value of the
testPositivesBySampleDate
attribute
-
getTestNegativesBySampleDate
The number of tests reported as positive on the given dayReturns 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 interfaceOutbreakHistory
- Returns:
- A lazily initialized value of the
testNegativesBySampleDate
attribute - See Also:
-
copyOf
Creates an immutable copy of aOutbreakHistory
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 forImmutableOutbreakHistory
.prefilled with attibute values ofthis
instance to easily create modified copies.- Returns:
- A new ImmutableOutbreakHistory builder with attributes of
this
instance
-
builder
Creates a builder forImmutableOutbreakHistory
.ImmutableOutbreakHistory.builder() .setEntity(io.github.ai4ci.abm.Outbreak) // required
entity
.setTime(Integer) // requiredtime
.setInfectedCount(long) // requiredinfectedCount
.setIncidence(long) // requiredincidence
.setTestPositivesByResultDate(long) // requiredtestPositivesByResultDate
.setTestNegativesByResultDate(long) // requiredtestNegativesByResultDate
.setCumulativeInfections(long) // requiredcumulativeInfections
.setCumulativeAdmissions(long) // requiredcumulativeAdmissions
.setMaximumIncidence(long) // requiredmaximumIncidence
.setTimeToMaximumIncidence(long) // requiredtimeToMaximumIncidence
.setMaximumHospitalBurden(long) // requiredmaximumHospitalBurden
.setMaximumPrevalence(double) // requiredmaximumPrevalence
.setCumulativeMobilityDecrease(double) // requiredcumulativeMobilityDecrease
.setCumulativeComplianceDecrease(double) // requiredcumulativeComplianceDecrease
.build();- Returns:
- A new ImmutableOutbreakHistory builder
-