Index: Ringtoets/Piping/src/Ringtoets.Piping.Data/StochasticSoilProfile.cs =================================================================== diff -u -r4e4ced94d27f939fc77f364201840814dc542af1 -rf4efcc2bb58d597f4a19884d98d0ab79bab04b1c --- Ringtoets/Piping/src/Ringtoets.Piping.Data/StochasticSoilProfile.cs (.../StochasticSoilProfile.cs) (revision 4e4ced94d27f939fc77f364201840814dc542af1) +++ Ringtoets/Piping/src/Ringtoets.Piping.Data/StochasticSoilProfile.cs (.../StochasticSoilProfile.cs) (revision f4efcc2bb58d597f4a19884d98d0ab79bab04b1c) @@ -20,6 +20,7 @@ // All rights reserved. using System; +using Ringtoets.Piping.Data.Properties; using Ringtoets.Piping.Primitives; namespace Ringtoets.Piping.Data @@ -29,6 +30,8 @@ /// public class StochasticSoilProfile { + private double probability; + /// /// Creates a new instance of . /// @@ -53,24 +56,40 @@ public long SoilProfileId { get; private set; } /// - /// Gets the probability of the stochastic soil profile. + /// Gets the . /// - public double Probability { get; private set; } + public PipingSoilProfile SoilProfile { get; set; } /// - /// Gets the . + /// Gets the probability of the stochastic soil profile. /// - public PipingSoilProfile SoilProfile { get; set; } + /// Thrown when the is outside the range + /// [0, 1]. + public double Probability + { + get + { + return probability; + } + private set + { + if (!double.IsNaN(value) && (value < 0 || value > 1)) + { + throw new ArgumentOutOfRangeException(nameof(value), Resources.StochasticSoilProfile_Probability_Should_be_in_range_0_1); + } + probability = value; + } + } /// /// Updates the probability of the - /// by adding . + /// by adding . /// - /// The amount to increase the + /// The amount to increase the /// with. - public void AddProbability(double probability) + public void AddProbability(double probabilityToAdd) { - Probability += probability; + Probability += probabilityToAdd; } ///