Package io.github.ai4ci.config.setup
Class ImmutableAgeStratifiedNetworkConfiguration.Builder
java.lang.Object
io.github.ai4ci.config.setup.ImmutableAgeStratifiedNetworkConfiguration.Builder
- All Implemented Interfaces:
AgeStratifiedNetworkConfiguration.Builder
,SetupConfiguration.Builder
- Enclosing class:
- ImmutableAgeStratifiedNetworkConfiguration
@NotThreadSafe
public static final class ImmutableAgeStratifiedNetworkConfiguration.Builder
extends Object
implements AgeStratifiedNetworkConfiguration.Builder
Builds instances of type
ImmutableAgeStratifiedNetworkConfiguration
.
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 newImmutableAgeStratifiedNetworkConfiguration
.from
(Abstraction.Named instance) Fill a builder with attribute values from the providedio.github.ai4ci.abm.mechanics.Abstraction.Named
instance.from
(Abstraction.Replica instance) Fill a builder with attribute values from the providedio.github.ai4ci.abm.mechanics.Abstraction.Replica
instance.from
(AgeStratifiedNetworkConfiguration instance) Fill a builder with attribute values from the providedio.github.ai4ci.config.setup.AgeStratifiedNetworkConfiguration
instance.from
(SetupConfiguration instance) Fill a builder with attribute values from the providedio.github.ai4ci.config.setup.SetupConfiguration
instance.setAgeDistribution
(EmpiricalDistribution ageDistribution) Initializes the value for theageDistribution
attribute.setInitialImports
(Integer initialImports) Initializes the value for theinitialImports
attribute.Initializes the value for thename
attribute.setNetworkConnectedness
(int networkConnectedness) Initializes the value for thenetworkConnectedness
attribute.setNetworkRandomness
(double networkRandomness) Initializes the value for thenetworkRandomness
attribute.setNetworkSize
(Integer networkSize) Initializes the value for thenetworkSize
attribute.setNormalisedOddsContactFromAgeDifference
(Abstraction.SimpleFunction normalisedOddsContactFromAgeDifference) Initializes the value for thenormalisedOddsContactFromAgeDifference
attribute.setOddsContactFromAgeDifference
(Abstraction.SimpleFunction oddsContactFromAgeDifference) Initializes the value for theoddsContactFromAgeDifference
attribute.setReplicate
(Integer replicate) Initializes the value for thereplicate
attribute.
-
Method Details
-
from
@CanIgnoreReturnValue public final ImmutableAgeStratifiedNetworkConfiguration.Builder from(SetupConfiguration instance) Fill a builder with attribute values from the providedio.github.ai4ci.config.setup.SetupConfiguration
instance.- Parameters:
instance
- The instance from which to copy values- Returns:
this
builder for use in a chained invocation
-
from
@CanIgnoreReturnValue public final ImmutableAgeStratifiedNetworkConfiguration.Builder from(AgeStratifiedNetworkConfiguration instance) Fill a builder with attribute values from the providedio.github.ai4ci.config.setup.AgeStratifiedNetworkConfiguration
instance.- Parameters:
instance
- The instance from which to copy values- Returns:
this
builder for use in a chained invocation
-
from
@CanIgnoreReturnValue public final ImmutableAgeStratifiedNetworkConfiguration.Builder from(Abstraction.Named instance) Fill a builder with attribute values from the providedio.github.ai4ci.abm.mechanics.Abstraction.Named
instance.- Parameters:
instance
- The instance from which to copy values- Returns:
this
builder for use in a chained invocation
-
from
@CanIgnoreReturnValue public final ImmutableAgeStratifiedNetworkConfiguration.Builder from(Abstraction.Replica instance) Fill a builder with attribute values from the providedio.github.ai4ci.abm.mechanics.Abstraction.Replica
instance.- Parameters:
instance
- The instance from which to copy values- Returns:
this
builder for use in a chained invocation
-
setName
@CanIgnoreReturnValue public final ImmutableAgeStratifiedNetworkConfiguration.Builder setName(String name) Initializes the value for thename
attribute.- Specified by:
setName
in interfaceSetupConfiguration.Builder
- Parameters:
name
- The value for name- Returns:
this
builder for use in a chained invocation
-
setReplicate
@CanIgnoreReturnValue public final ImmutableAgeStratifiedNetworkConfiguration.Builder setReplicate(Integer replicate) Initializes the value for thereplicate
attribute.If not set, this attribute will have a default value as returned by the initializer of
replicate
.- Specified by:
setReplicate
in interfaceSetupConfiguration.Builder
- Parameters:
replicate
- The value for replicate- Returns:
this
builder for use in a chained invocation
-
setNetworkSize
@CanIgnoreReturnValue public final ImmutableAgeStratifiedNetworkConfiguration.Builder setNetworkSize(Integer networkSize) Initializes the value for thenetworkSize
attribute.- Parameters:
networkSize
- The value for networkSize- Returns:
this
builder for use in a chained invocation
-
setInitialImports
@CanIgnoreReturnValue public final ImmutableAgeStratifiedNetworkConfiguration.Builder setInitialImports(Integer initialImports) Initializes the value for theinitialImports
attribute.- Parameters:
initialImports
- The value for initialImports- Returns:
this
builder for use in a chained invocation
-
setAgeDistribution
@CanIgnoreReturnValue public final ImmutableAgeStratifiedNetworkConfiguration.Builder setAgeDistribution(EmpiricalDistribution ageDistribution) Initializes the value for theageDistribution
attribute.- Parameters:
ageDistribution
- The value for ageDistribution- Returns:
this
builder for use in a chained invocation
-
setNetworkConnectedness
@CanIgnoreReturnValue public final ImmutableAgeStratifiedNetworkConfiguration.Builder setNetworkConnectedness(int networkConnectedness) Initializes the value for thenetworkConnectedness
attribute.- Parameters:
networkConnectedness
- The value for networkConnectedness- Returns:
this
builder for use in a chained invocation
-
setNetworkRandomness
@CanIgnoreReturnValue public final ImmutableAgeStratifiedNetworkConfiguration.Builder setNetworkRandomness(double networkRandomness) Initializes the value for thenetworkRandomness
attribute.- Parameters:
networkRandomness
- The value for networkRandomness- Returns:
this
builder for use in a chained invocation
-
setOddsContactFromAgeDifference
@CanIgnoreReturnValue public final ImmutableAgeStratifiedNetworkConfiguration.Builder setOddsContactFromAgeDifference(Abstraction.SimpleFunction oddsContactFromAgeDifference) Initializes the value for theoddsContactFromAgeDifference
attribute.- Parameters:
oddsContactFromAgeDifference
- The value for oddsContactFromAgeDifference- Returns:
this
builder for use in a chained invocation
-
setNormalisedOddsContactFromAgeDifference
@CanIgnoreReturnValue public final ImmutableAgeStratifiedNetworkConfiguration.Builder setNormalisedOddsContactFromAgeDifference(Abstraction.SimpleFunction normalisedOddsContactFromAgeDifference) Initializes the value for thenormalisedOddsContactFromAgeDifference
attribute.If not set, this attribute will have a default value as returned by the initializer of
normalisedOddsContactFromAgeDifference
.- Parameters:
normalisedOddsContactFromAgeDifference
- The value for normalisedOddsContactFromAgeDifference- Returns:
this
builder for use in a chained invocation
-
build
Builds a newImmutableAgeStratifiedNetworkConfiguration
.- Specified by:
build
in interfaceSetupConfiguration.Builder
- Returns:
- An immutable instance of AgeStratifiedNetworkConfiguration
- Throws:
IllegalStateException
- if any required attributes are missing
-