Index: Ringtoets/Piping/src/Ringtoets.Piping.Data/Probabilistics/DesignVariable.cs
===================================================================
diff -u -r5d53c93d9e66f38ca73d333f85855ec815f962c5 -rc921a50a3d1e0e6bfceff4fdff0b27705825af11
--- Ringtoets/Piping/src/Ringtoets.Piping.Data/Probabilistics/DesignVariable.cs (.../DesignVariable.cs) (revision 5d53c93d9e66f38ca73d333f85855ec815f962c5)
+++ Ringtoets/Piping/src/Ringtoets.Piping.Data/Probabilistics/DesignVariable.cs (.../DesignVariable.cs) (revision c921a50a3d1e0e6bfceff4fdff0b27705825af11)
@@ -11,20 +11,38 @@
public class DesignVariable
{
private double percentile;
+ private IDistribution distribution;
///
/// Initializes a new instance of the class with
/// equal to 0.5.
///
- public DesignVariable()
+ /// is null.
+ public DesignVariable(IDistribution distribution)
{
+ Distribution = distribution;
percentile = 0.5;
}
///
/// Gets or sets the probabilistic distribution of the parameter being modeled.
///
- public IDistribution Distribution { get; set; }
+ /// is null.
+ public IDistribution Distribution
+ {
+ get
+ {
+ return distribution;
+ }
+ set
+ {
+ if (value == null)
+ {
+ throw new ArgumentNullException("value", Resources.DesignVariable_GetDesignValue_Distribution_must_be_set);
+ }
+ distribution = value;
+ }
+ }
///
/// Gets or sets the percentile used to derive a deterministic value based on .
@@ -49,13 +67,8 @@
/// Gets the design value based on the and .
///
/// A design value.
- /// is null.
public double GetDesignValue()
{
- if (Distribution == null)
- {
- throw new InvalidOperationException(Resources.DesignVariable_GetDesignValue_Distribution_must_be_set);
- }
return Distribution.InverseCDF(Percentile);
}
}