Class SensitivityAnalysis.UncertainParameter
java.lang.Object
neqsim.process.util.fielddevelopment.SensitivityAnalysis.UncertainParameter
- All Implemented Interfaces:
Serializable
- Enclosing class:
SensitivityAnalysis
public static final class SensitivityAnalysis.UncertainParameter
extends Object
implements Serializable
Uncertain parameter definition.
Encapsulates a parameter that varies between simulation runs, including its probability distribution and how to apply values to the process model.
- Version:
- 1.0
- Author:
- ESOL
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final SensitivityAnalysis.DistributionTypeprivate final Stringprivate final doubleprivate final doubleprivate final doubleprivate static final longprivate final BiConsumer<ProcessSystem, Double> private final String -
Constructor Summary
ConstructorsConstructorDescriptionUncertainParameter(String name, double p10, double p50, double p90, SensitivityAnalysis.DistributionType distribution, String unit, BiConsumer<ProcessSystem, Double> setter) Creates an uncertain parameter. -
Method Summary
Modifier and TypeMethodDescriptionvoidapply(ProcessSystem process, double value) Applies a value to the process system.Gets the distribution type.getName()Gets the parameter name.doublegetP10()Gets the P10 value.doublegetP50()Gets the P50 value.doublegetP90()Gets the P90 value.doublegetRange()Gets the range (P90 - P10).getUnit()Gets the unit.lognormal(String name, double p10, double p50, double p90, BiConsumer<ProcessSystem, Double> setter) Creates a log-normal distribution parameter.normal(String name, double p10, double p50, double p90, BiConsumer<ProcessSystem, Double> setter) Creates a normal distribution parameter.doubleSamples a random value from this parameter's distribution.private doublesampleLognormal(Random rng) private doublesampleNormal(Random rng) private doublesampleTriangular(Random rng) private doublesampleUniform(Random rng) toString()triangular(String name, double min, double mode, double max, String unit, BiConsumer<ProcessSystem, Double> setter) Creates a triangular distribution parameter with unit.triangular(String name, double min, double mode, double max, BiConsumer<ProcessSystem, Double> setter) Creates a triangular distribution parameter.uniform(String name, double min, double max, BiConsumer<ProcessSystem, Double> setter) Creates a uniform distribution parameter.
-
Field Details
-
serialVersionUID
private static final long serialVersionUID- See Also:
-
name
-
distribution
-
p10
private final double p10 -
p50
private final double p50 -
p90
private final double p90 -
unit
-
setter
-
-
Constructor Details
-
UncertainParameter
public UncertainParameter(String name, double p10, double p50, double p90, SensitivityAnalysis.DistributionType distribution, String unit, BiConsumer<ProcessSystem, Double> setter) Creates an uncertain parameter.- Parameters:
name- parameter name for reportingp10- 10th percentile (low case)p50- 50th percentile (base case)p90- 90th percentile (high case)distribution- probability distribution typeunit- engineering unit (for reporting)setter- function to apply parameter value to process
-
-
Method Details
-
triangular
public static SensitivityAnalysis.UncertainParameter triangular(String name, double min, double mode, double max, BiConsumer<ProcessSystem, Double> setter) Creates a triangular distribution parameter.- Parameters:
name- parameter namemin- minimum value (P10)mode- most likely value (P50)max- maximum value (P90)setter- function to apply value- Returns:
- uncertain parameter
-
triangular
public static SensitivityAnalysis.UncertainParameter triangular(String name, double min, double mode, double max, String unit, BiConsumer<ProcessSystem, Double> setter) Creates a triangular distribution parameter with unit.- Parameters:
name- parameter namemin- minimum value (P10)mode- most likely value (P50)max- maximum value (P90)unit- engineering unitsetter- function to apply value- Returns:
- uncertain parameter
-
normal
public static SensitivityAnalysis.UncertainParameter normal(String name, double p10, double p50, double p90, BiConsumer<ProcessSystem, Double> setter) Creates a normal distribution parameter.- Parameters:
name- parameter namep10- 10th percentilep50- 50th percentile (mean)p90- 90th percentilesetter- function to apply value- Returns:
- uncertain parameter
-
lognormal
public static SensitivityAnalysis.UncertainParameter lognormal(String name, double p10, double p50, double p90, BiConsumer<ProcessSystem, Double> setter) Creates a log-normal distribution parameter.- Parameters:
name- parameter namep10- 10th percentilep50- 50th percentilep90- 90th percentilesetter- function to apply value- Returns:
- uncertain parameter
-
uniform
public static SensitivityAnalysis.UncertainParameter uniform(String name, double min, double max, BiConsumer<ProcessSystem, Double> setter) Creates a uniform distribution parameter.- Parameters:
name- parameter namemin- minimum valuemax- maximum valuesetter- function to apply value- Returns:
- uncertain parameter
-
sample
Samples a random value from this parameter's distribution.- Parameters:
rng- random number generator- Returns:
- sampled value
-
sampleNormal
-
sampleLognormal
-
sampleTriangular
-
sampleUniform
-
apply
Applies a value to the process system.- Parameters:
process- process to modifyvalue- value to apply
-
getName
-
getDistribution
Gets the distribution type.- Returns:
- distribution
-
getP10
public double getP10()Gets the P10 value.- Returns:
- P10
-
getP50
public double getP50()Gets the P50 value.- Returns:
- P50
-
getP90
public double getP90()Gets the P90 value.- Returns:
- P90
-
getUnit
-
getRange
public double getRange()Gets the range (P90 - P10).- Returns:
- range
-
toString
-