Package io.github.ai4ci.abm
Class ImmutablePersonBaseline.Builder
java.lang.Object
io.github.ai4ci.abm.ImmutablePersonBaseline.Builder
- Enclosing class:
- ImmutablePersonBaseline
Builds instances of type
ImmutablePersonBaseline
.
Initialize attributes and then invoke the build()
method to create an
immutable instance.
Builder
is not thread-safe and generally should not be stored in a field or collection,
but instead used immediately to create instances.
-
Method Summary
Modifier and TypeMethodDescriptionbuild()
Builds a newImmutablePersonBaseline
.from
(PersonBaseline instance) Fill a builder with attribute values from the providedPersonBaseline
instance.setAppUseProbability
(Double appUseProbability) Initializes the value for theappUseProbability
attribute.setComplianceBaseline
(Double complianceBaseline) Initializes the value for thecomplianceBaseline
attribute.setDefaultBehaviourState
(StateMachine.BehaviourState defaultBehaviourState) Initializes the value for thedefaultBehaviourState
attribute.setMobilityBaseline
(Double mobilityBaseline) Initializes the value for themobilityBaseline
attribute.setSelfIsolationDepth
(Double selfIsolationDepth) Initializes the value for theselfIsolationDepth
attribute.setSymptomSensitivity
(Double symptomSensitivity) Initializes the value for thesymptomSensitivity
attribute.setSymptomSpecificity
(Double symptomSpecificity) Initializes the value for thesymptomSpecificity
attribute.setTransmissibilityModifier
(Double transmissibilityModifier) Initializes the value for thetransmissibilityModifier
attribute.
-
Method Details
-
from
Fill a builder with attribute values from the providedPersonBaseline
instance. Regular attribute values will be replaced with those from the given instance. Absent optional values will not replace present values.- Parameters:
instance
- The instance from which to copy values- Returns:
this
builder for use in a chained invocation
-
setMobilityBaseline
@CanIgnoreReturnValue public final ImmutablePersonBaseline.Builder setMobilityBaseline(Double mobilityBaseline) Initializes the value for themobilityBaseline
attribute.- Parameters:
mobilityBaseline
- The value for mobilityBaseline- Returns:
this
builder for use in a chained invocation
-
setTransmissibilityModifier
@CanIgnoreReturnValue public final ImmutablePersonBaseline.Builder setTransmissibilityModifier(Double transmissibilityModifier) Initializes the value for thetransmissibilityModifier
attribute.- Parameters:
transmissibilityModifier
- The value for transmissibilityModifier- Returns:
this
builder for use in a chained invocation
-
setComplianceBaseline
@CanIgnoreReturnValue public final ImmutablePersonBaseline.Builder setComplianceBaseline(Double complianceBaseline) Initializes the value for thecomplianceBaseline
attribute.- Parameters:
complianceBaseline
- The value for complianceBaseline- Returns:
this
builder for use in a chained invocation
-
setSymptomSpecificity
@CanIgnoreReturnValue public final ImmutablePersonBaseline.Builder setSymptomSpecificity(Double symptomSpecificity) Initializes the value for thesymptomSpecificity
attribute.- Parameters:
symptomSpecificity
- The value for symptomSpecificity- Returns:
this
builder for use in a chained invocation
-
setSymptomSensitivity
@CanIgnoreReturnValue public final ImmutablePersonBaseline.Builder setSymptomSensitivity(Double symptomSensitivity) Initializes the value for thesymptomSensitivity
attribute.- Parameters:
symptomSensitivity
- The value for symptomSensitivity- Returns:
this
builder for use in a chained invocation
-
setDefaultBehaviourState
@CanIgnoreReturnValue public final ImmutablePersonBaseline.Builder setDefaultBehaviourState(StateMachine.BehaviourState defaultBehaviourState) Initializes the value for thedefaultBehaviourState
attribute.- Parameters:
defaultBehaviourState
- The value for defaultBehaviourState- Returns:
this
builder for use in a chained invocation
-
setSelfIsolationDepth
@CanIgnoreReturnValue public final ImmutablePersonBaseline.Builder setSelfIsolationDepth(Double selfIsolationDepth) Initializes the value for theselfIsolationDepth
attribute.- Parameters:
selfIsolationDepth
- The value for selfIsolationDepth- Returns:
this
builder for use in a chained invocation
-
setAppUseProbability
@CanIgnoreReturnValue public final ImmutablePersonBaseline.Builder setAppUseProbability(Double appUseProbability) Initializes the value for theappUseProbability
attribute.- Parameters:
appUseProbability
- The value for appUseProbability- Returns:
this
builder for use in a chained invocation
-
build
Builds a newImmutablePersonBaseline
.- Returns:
- An immutable instance of PersonBaseline
- Throws:
IllegalStateException
- if any required attributes are missing
-