Index: Demo/Ringtoets/src/Demo.Ringtoets/Commands/AddNewDemoAssessmentSectionCommand.cs =================================================================== diff -u -rc7c07db38829afdc5965c331844e1d39123944ff -r1e4d77c17c6eac78bfd705efdff9e52b4fca2c7e --- Demo/Ringtoets/src/Demo.Ringtoets/Commands/AddNewDemoAssessmentSectionCommand.cs (.../AddNewDemoAssessmentSectionCommand.cs) (revision c7c07db38829afdc5965c331844e1d39123944ff) +++ Demo/Ringtoets/src/Demo.Ringtoets/Commands/AddNewDemoAssessmentSectionCommand.cs (.../AddNewDemoAssessmentSectionCommand.cs) (revision 1e4d77c17c6eac78bfd705efdff9e52b4fca2c7e) @@ -6,13 +6,13 @@ using Core.Common.Gui; using Core.Common.Utils.IO; using Ringtoets.Common.Data.AssessmentSection; +using Ringtoets.Common.Data.Probabilistics; using Ringtoets.Common.Forms.PresentationObjects; using Ringtoets.Common.IO; using Ringtoets.HydraRing.Data; using Ringtoets.Integration.Data; using Ringtoets.Integration.Plugin.FileImporters; using Ringtoets.Piping.Data; -using Ringtoets.Piping.Data.Probabilistics; using Ringtoets.Piping.Forms.PresentationObjects; using Ringtoets.Piping.Plugin.FileImporter; Index: Demo/Ringtoets/test/Demo.Ringtoets.Test/Commands/AddNewDemoAssessmentSectionCommandTest.cs =================================================================== diff -u -rc7c07db38829afdc5965c331844e1d39123944ff -r1e4d77c17c6eac78bfd705efdff9e52b4fca2c7e --- Demo/Ringtoets/test/Demo.Ringtoets.Test/Commands/AddNewDemoAssessmentSectionCommandTest.cs (.../AddNewDemoAssessmentSectionCommandTest.cs) (revision c7c07db38829afdc5965c331844e1d39123944ff) +++ Demo/Ringtoets/test/Demo.Ringtoets.Test/Commands/AddNewDemoAssessmentSectionCommandTest.cs (.../AddNewDemoAssessmentSectionCommandTest.cs) (revision 1e4d77c17c6eac78bfd705efdff9e52b4fca2c7e) @@ -9,10 +9,10 @@ using Demo.Ringtoets.Commands; using NUnit.Framework; using Rhino.Mocks; +using Ringtoets.Common.Data.Probabilistics; using Ringtoets.HydraRing.Data; using Ringtoets.Integration.Data; using Ringtoets.Piping.Data; -using Ringtoets.Piping.Data.Probabilistics; using Ringtoets.Piping.Primitives; using Ringtoets.Piping.Service; Index: Ringtoets/Common/src/Ringtoets.Common.Data/Probabilistics/DesignVariable.cs =================================================================== diff -u --- Ringtoets/Common/src/Ringtoets.Common.Data/Probabilistics/DesignVariable.cs (revision 0) +++ Ringtoets/Common/src/Ringtoets.Common.Data/Probabilistics/DesignVariable.cs (revision 1e4d77c17c6eac78bfd705efdff9e52b4fca2c7e) @@ -0,0 +1,109 @@ +// Copyright (C) Stichting Deltares 2016. All rights reserved. +// +// This file is part of Ringtoets. +// +// Ringtoets is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +using System; +using Core.Common.Base.Data; +using MathNet.Numerics.Distributions; +using Ringtoets.Common.Data.Properties; + +namespace Ringtoets.Common.Data.Probabilistics +{ + /// + /// This class is a representation of a variable derived from a probabilistic distribution, + /// based on a percentile. + /// + public abstract class DesignVariable where DistributionType : IDistribution + { + private double percentile; + private DistributionType distribution; + + /// + /// Initializes a new instance of the class with + /// equal to 0.5. + /// + /// is null. + protected DesignVariable(DistributionType distribution) + { + Distribution = distribution; + percentile = 0.5; + } + + /// + /// Gets or sets the probabilistic distribution of the parameter being modeled. + /// + /// is null. + public DistributionType 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 . + /// + public double Percentile + { + get + { + return percentile; + } + set + { + if (value < 0.0 || value > 1.0) + { + throw new ArgumentOutOfRangeException("value", Resources.DesignVariable_Percentile_must_be_in_range); + } + percentile = value; + } + } + + /// + /// Gets the design value based on the and . + /// + /// A design value. + public abstract RoundedDouble GetDesignValue(); + + /// + /// Determines the design value based on a 'normal space' expected value and standard deviation. + /// + /// The expected value. + /// The standard deviation. + /// The design value + protected RoundedDouble DetermineDesignValue(RoundedDouble expectedValue, RoundedDouble standardDeviation) + { + // Design factor is determined using the 'probit function', which is the inverse + // CDF function of the standard normal distribution. For more information see: + // "Quantile function" https://en.wikipedia.org/wiki/Normal_distribution + double designFactor = Normal.InvCDF(0.0, 1.0, Percentile); + return expectedValue + designFactor*standardDeviation; + } + } +} \ No newline at end of file Index: Ringtoets/Common/src/Ringtoets.Common.Data/Probabilistics/IDistribution.cs =================================================================== diff -u --- Ringtoets/Common/src/Ringtoets.Common.Data/Probabilistics/IDistribution.cs (revision 0) +++ Ringtoets/Common/src/Ringtoets.Common.Data/Probabilistics/IDistribution.cs (revision 1e4d77c17c6eac78bfd705efdff9e52b4fca2c7e) @@ -0,0 +1,43 @@ +// Copyright (C) Stichting Deltares 2016. All rights reserved. +// +// This file is part of Ringtoets. +// +// Ringtoets is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +using System; +using Core.Common.Base.Data; + +namespace Ringtoets.Common.Data.Probabilistics +{ + /// + /// This object represents a probabilistic distribution. + /// + public interface IDistribution + { + /// + /// Gets or sets the mean (expected value, E(X)) of the distribution. + /// + RoundedDouble Mean { get; set; } + + /// + /// Gets or sets the standard deviation (square root of the Var(X)) of the distribution. + /// + /// Standard deviation is less than 0. + RoundedDouble StandardDeviation { get; set; } + } +} \ No newline at end of file Index: Ringtoets/Common/src/Ringtoets.Common.Data/Probabilistics/LognormalDistribution.cs =================================================================== diff -u --- Ringtoets/Common/src/Ringtoets.Common.Data/Probabilistics/LognormalDistribution.cs (revision 0) +++ Ringtoets/Common/src/Ringtoets.Common.Data/Probabilistics/LognormalDistribution.cs (revision 1e4d77c17c6eac78bfd705efdff9e52b4fca2c7e) @@ -0,0 +1,93 @@ +// Copyright (C) Stichting Deltares 2016. All rights reserved. +// +// This file is part of Ringtoets. +// +// Ringtoets is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +using System; +using Core.Common.Base.Data; +using Ringtoets.Common.Data.Properties; + +namespace Ringtoets.Common.Data.Probabilistics +{ + /// + /// Class representing a log-normal distribution. + /// + public class LognormalDistribution : IDistribution + { + private RoundedDouble standardDeviation; + private RoundedDouble mean; + + /// + /// Initializes a new instance of the class, + /// initialized as the standard log-normal distribution (mu=0, sigma=1). + /// + /// The number of decimal places. + /// + /// Thrown when is not in range [1, ]. + /// + public LognormalDistribution(int numberOfDecimalPlaces) + { + if (numberOfDecimalPlaces == 0) + { + // This causes the default initialization set mean to 0, which is invalid. + throw new ArgumentOutOfRangeException("numberOfDecimalPlaces", + "Value must be in range [1, 15]."); + } + // Simplified calculation mean and standard deviation given mu=0 and sigma=1. + mean = new RoundedDouble(numberOfDecimalPlaces, Math.Exp(-0.5)); + standardDeviation = new RoundedDouble(numberOfDecimalPlaces, Math.Sqrt((Math.Exp(1) - 1)*Math.Exp(1))); + } + + /// + /// Gets or sets the mean (expected value, E(X)) of the distribution. + /// + /// Expected value is less then or equal to 0. + public RoundedDouble Mean + { + get + { + return mean; + } + set + { + if (value <= 0) + { + throw new ArgumentOutOfRangeException("value", Resources.LognormalDistribution_Mean_must_be_greater_equal_to_zero); + } + mean = value.ToPrecision(mean.NumberOfDecimalPlaces); + } + } + + public RoundedDouble StandardDeviation + { + get + { + return standardDeviation; + } + set + { + if (value < 0) + { + throw new ArgumentOutOfRangeException("value", Resources.StandardDeviation_Should_be_greater_than_or_equal_to_zero); + } + standardDeviation = value.ToPrecision(standardDeviation.NumberOfDecimalPlaces); + } + } + } +} \ No newline at end of file Index: Ringtoets/Common/src/Ringtoets.Common.Data/Probabilistics/LognormalDistributionDesignVariable.cs =================================================================== diff -u --- Ringtoets/Common/src/Ringtoets.Common.Data/Probabilistics/LognormalDistributionDesignVariable.cs (revision 0) +++ Ringtoets/Common/src/Ringtoets.Common.Data/Probabilistics/LognormalDistributionDesignVariable.cs (revision 1e4d77c17c6eac78bfd705efdff9e52b4fca2c7e) @@ -0,0 +1,67 @@ +// Copyright (C) Stichting Deltares 2016. All rights reserved. +// +// This file is part of Ringtoets. +// +// Ringtoets is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +using System; +using Core.Common.Base.Data; + +namespace Ringtoets.Common.Data.Probabilistics +{ + /// + /// This class defines a design variable for a lognormal distribution. + /// + public class LognormalDistributionDesignVariable : DesignVariable + { + /// + /// Initializes a new instance of the class. + /// + /// A lognormal distribution. + public LognormalDistributionDesignVariable(LognormalDistribution distribution) : base(distribution) {} + + public override RoundedDouble GetDesignValue() + { + RoundedDouble normalSpaceDesignValue = DetermineDesignValueInNormalDistributionSpace(); + return ProjectFromNormalToLognormalSpace(normalSpaceDesignValue); + } + + /// + /// Projects into 'normal + /// distribution' space and calculates the design value for that value space. + /// + /// The design value in 'normal distribution' space. + private RoundedDouble DetermineDesignValueInNormalDistributionSpace() + { + // Determine normal distribution parameters from log-normal parameters, as + // design value can only be determined in 'normal distribution' space. + // Below formula's come from Tu-Delft College dictaat "b3 Probabilistisch Ontwerpen" + // by ir. A.C.W.M. Vrouwenvelder and ir.J.K. Vrijling 5th reprint 1987. + double sigmaLogOverMuLog = Distribution.StandardDeviation/Distribution.Mean; + double sigmaNormal = Math.Sqrt(Math.Log(sigmaLogOverMuLog*sigmaLogOverMuLog + 1.0)); + double muNormal = Math.Log(Distribution.Mean) - 0.5*sigmaNormal*sigmaNormal; + return DetermineDesignValue(new RoundedDouble(Distribution.Mean.NumberOfDecimalPlaces, muNormal), + new RoundedDouble(Distribution.StandardDeviation.NumberOfDecimalPlaces, sigmaNormal)); + } + + private static RoundedDouble ProjectFromNormalToLognormalSpace(RoundedDouble normalSpaceDesignValue) + { + return new RoundedDouble(normalSpaceDesignValue.NumberOfDecimalPlaces, Math.Exp(normalSpaceDesignValue)); + } + } +} \ No newline at end of file Index: Ringtoets/Common/src/Ringtoets.Common.Data/Probabilistics/NormalDistribution.cs =================================================================== diff -u --- Ringtoets/Common/src/Ringtoets.Common.Data/Probabilistics/NormalDistribution.cs (revision 0) +++ Ringtoets/Common/src/Ringtoets.Common.Data/Probabilistics/NormalDistribution.cs (revision 1e4d77c17c6eac78bfd705efdff9e52b4fca2c7e) @@ -0,0 +1,78 @@ +// Copyright (C) Stichting Deltares 2016. All rights reserved. +// +// This file is part of Ringtoets. +// +// Ringtoets is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +using System; +using Core.Common.Base.Data; +using Ringtoets.Common.Data.Properties; + +namespace Ringtoets.Common.Data.Probabilistics +{ + /// + /// Class representing a normal (or Gaussian) distribution. + /// + public class NormalDistribution : IDistribution + { + private RoundedDouble standardDeviation; + private RoundedDouble mean; + + /// + /// Initializes a new instance of the class, + /// initialized as the standard normal distribution. + /// + /// The number of decimal places of the distribution. + /// + /// Thrown when is not in range [0, ]. + /// + public NormalDistribution(int numberOfDecimalPlaces) + { + mean = new RoundedDouble(numberOfDecimalPlaces, 0.0); + standardDeviation = new RoundedDouble(numberOfDecimalPlaces, 1.0); + } + + public RoundedDouble Mean + { + get + { + return mean; + } + set + { + mean = value.ToPrecision(mean.NumberOfDecimalPlaces); + } + } + + public RoundedDouble StandardDeviation + { + get + { + return standardDeviation; + } + set + { + if (value < 0) + { + throw new ArgumentOutOfRangeException("value", Resources.StandardDeviation_Should_be_greater_than_or_equal_to_zero); + } + standardDeviation = value.ToPrecision(standardDeviation.NumberOfDecimalPlaces); + } + } + } +} \ No newline at end of file Index: Ringtoets/Common/src/Ringtoets.Common.Data/Probabilistics/NormalDistributionDesignVariable.cs =================================================================== diff -u --- Ringtoets/Common/src/Ringtoets.Common.Data/Probabilistics/NormalDistributionDesignVariable.cs (revision 0) +++ Ringtoets/Common/src/Ringtoets.Common.Data/Probabilistics/NormalDistributionDesignVariable.cs (revision 1e4d77c17c6eac78bfd705efdff9e52b4fca2c7e) @@ -0,0 +1,35 @@ +// Copyright (C) Stichting Deltares 2016. All rights reserved. +// +// This file is part of Ringtoets. +// +// Ringtoets is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +using Core.Common.Base.Data; + +namespace Ringtoets.Common.Data.Probabilistics +{ + public class NormalDistributionDesignVariable : DesignVariable + { + public NormalDistributionDesignVariable(NormalDistribution distribution) : base(distribution) {} + + public override RoundedDouble GetDesignValue() + { + return DetermineDesignValue(Distribution.Mean, Distribution.StandardDeviation); + } + } +} \ No newline at end of file Index: Ringtoets/Common/src/Ringtoets.Common.Data/Probabilistics/ShiftedLognormalDistribution.cs =================================================================== diff -u --- Ringtoets/Common/src/Ringtoets.Common.Data/Probabilistics/ShiftedLognormalDistribution.cs (revision 0) +++ Ringtoets/Common/src/Ringtoets.Common.Data/Probabilistics/ShiftedLognormalDistribution.cs (revision 1e4d77c17c6eac78bfd705efdff9e52b4fca2c7e) @@ -0,0 +1,62 @@ +// Copyright (C) Stichting Deltares 2016. All rights reserved. +// +// This file is part of Ringtoets. +// +// Ringtoets is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +using Core.Common.Base.Data; + +namespace Ringtoets.Common.Data.Probabilistics +{ + /// + /// Class represents a specialized case of that has + /// been shifted along the X-axis. + /// + public class ShiftedLognormalDistribution : LognormalDistribution + { + private RoundedDouble shift; + + /// + /// Initializes a new instance of the class, + /// initialized as the standard log-normal distribution (mu=0, sigma=1). + /// + /// The number of decimal places. + /// + /// Thrown when is not in range [0, ]. + /// + public ShiftedLognormalDistribution(int numberOfDecimalPlaces) : base(numberOfDecimalPlaces) + { + shift = new RoundedDouble(numberOfDecimalPlaces); + } + + /// + /// Gets or sets the shift applied to the log-normal distribution. + /// + public RoundedDouble Shift + { + get + { + return shift; + } + set + { + shift = value.ToPrecision(shift.NumberOfDecimalPlaces); + } + } + } +} \ No newline at end of file Index: Ringtoets/Common/src/Ringtoets.Common.Data/Probabilistics/ShiftedLognormalDistributionDesignVariable.cs =================================================================== diff -u --- Ringtoets/Common/src/Ringtoets.Common.Data/Probabilistics/ShiftedLognormalDistributionDesignVariable.cs (revision 0) +++ Ringtoets/Common/src/Ringtoets.Common.Data/Probabilistics/ShiftedLognormalDistributionDesignVariable.cs (revision 1e4d77c17c6eac78bfd705efdff9e52b4fca2c7e) @@ -0,0 +1,50 @@ +// Copyright (C) Stichting Deltares 2016. All rights reserved. +// +// This file is part of Ringtoets. +// +// Ringtoets is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +using Core.Common.Base.Data; + +namespace Ringtoets.Common.Data.Probabilistics +{ + /// + /// This class defines a design variable for a shifted lognormal distribution. + /// + public class ShiftedLognormalDistributionDesignVariable : DesignVariable + { + private readonly ShiftedLognormalDistribution distribution; + + /// + /// Initializes a new instance of the class. + /// + /// A shifted lognormal distribution. + public ShiftedLognormalDistributionDesignVariable(ShiftedLognormalDistribution distribution) : base(distribution) + { + this.distribution = distribution; + } + + public override RoundedDouble GetDesignValue() + { + return new LognormalDistributionDesignVariable(Distribution) + { + Percentile = Percentile + }.GetDesignValue() + distribution.Shift; + } + } +} \ No newline at end of file Index: Ringtoets/Common/src/Ringtoets.Common.Data/Properties/Resources.Designer.cs =================================================================== diff -u -r091761507d94a388b18fefebd38a5d106b9b89c4 -r1e4d77c17c6eac78bfd705efdff9e52b4fca2c7e --- Ringtoets/Common/src/Ringtoets.Common.Data/Properties/Resources.Designer.cs (.../Resources.Designer.cs) (revision 091761507d94a388b18fefebd38a5d106b9b89c4) +++ Ringtoets/Common/src/Ringtoets.Common.Data/Properties/Resources.Designer.cs (.../Resources.Designer.cs) (revision 1e4d77c17c6eac78bfd705efdff9e52b4fca2c7e) @@ -1,7 +1,7 @@ //------------------------------------------------------------------------------ // // This code was generated by a tool. -// Runtime Version:4.0.30319.17929 +// Runtime Version:4.0.30319.42000 // // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. @@ -79,6 +79,24 @@ } /// + /// Looks up a localized string similar to Een kansverdeling moet opgegeven zijn om op basis van die data een rekenwaarde te bepalen.. + /// + public static string DesignVariable_GetDesignValue_Distribution_must_be_set { + get { + return ResourceManager.GetString("DesignVariable_GetDesignValue_Distribution_must_be_set", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Percentiel moet in het bereik van [0, 1] vallen.. + /// + public static string DesignVariable_Percentile_must_be_in_range { + get { + return ResourceManager.GetString("DesignVariable_Percentile_must_be_in_range", resourceCulture); + } + } + + /// /// Looks up a localized string similar to Oordeel. /// public static string FailureMechanism_AssessmentResult_DisplayName { @@ -153,6 +171,15 @@ } /// + /// Looks up a localized string similar to Gemiddelde moet groter zijn dan 0.. + /// + public static string LognormalDistribution_Mean_must_be_greater_equal_to_zero { + get { + return ResourceManager.GetString("LognormalDistribution_Mean_must_be_greater_equal_to_zero", resourceCulture); + } + } + + /// /// Looks up a localized string similar to Overig. /// public static string OtherFailureMechanism_DisplayName { @@ -187,5 +214,14 @@ return ResourceManager.GetString("ReferenceLine_SetGeometry_New_geometry_has_null_coordinate", resourceCulture); } } + + /// + /// Looks up a localized string similar to Standaard afwijking (σ) moet groter zijn dan of gelijk zijn aan 0.. + /// + public static string StandardDeviation_Should_be_greater_than_or_equal_to_zero { + get { + return ResourceManager.GetString("StandardDeviation_Should_be_greater_than_or_equal_to_zero", resourceCulture); + } + } } } Index: Ringtoets/Common/src/Ringtoets.Common.Data/Properties/Resources.resx =================================================================== diff -u -r091761507d94a388b18fefebd38a5d106b9b89c4 -r1e4d77c17c6eac78bfd705efdff9e52b4fca2c7e --- Ringtoets/Common/src/Ringtoets.Common.Data/Properties/Resources.resx (.../Resources.resx) (revision 091761507d94a388b18fefebd38a5d106b9b89c4) +++ Ringtoets/Common/src/Ringtoets.Common.Data/Properties/Resources.resx (.../Resources.resx) (revision 1e4d77c17c6eac78bfd705efdff9e52b4fca2c7e) @@ -159,4 +159,16 @@ Referentielijn + + Een kansverdeling moet opgegeven zijn om op basis van die data een rekenwaarde te bepalen. + + + Percentiel moet in het bereik van [0, 1] vallen. + + + Gemiddelde moet groter zijn dan 0. + + + Standaard afwijking (σ) moet groter zijn dan of gelijk zijn aan 0. + \ No newline at end of file Index: Ringtoets/Common/src/Ringtoets.Common.Data/Ringtoets.Common.Data.csproj =================================================================== diff -u -r3462d84f3304a35ba5ce26c7d3afc9c31cdf9205 -r1e4d77c17c6eac78bfd705efdff9e52b4fca2c7e --- Ringtoets/Common/src/Ringtoets.Common.Data/Ringtoets.Common.Data.csproj (.../Ringtoets.Common.Data.csproj) (revision 3462d84f3304a35ba5ce26c7d3afc9c31cdf9205) +++ Ringtoets/Common/src/Ringtoets.Common.Data/Ringtoets.Common.Data.csproj (.../Ringtoets.Common.Data.csproj) (revision 1e4d77c17c6eac78bfd705efdff9e52b4fca2c7e) @@ -27,8 +27,13 @@ AllRules.ruleset + + ..\..\..\..\packages\MathNet.Numerics.3.8.0\lib\net40\MathNet.Numerics.dll + True + + @@ -47,6 +52,14 @@ + + + + + + + + True @@ -87,6 +100,7 @@ Copying.licenseheader + + + + \ No newline at end of file Index: Ringtoets/Common/test/Ringtoets.Common.Data.Test/AssessmentSection/ReferenceLineTest.cs =================================================================== diff -u -ra9aafffab97152303562110b1d789bacb465ce24 -r1e4d77c17c6eac78bfd705efdff9e52b4fca2c7e --- Ringtoets/Common/test/Ringtoets.Common.Data.Test/AssessmentSection/ReferenceLineTest.cs (.../ReferenceLineTest.cs) (revision a9aafffab97152303562110b1d789bacb465ce24) +++ Ringtoets/Common/test/Ringtoets.Common.Data.Test/AssessmentSection/ReferenceLineTest.cs (.../ReferenceLineTest.cs) (revision 1e4d77c17c6eac78bfd705efdff9e52b4fca2c7e) @@ -1,4 +1,25 @@ -using System; +// Copyright (C) Stichting Deltares 2016. All rights reserved. +// +// This file is part of Ringtoets. +// +// Ringtoets is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +using System; using Core.Common.Base.Geometry; using Core.Common.TestUtil; using NUnit.Framework; Index: Ringtoets/Common/test/Ringtoets.Common.Data.Test/Contribution/FailureMechanismContributionItemTest.cs =================================================================== diff -u -r103f8cf52c957309a116106dc9ae31169ff83169 -r1e4d77c17c6eac78bfd705efdff9e52b4fca2c7e --- Ringtoets/Common/test/Ringtoets.Common.Data.Test/Contribution/FailureMechanismContributionItemTest.cs (.../FailureMechanismContributionItemTest.cs) (revision 103f8cf52c957309a116106dc9ae31169ff83169) +++ Ringtoets/Common/test/Ringtoets.Common.Data.Test/Contribution/FailureMechanismContributionItemTest.cs (.../FailureMechanismContributionItemTest.cs) (revision 1e4d77c17c6eac78bfd705efdff9e52b4fca2c7e) @@ -1,5 +1,26 @@ -using System; +// Copyright (C) Stichting Deltares 2016. All rights reserved. +// +// This file is part of Ringtoets. +// +// Ringtoets is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. +using System; + using Core.Common.TestUtil; using NUnit.Framework; Index: Ringtoets/Common/test/Ringtoets.Common.Data.Test/Contribution/OtherFailureMechanismTest.cs =================================================================== diff -u -rfa424689d48793c024e73bfcee1c202559eea3e0 -r1e4d77c17c6eac78bfd705efdff9e52b4fca2c7e --- Ringtoets/Common/test/Ringtoets.Common.Data.Test/Contribution/OtherFailureMechanismTest.cs (.../OtherFailureMechanismTest.cs) (revision fa424689d48793c024e73bfcee1c202559eea3e0) +++ Ringtoets/Common/test/Ringtoets.Common.Data.Test/Contribution/OtherFailureMechanismTest.cs (.../OtherFailureMechanismTest.cs) (revision 1e4d77c17c6eac78bfd705efdff9e52b4fca2c7e) @@ -1,5 +1,26 @@ -using NUnit.Framework; +// Copyright (C) Stichting Deltares 2016. All rights reserved. +// +// This file is part of Ringtoets. +// +// Ringtoets is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. +using NUnit.Framework; + using Ringtoets.Common.Data.Contribution; using Ringtoets.Common.Data.FailureMechanism; Index: Ringtoets/Common/test/Ringtoets.Common.Data.Test/FailureMechanism/FailureMechanismBaseTest.cs =================================================================== diff -u -r103f8cf52c957309a116106dc9ae31169ff83169 -r1e4d77c17c6eac78bfd705efdff9e52b4fca2c7e --- Ringtoets/Common/test/Ringtoets.Common.Data.Test/FailureMechanism/FailureMechanismBaseTest.cs (.../FailureMechanismBaseTest.cs) (revision 103f8cf52c957309a116106dc9ae31169ff83169) +++ Ringtoets/Common/test/Ringtoets.Common.Data.Test/FailureMechanism/FailureMechanismBaseTest.cs (.../FailureMechanismBaseTest.cs) (revision 1e4d77c17c6eac78bfd705efdff9e52b4fca2c7e) @@ -1,4 +1,25 @@ -using System; +// Copyright (C) Stichting Deltares 2016. All rights reserved. +// +// This file is part of Ringtoets. +// +// Ringtoets is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +using System; using System.Collections.Generic; using System.Linq; using Core.Common.Base; Index: Ringtoets/Common/test/Ringtoets.Common.Data.Test/FailureMechanism/FailureMechanismSectionTest.cs =================================================================== diff -u -ra9aafffab97152303562110b1d789bacb465ce24 -r1e4d77c17c6eac78bfd705efdff9e52b4fca2c7e --- Ringtoets/Common/test/Ringtoets.Common.Data.Test/FailureMechanism/FailureMechanismSectionTest.cs (.../FailureMechanismSectionTest.cs) (revision a9aafffab97152303562110b1d789bacb465ce24) +++ Ringtoets/Common/test/Ringtoets.Common.Data.Test/FailureMechanism/FailureMechanismSectionTest.cs (.../FailureMechanismSectionTest.cs) (revision 1e4d77c17c6eac78bfd705efdff9e52b4fca2c7e) @@ -1,4 +1,25 @@ -using System; +// Copyright (C) Stichting Deltares 2016. All rights reserved. +// +// This file is part of Ringtoets. +// +// Ringtoets is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +using System; using System.Linq; using Core.Common.Base.Geometry; using Core.Common.TestUtil; Index: Ringtoets/Common/test/Ringtoets.Common.Data.Test/Probabilistics/DesignVariableTest.cs =================================================================== diff -u --- Ringtoets/Common/test/Ringtoets.Common.Data.Test/Probabilistics/DesignVariableTest.cs (revision 0) +++ Ringtoets/Common/test/Ringtoets.Common.Data.Test/Probabilistics/DesignVariableTest.cs (revision 1e4d77c17c6eac78bfd705efdff9e52b4fca2c7e) @@ -0,0 +1,145 @@ +// Copyright (C) Stichting Deltares 2016. All rights reserved. +// +// This file is part of Ringtoets. +// +// Ringtoets is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +using System; +using Core.Common.Base.Data; +using NUnit.Framework; +using Rhino.Mocks; +using Ringtoets.Common.Data.Probabilistics; + +namespace Ringtoets.Common.Data.Test.Probabilistics +{ + [TestFixture] + public class DesignVariableTest + { + [Test] + public void ParameteredConstructor_ExpectedValues() + { + // Setup + var mocks = new MockRepository(); + var distributionMock = mocks.StrictMock(); + mocks.ReplayAll(); + + // Call + var designVariable = new SimpleDesignVariable(distributionMock); + + // Assert + Assert.AreSame(distributionMock, designVariable.Distribution); + Assert.AreEqual(0.5, designVariable.Percentile); + mocks.VerifyAll(); // Expect no calls on mocks + } + + [Test] + public void ParameteredConstructor_DistributionIsNull_ThrowArgumentNullException() + { + // Call + TestDelegate call = () => new SimpleDesignVariable(null); + + // Assert + var exception = Assert.Throws(call); + string customMessagePart = exception.Message.Split(new[] + { + Environment.NewLine + }, StringSplitOptions.None)[0]; + Assert.AreEqual("Een kansverdeling moet opgegeven zijn om op basis van die data een rekenwaarde te bepalen.", customMessagePart); + } + + [Test] + [TestCase(-1234.5678)] + [TestCase(0 - 1e-6)] + [TestCase(1 + 1e-6)] + [TestCase(12345.789)] + public void Percentile_SettingInvalidValue_ThrowArgumentOutOfRangeException(double invalidPercentile) + { + // Setup + var mocks = new MockRepository(); + var distributionMock = mocks.StrictMock(); + mocks.ReplayAll(); + + var designVariable = new SimpleDesignVariable(distributionMock); + + // Call + TestDelegate call = () => designVariable.Percentile = invalidPercentile; + + // Assert + var exception = Assert.Throws(call); + string customMessagePart = exception.Message.Split(new[] + { + Environment.NewLine + }, StringSplitOptions.RemoveEmptyEntries)[0]; + Assert.AreEqual("Percentiel moet in het bereik van [0, 1] vallen.", customMessagePart); + mocks.VerifyAll(); // Expect no calls on mocks + } + + [Test] + [TestCase(0.0)] + [TestCase(0.54638291)] + [TestCase(1.0)] + public void Percentile_SettingValidValue_PropertySet(double validPercentile) + { + // Setup + var mocks = new MockRepository(); + var distributionMock = mocks.StrictMock(); + mocks.ReplayAll(); + + var designVariable = new SimpleDesignVariable(distributionMock); + + // Call + designVariable.Percentile = validPercentile; + + // Assert + Assert.AreEqual(validPercentile, designVariable.Percentile); + mocks.VerifyAll(); // Expect no calls on mocks + } + + [Test] + public void Distribution_SetToNull_ThrowArgumentNullException() + { + // Setup + var mocks = new MockRepository(); + var distributionMock = mocks.StrictMock(); + mocks.ReplayAll(); + + var designVariable = new SimpleDesignVariable(distributionMock); + + // Call + TestDelegate call = () => designVariable.Distribution = null; + + // Assert + var exception = Assert.Throws(call); + string customMessagePart = exception.Message.Split(new[] + { + Environment.NewLine + }, StringSplitOptions.None)[0]; + Assert.AreEqual("Een kansverdeling moet opgegeven zijn om op basis van die data een rekenwaarde te bepalen.", customMessagePart); + } + + private class SimpleDesignVariable : DesignVariable + { + public SimpleDesignVariable(IDistribution distribution) : base(distribution) {} + + public override RoundedDouble GetDesignValue() + { + throw new NotImplementedException(); + } + } + } +} \ No newline at end of file Index: Ringtoets/Common/test/Ringtoets.Common.Data.Test/Probabilistics/LognormalDistributionDesignVariableTest.cs =================================================================== diff -u --- Ringtoets/Common/test/Ringtoets.Common.Data.Test/Probabilistics/LognormalDistributionDesignVariableTest.cs (revision 0) +++ Ringtoets/Common/test/Ringtoets.Common.Data.Test/Probabilistics/LognormalDistributionDesignVariableTest.cs (revision 1e4d77c17c6eac78bfd705efdff9e52b4fca2c7e) @@ -0,0 +1,87 @@ +// Copyright (C) Stichting Deltares 2016. All rights reserved. +// +// This file is part of Ringtoets. +// +// Ringtoets is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +using System; +using Core.Common.Base.Data; +using NUnit.Framework; +using Ringtoets.Common.Data.Probabilistics; + +namespace Ringtoets.Common.Data.Test.Probabilistics +{ + [TestFixture] + public class LognormalDistributionDesignVariableTest + { + [Test] + public void ParameterdConstructor_ValidLognormalDistribution_ExpectedValues() + { + // Setup + var lognormalDistribution = new LognormalDistribution(2); + + // Call + var designValue = new LognormalDistributionDesignVariable(lognormalDistribution); + + // Assert + Assert.AreSame(lognormalDistribution, designValue.Distribution); + Assert.AreEqual(0.5, designValue.Percentile); + } + + /// + /// Tests the + /// against the values calculated with the excel sheet in WTI-33 (timestamp: 27-11-2015 10:27). + /// + /// MEAN. + /// VARIANCE. + /// Percentile. + /// Rekenwaarde. + [Test] + [TestCase(75, 70, 0.95, 89.4965)] + [TestCase(75, 70, 0.5, 74.5373)] + [TestCase(75, 70, 0.05, 62.0785)] + [TestCase(75, 123.45, 0.95, 94.5284)] + [TestCase(75, 1.2345, 0.95, 76.8381)] + [TestCase(123.45, 70, 0.95, 137.6756)] + [TestCase(1.2345, 70, 0.95, 4.5413)] + public void GetDesignVariable_ValidLognormalDistribution_ReturnExpectedValue( + double expectedValue, double variance, double percentile, + double expectedResult) + { + // Setup + const int numberOfDecimalPlaces = 4; + var lognormalDistribution = new LognormalDistribution(numberOfDecimalPlaces) + { + Mean = (RoundedDouble)expectedValue, + StandardDeviation = (RoundedDouble)Math.Sqrt(variance) + }; + + var designVariable = new LognormalDistributionDesignVariable(lognormalDistribution) + { + Percentile = percentile + }; + + // Call + RoundedDouble result = designVariable.GetDesignValue(); + + // Assert + Assert.AreEqual(numberOfDecimalPlaces, result.NumberOfDecimalPlaces); + Assert.AreEqual(expectedResult, result, 1e-4); + } + } +} \ No newline at end of file Index: Ringtoets/Common/test/Ringtoets.Common.Data.Test/Probabilistics/LognormalDistributionTest.cs =================================================================== diff -u --- Ringtoets/Common/test/Ringtoets.Common.Data.Test/Probabilistics/LognormalDistributionTest.cs (revision 0) +++ Ringtoets/Common/test/Ringtoets.Common.Data.Test/Probabilistics/LognormalDistributionTest.cs (revision 1e4d77c17c6eac78bfd705efdff9e52b4fca2c7e) @@ -0,0 +1,150 @@ +// Copyright (C) Stichting Deltares 2016. All rights reserved. +// +// This file is part of Ringtoets. +// +// Ringtoets is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +using System; +using Core.Common.Base.Data; +using Core.Common.TestUtil; +using NUnit.Framework; +using Ringtoets.Common.Data.Probabilistics; + +namespace Ringtoets.Common.Data.Test.Probabilistics +{ + [TestFixture] + public class LognormalDistributionTest + { + [Test] + [TestCase(1)] + [TestCase(9)] + [TestCase(15)] + public void DefaultConstructor_ExpectedValues(int numberOfDecimalPlaces) + { + // Call + var distribution = new LognormalDistribution(numberOfDecimalPlaces); + + // Assert + Assert.IsInstanceOf(distribution); + double expectedAccuracy = Math.Pow(10.0, -numberOfDecimalPlaces); + Assert.AreEqual(Math.Exp(-0.5), distribution.Mean, expectedAccuracy); + Assert.AreEqual(numberOfDecimalPlaces, distribution.Mean.NumberOfDecimalPlaces); + Assert.AreEqual(Math.Sqrt((Math.Exp(1) - 1) * Math.Exp(1)), distribution.StandardDeviation, expectedAccuracy); + Assert.AreEqual(numberOfDecimalPlaces, distribution.StandardDeviation.NumberOfDecimalPlaces); + } + + [Test] + public void Constructor_InvalidNumberOfDecimalPlaces_ThrowArgumentOutOfRangeException() + { + // Setup + + // Call + TestDelegate call = () => new LognormalDistribution(0); + + // Assert + TestHelper.AssertThrowsArgumentExceptionAndTestMessage(call, "Value must be in range [1, 15]."); + } + + [Test] + [TestCase(0)] + [TestCase(-123.45)] + public void Mean_SettingToLessThanOrEqualTo0_ThrowArgumentOutOfRangeException(double newMean) + { + // Setup + var distribution = new LognormalDistribution(2); + + // Call + TestDelegate call = () => distribution.Mean = (RoundedDouble)newMean; + + // Assert + var exception = Assert.Throws(call); + var customMessagePart = exception.Message.Split(new[]{Environment.NewLine}, StringSplitOptions.None)[0]; + Assert.AreEqual("Gemiddelde moet groter zijn dan 0.", customMessagePart); + } + + [Test] + [TestCase(0 + 1e-4)] + [TestCase(156.23)] + public void Mean_SettingValidValue_ValueIsSet(double newMean) + { + // Setup + const int numberOfDecimalPlaces = 4; + var distribution = new LognormalDistribution(numberOfDecimalPlaces); + + // Call + distribution.Mean = (RoundedDouble)newMean; + + // Assert + Assert.AreEqual(newMean, distribution.Mean, 1e-4); + Assert.AreEqual(numberOfDecimalPlaces, distribution.Mean.NumberOfDecimalPlaces); + } + + [Test] + [TestCase(1, 1.2)] + [TestCase(3, 1.235)] + [TestCase(4, 1.2345)] + [TestCase(15, 1.234500000000000)] + public void Mean_SetNewValue_GetValueRoundedToGivenNumberOfDecimalPlaces(int numberOfDecimalPlaces, double expectedStandardDeviation) + { + // Setup + var distribution = new LognormalDistribution(numberOfDecimalPlaces); + + // Call + distribution.Mean = new RoundedDouble(4, 1.2345); + + // Assert + Assert.AreEqual(numberOfDecimalPlaces, distribution.Mean.NumberOfDecimalPlaces); + Assert.AreEqual(expectedStandardDeviation, distribution.Mean.Value); + } + + [Test] + [TestCase(0 - 1e-4)] + [TestCase(-4)] + public void StandardDeviation_SettingToLessThan0_ThrowArgumentOutOfRangeException(double newStd) + { + // Setup + var distribution = new LognormalDistribution(4); + + // Call + TestDelegate call = () => distribution.StandardDeviation = (RoundedDouble)newStd; + + // Assert + ArgumentException exception = Assert.Throws(call); + string customMessagePart = exception.Message.Split(new []{Environment.NewLine}, StringSplitOptions.None)[0]; + Assert.AreEqual("Standaard afwijking (\u03C3) moet groter zijn dan of gelijk zijn aan 0.", customMessagePart); + } + + [Test] + [TestCase(1, 5.7)] + [TestCase(2, 5.68)] + [TestCase(3, 5.678)] + [TestCase(15, 5.678000000000000)] + public void StandardDeviation_SetNewValue_GetValueRoundedToGivenNumberOfDecimalPlaces(int numberOfDecimalPlaces, double expectedStandardDeviation) + { + // Setup + var distribution = new LognormalDistribution(numberOfDecimalPlaces); + + // Call + distribution.StandardDeviation = new RoundedDouble(3, 5.678); + + // Assert + Assert.AreEqual(numberOfDecimalPlaces, distribution.StandardDeviation.NumberOfDecimalPlaces); + Assert.AreEqual(expectedStandardDeviation, distribution.StandardDeviation.Value); + } + } +} \ No newline at end of file Index: Ringtoets/Common/test/Ringtoets.Common.Data.Test/Probabilistics/NormalDistributionDesignVariableTest.cs =================================================================== diff -u --- Ringtoets/Common/test/Ringtoets.Common.Data.Test/Probabilistics/NormalDistributionDesignVariableTest.cs (revision 0) +++ Ringtoets/Common/test/Ringtoets.Common.Data.Test/Probabilistics/NormalDistributionDesignVariableTest.cs (revision 1e4d77c17c6eac78bfd705efdff9e52b4fca2c7e) @@ -0,0 +1,85 @@ +// Copyright (C) Stichting Deltares 2016. All rights reserved. +// +// This file is part of Ringtoets. +// +// Ringtoets is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +using System; +using Core.Common.Base.Data; +using NUnit.Framework; +using Ringtoets.Common.Data.Probabilistics; + +namespace Ringtoets.Common.Data.Test.Probabilistics +{ + [TestFixture] + public class NormalDistributionDesignVariableTest + { + [Test] + public void ParameterdConstructor_ValidLognormalDistribution_ExpectedValues() + { + // Setup + var normalDistribution = new NormalDistribution(3); + + // Call + var designValue = new NormalDistributionDesignVariable(normalDistribution); + + // Assert + Assert.AreSame(normalDistribution, designValue.Distribution); + Assert.AreEqual(0.5, designValue.Percentile); + } + + /// + /// Tests the + /// against the values calculated with the excel sheet in WTI-33 (timestamp: 27-11-2015 10:27). + /// + /// MEAN. + /// VARIANCE. + /// Percentile. + /// Rekenwaarde. + [Test] + [TestCase(75, 70, 0.95, 88.76183279)] + [TestCase(75, 70, 0.5, 75)] + [TestCase(75, 70, 0.05, 61.23816721)] + [TestCase(75, 123.45, 0.95, 93.27564881)] + [TestCase(75, 1.2345, 0.95, 76.82756488)] + [TestCase(123.45, 70, 0.95, 137.2118328)] + [TestCase(1.2345, 70, 0.95, 14.99633279)] + public void GetDesignVariable_ValidNormalDistribution_ReturnExpectedValue( + double expectedValue, double variance, double percentile, + double expectedResult) + { + // Setup + var normalDistribution = new NormalDistribution(4) + { + Mean = (RoundedDouble) expectedValue, + StandardDeviation = (RoundedDouble) Math.Sqrt(variance) + }; + + var designVariable = new NormalDistributionDesignVariable(normalDistribution) + { + Percentile = percentile + }; + + // Call + double result = designVariable.GetDesignValue(); + + // Assert + Assert.AreEqual(expectedResult, result, 1e-4); + } + } +} \ No newline at end of file Index: Ringtoets/Common/test/Ringtoets.Common.Data.Test/Probabilistics/NormalDistributionTest.cs =================================================================== diff -u --- Ringtoets/Common/test/Ringtoets.Common.Data.Test/Probabilistics/NormalDistributionTest.cs (revision 0) +++ Ringtoets/Common/test/Ringtoets.Common.Data.Test/Probabilistics/NormalDistributionTest.cs (revision 1e4d77c17c6eac78bfd705efdff9e52b4fca2c7e) @@ -0,0 +1,102 @@ +// Copyright (C) Stichting Deltares 2016. All rights reserved. +// +// This file is part of Ringtoets. +// +// Ringtoets is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +using System; +using Core.Common.Base.Data; +using Core.Common.TestUtil; +using NUnit.Framework; +using Ringtoets.Common.Data.Probabilistics; + +namespace Ringtoets.Common.Data.Test.Probabilistics +{ + [TestFixture] + public class NomalDistributionTest + { + [Test] + [TestCase(0)] + [TestCase(2)] + [TestCase(15)] + public void DefaultConstructor_ExpectedValues(int numberOfDecimalPlaces) + { + // Call + var distribution = new NormalDistribution(numberOfDecimalPlaces); + + // Assert + Assert.IsInstanceOf(distribution); + Assert.AreEqual(0.0, distribution.Mean.Value); + Assert.AreEqual(numberOfDecimalPlaces, distribution.Mean.NumberOfDecimalPlaces); + Assert.AreEqual(1.0, distribution.StandardDeviation.Value); + Assert.AreEqual(numberOfDecimalPlaces, distribution.StandardDeviation.NumberOfDecimalPlaces); + } + + [Test] + [TestCase(0, 1.0)] + [TestCase(3, 1.235)] + [TestCase(4, 1.2345)] + [TestCase(15, 1.234500000000000)] + public void Mean_SetNewValue_GetValueRoundedToGivenNumberOfDecimalPlaces(int numberOfDecimalPlaces, double expectedStandardDeviation) + { + // Setup + var distribution = new NormalDistribution(numberOfDecimalPlaces); + + // Call + distribution.Mean = new RoundedDouble(4, 1.2345); + + // Assert + Assert.AreEqual(numberOfDecimalPlaces, distribution.Mean.NumberOfDecimalPlaces); + Assert.AreEqual(expectedStandardDeviation, distribution.Mean.Value); + } + + [Test] + [TestCase(0 - 1e-2)] + [TestCase(-4)] + public void StandardDeviation_SettingToLessThan0_ThrowArgumentOutOfRangeException(double newStd) + { + // Setup + var distribution = new NormalDistribution(2); + + // Call + TestDelegate call = () => distribution.StandardDeviation = (RoundedDouble) newStd; + + // Assert + const string expectedMessage = "Standaard afwijking (\u03C3) moet groter zijn dan of gelijk zijn aan 0."; + TestHelper.AssertThrowsArgumentExceptionAndTestMessage(call, expectedMessage); + } + + [Test] + [TestCase(0, 6.0)] + [TestCase(2, 5.68)] + [TestCase(3, 5.678)] + [TestCase(15, 5.678000000000000)] + public void StandardDeviation_SetNewValue_GetValueRoundedToGivenNumberOfDecimalPlaces(int numberOfDecimalPlaces, double expectedStandardDeviation) + { + // Setup + var distribution = new NormalDistribution(numberOfDecimalPlaces); + + // Call + distribution.StandardDeviation = new RoundedDouble(3, 5.678); + + // Assert + Assert.AreEqual(numberOfDecimalPlaces, distribution.StandardDeviation.NumberOfDecimalPlaces); + Assert.AreEqual(expectedStandardDeviation, distribution.StandardDeviation.Value); + } + } +} \ No newline at end of file Index: Ringtoets/Common/test/Ringtoets.Common.Data.Test/Probabilistics/ShiftedLognormalDistributionDesignVariableTest.cs =================================================================== diff -u --- Ringtoets/Common/test/Ringtoets.Common.Data.Test/Probabilistics/ShiftedLognormalDistributionDesignVariableTest.cs (revision 0) +++ Ringtoets/Common/test/Ringtoets.Common.Data.Test/Probabilistics/ShiftedLognormalDistributionDesignVariableTest.cs (revision 1e4d77c17c6eac78bfd705efdff9e52b4fca2c7e) @@ -0,0 +1,129 @@ +// Copyright (C) Stichting Deltares 2016. All rights reserved. +// +// This file is part of Ringtoets. +// +// Ringtoets is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +using System; +using Core.Common.Base.Data; +using NUnit.Framework; +using Ringtoets.Common.Data.Probabilistics; + +namespace Ringtoets.Common.Data.Test.Probabilistics +{ + [TestFixture] + public class ShiftedLognormalDistributionDesignVariableTest + { + [Test] + public void ParameterdConstructor_ValidLognormalDistribution_ExpectedValues() + { + // Setup + var shiftedLognormalDistribution = new ShiftedLognormalDistribution(1); + + // Call + var designValue = new ShiftedLognormalDistributionDesignVariable(shiftedLognormalDistribution); + + // Assert + Assert.AreSame(shiftedLognormalDistribution, designValue.Distribution); + Assert.AreEqual(0.5, designValue.Percentile); + } + + /// + /// Tests the + /// against the values calculated with the excel sheet in WTI-33 (timestamp: 27-11-2015 10:27). + /// + /// MEAN. + /// VARIANCE. + /// SHIFT + /// Percentile. + /// Rekenwaarde. + [Test] + [TestCase(75, 70, 10, 0.5, 84.5373)] + [TestCase(75, 70, 10, 0.95, 99.4965)] + [TestCase(75, 70, 10, 0.05, 72.0785)] + [TestCase(75, 70, -30, 0.95, 59.4965)] + [TestCase(75, 70, 123.45, 0.95, 212.9465)] + [TestCase(75, 123.45, 10, 0.95, 104.5284)] + [TestCase(75, 1.2345, 10, 0.95, 86.8381)] + [TestCase(123.45, 70, 10, 0.95, 147.6756)] + [TestCase(1.2345, 70, 10, 0.95, 14.54127084)] + public void GetDesignVariable_ValidShiftedLognormalDistribution_ReturnExpectedValue( + double expectedValue, double variance, double shift, double percentile, + double expectedResult) + { + // Setup + const int numberOfDecimalPlaces = 4; + var shiftedLognormalDistribution = new ShiftedLognormalDistribution(numberOfDecimalPlaces) + { + Mean = (RoundedDouble) expectedValue, + StandardDeviation = (RoundedDouble) Math.Sqrt(variance), + Shift = (RoundedDouble) shift + }; + + var designVariable = new ShiftedLognormalDistributionDesignVariable(shiftedLognormalDistribution) + { + Percentile = percentile + }; + + // Call + RoundedDouble result = designVariable.GetDesignValue(); + + // Assert + Assert.AreEqual(numberOfDecimalPlaces, result.NumberOfDecimalPlaces); + Assert.AreEqual(expectedResult, result, 1e-4); + } + + [Test] + [TestCase(75, 70, 0.5)] + [TestCase(75, 70, 0.95)] + [TestCase(75, 70, 0.05)] + [TestCase(75, 123.45, 0.95)] + [TestCase(75, 1.2345, 0.95)] + [TestCase(123.45, 70, 0.95)] + [TestCase(1.2345, 70, 0.95)] + public void GetDesignVariable_ShiftIsZero_ReturnIdenticalValueAsLognormalDistributionDesignVariable( + double expectedValue, double variance, double percentile) + { + // Setup + const int numberOfDecimalPlaces = 6; + var shiftedLognormalDistribution = new ShiftedLognormalDistribution(numberOfDecimalPlaces) + { + Mean = (RoundedDouble) expectedValue, + StandardDeviation = (RoundedDouble) Math.Sqrt(variance), + Shift = (RoundedDouble) 0.0 + }; + + var designVariable = new ShiftedLognormalDistributionDesignVariable(shiftedLognormalDistribution) + { + Percentile = percentile + }; + + // Call + RoundedDouble result = designVariable.GetDesignValue(); + + // Assert + RoundedDouble expectedResult = new LognormalDistributionDesignVariable(shiftedLognormalDistribution) + { + Percentile = percentile + }.GetDesignValue(); + + Assert.AreEqual(numberOfDecimalPlaces, result.NumberOfDecimalPlaces); + Assert.AreEqual(expectedResult, result, 1e-6); + } + } +} \ No newline at end of file Index: Ringtoets/Common/test/Ringtoets.Common.Data.Test/Probabilistics/ShiftedLognormalDistributionTest.cs =================================================================== diff -u --- Ringtoets/Common/test/Ringtoets.Common.Data.Test/Probabilistics/ShiftedLognormalDistributionTest.cs (revision 0) +++ Ringtoets/Common/test/Ringtoets.Common.Data.Test/Probabilistics/ShiftedLognormalDistributionTest.cs (revision 1e4d77c17c6eac78bfd705efdff9e52b4fca2c7e) @@ -0,0 +1,65 @@ +// Copyright (C) Stichting Deltares 2016. All rights reserved. +// +// This file is part of Ringtoets. +// +// Ringtoets is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +using Core.Common.Base.Data; +using NUnit.Framework; +using Ringtoets.Common.Data.Probabilistics; + +namespace Ringtoets.Common.Data.Test.Probabilistics +{ + [TestFixture] + public class ShiftedLognormalDistributionTest + { + [Test] + [TestCase(1)] + [TestCase(4)] + [TestCase(15)] + public void DefaultConstructor_ExpectedValues(int numberOfDecimalPlaces) + { + // Call + var distribution = new ShiftedLognormalDistribution(numberOfDecimalPlaces); + + // Assert + Assert.IsInstanceOf(distribution); + Assert.IsInstanceOf(distribution.Shift); + Assert.AreEqual(numberOfDecimalPlaces, distribution.Shift.NumberOfDecimalPlaces); + Assert.AreEqual(0.0, distribution.Shift.Value); + } + + [Test] + [TestCase(1, 5.6)] + [TestCase(3, 5.647)] + [TestCase(4, 5.6473)] + [TestCase(15, 5.647300000000000)] + public void Mean_SetNewValue_GetValueRoundedToGivenNumberOfDecimalPlaces(int numberOfDecimalPlaces, double expectedStandardDeviation) + { + // Setup + var distribution = new ShiftedLognormalDistribution(numberOfDecimalPlaces); + + // Call + distribution.Shift = new RoundedDouble(4, 5.6473); + + // Assert + Assert.AreEqual(numberOfDecimalPlaces, distribution.Shift.NumberOfDecimalPlaces); + Assert.AreEqual(expectedStandardDeviation, distribution.Shift.Value); + } + } +} \ No newline at end of file Index: Ringtoets/Common/test/Ringtoets.Common.Data.Test/Properties/AssemblyInfo.cs =================================================================== diff -u -r0bfd1f4e2a179c8575045e5af70dce2930665626 -r1e4d77c17c6eac78bfd705efdff9e52b4fca2c7e --- Ringtoets/Common/test/Ringtoets.Common.Data.Test/Properties/AssemblyInfo.cs (.../AssemblyInfo.cs) (revision 0bfd1f4e2a179c8575045e5af70dce2930665626) +++ Ringtoets/Common/test/Ringtoets.Common.Data.Test/Properties/AssemblyInfo.cs (.../AssemblyInfo.cs) (revision 1e4d77c17c6eac78bfd705efdff9e52b4fca2c7e) @@ -1,4 +1,25 @@ -using System.Reflection; +// Copyright (C) Stichting Deltares 2016. All rights reserved. +// +// This file is part of Ringtoets. +// +// Ringtoets is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. +// +// This program is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. +// +// You should have received a copy of the GNU General Public License +// along with this program. If not, see . +// +// All names, logos, and references to "Deltares" are registered trademarks of +// Stichting Deltares and remain full property of Stichting Deltares at all times. +// All rights reserved. + +using System.Reflection; using System.Runtime.InteropServices; // General Information about an assembly is controlled through the following Index: Ringtoets/Common/test/Ringtoets.Common.Data.Test/Ringtoets.Common.Data.Test.csproj =================================================================== diff -u -rf1bd17ba95b3fbae5928d4240523d50d8b83b64d -r1e4d77c17c6eac78bfd705efdff9e52b4fca2c7e --- Ringtoets/Common/test/Ringtoets.Common.Data.Test/Ringtoets.Common.Data.Test.csproj (.../Ringtoets.Common.Data.Test.csproj) (revision f1bd17ba95b3fbae5928d4240523d50d8b83b64d) +++ Ringtoets/Common/test/Ringtoets.Common.Data.Test/Ringtoets.Common.Data.Test.csproj (.../Ringtoets.Common.Data.Test.csproj) (revision 1e4d77c17c6eac78bfd705efdff9e52b4fca2c7e) @@ -40,6 +40,10 @@ MinimumRecommendedRules.ruleset + + ..\..\..\..\packages\MathNet.Numerics.3.8.0\lib\net40\MathNet.Numerics.dll + True + ..\..\..\..\packages\NUnit.2.6.4\lib\nunit.framework.dll True @@ -50,6 +54,7 @@ + @@ -59,6 +64,13 @@ + + + + + + + Index: Ringtoets/Common/test/Ringtoets.Common.Data.Test/packages.config =================================================================== diff -u -r75aa4fefacf584d5172dc3bdffd348b0aacb05a4 -r1e4d77c17c6eac78bfd705efdff9e52b4fca2c7e --- Ringtoets/Common/test/Ringtoets.Common.Data.Test/packages.config (.../packages.config) (revision 75aa4fefacf584d5172dc3bdffd348b0aacb05a4) +++ Ringtoets/Common/test/Ringtoets.Common.Data.Test/packages.config (.../packages.config) (revision 1e4d77c17c6eac78bfd705efdff9e52b4fca2c7e) @@ -1,5 +1,29 @@  + + + \ No newline at end of file Index: Ringtoets/Piping/src/Ringtoets.Piping.Data/DerivedPipingInput.cs =================================================================== diff -u -r2ed0db8299205024c1c6b1eb10da05f588f5d649 -r1e4d77c17c6eac78bfd705efdff9e52b4fca2c7e --- Ringtoets/Piping/src/Ringtoets.Piping.Data/DerivedPipingInput.cs (.../DerivedPipingInput.cs) (revision 2ed0db8299205024c1c6b1eb10da05f588f5d649) +++ Ringtoets/Piping/src/Ringtoets.Piping.Data/DerivedPipingInput.cs (.../DerivedPipingInput.cs) (revision 1e4d77c17c6eac78bfd705efdff9e52b4fca2c7e) @@ -21,8 +21,8 @@ using System; using Core.Common.Base.Data; +using Ringtoets.Common.Data.Probabilistics; using Ringtoets.HydraRing.Data; -using Ringtoets.Piping.Data.Probabilistics; using Ringtoets.Piping.InputParameterCalculation; using Ringtoets.Piping.Primitives; Index: Ringtoets/Piping/src/Ringtoets.Piping.Data/PipingInput.cs =================================================================== diff -u -r614c1aa4bf54ed2852d93a58ba8d49b549d5f46c -r1e4d77c17c6eac78bfd705efdff9e52b4fca2c7e --- Ringtoets/Piping/src/Ringtoets.Piping.Data/PipingInput.cs (.../PipingInput.cs) (revision 614c1aa4bf54ed2852d93a58ba8d49b549d5f46c) +++ Ringtoets/Piping/src/Ringtoets.Piping.Data/PipingInput.cs (.../PipingInput.cs) (revision 1e4d77c17c6eac78bfd705efdff9e52b4fca2c7e) @@ -24,8 +24,8 @@ using Core.Common.Base; using Core.Common.Base.Data; using Core.Common.Base.Geometry; +using Ringtoets.Common.Data.Probabilistics; using Ringtoets.HydraRing.Data; -using Ringtoets.Piping.Data.Probabilistics; using Ringtoets.Piping.Data.Properties; using Ringtoets.Piping.Primitives; Index: Ringtoets/Piping/src/Ringtoets.Piping.Data/PipingSemiProbabilisticDesignValueFactory.cs =================================================================== diff -u -rbd3d9017ec57de410afdb274e44cd933d670ce86 -r1e4d77c17c6eac78bfd705efdff9e52b4fca2c7e --- Ringtoets/Piping/src/Ringtoets.Piping.Data/PipingSemiProbabilisticDesignValueFactory.cs (.../PipingSemiProbabilisticDesignValueFactory.cs) (revision bd3d9017ec57de410afdb274e44cd933d670ce86) +++ Ringtoets/Piping/src/Ringtoets.Piping.Data/PipingSemiProbabilisticDesignValueFactory.cs (.../PipingSemiProbabilisticDesignValueFactory.cs) (revision 1e4d77c17c6eac78bfd705efdff9e52b4fca2c7e) @@ -19,7 +19,7 @@ // Stichting Deltares and remain full property of Stichting Deltares at all times. // All rights reserved. -using Ringtoets.Piping.Data.Probabilistics; +using Ringtoets.Common.Data.Probabilistics; namespace Ringtoets.Piping.Data { @@ -28,6 +28,30 @@ /// public static class PipingSemiProbabilisticDesignValueFactory { + private static DesignVariable CreateDesignVariable(NormalDistribution distribution, double percentile) + { + return new NormalDistributionDesignVariable(distribution) + { + Percentile = percentile + }; + } + + private static DesignVariable CreateDesignVariable(LognormalDistribution distribution, double percentile) + { + return new LognormalDistributionDesignVariable(distribution) + { + Percentile = percentile + }; + } + + private static DesignVariable CreateDesignVariable(ShiftedLognormalDistribution distribution, double percentile) + { + return new ShiftedLognormalDistributionDesignVariable(distribution) + { + Percentile = percentile + }; + } + #region General parameters /// @@ -99,29 +123,5 @@ } #endregion - - private static DesignVariable CreateDesignVariable(NormalDistribution distribution, double percentile) - { - return new NormalDistributionDesignVariable(distribution) - { - Percentile = percentile - }; - } - - private static DesignVariable CreateDesignVariable(LognormalDistribution distribution, double percentile) - { - return new LognormalDistributionDesignVariable(distribution) - { - Percentile = percentile - }; - } - - private static DesignVariable CreateDesignVariable(ShiftedLognormalDistribution distribution, double percentile) - { - return new ShiftedLognormalDistributionDesignVariable(distribution) - { - Percentile = percentile - }; - } } } \ No newline at end of file Fisheye: Tag 1e4d77c17c6eac78bfd705efdff9e52b4fca2c7e refers to a dead (removed) revision in file `Ringtoets/Piping/src/Ringtoets.Piping.Data/Probabilistics/DesignVariable.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1e4d77c17c6eac78bfd705efdff9e52b4fca2c7e refers to a dead (removed) revision in file `Ringtoets/Piping/src/Ringtoets.Piping.Data/Probabilistics/IDistribution.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1e4d77c17c6eac78bfd705efdff9e52b4fca2c7e refers to a dead (removed) revision in file `Ringtoets/Piping/src/Ringtoets.Piping.Data/Probabilistics/LognormalDistribution.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1e4d77c17c6eac78bfd705efdff9e52b4fca2c7e refers to a dead (removed) revision in file `Ringtoets/Piping/src/Ringtoets.Piping.Data/Probabilistics/LognormalDistributionDesignVariable.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1e4d77c17c6eac78bfd705efdff9e52b4fca2c7e refers to a dead (removed) revision in file `Ringtoets/Piping/src/Ringtoets.Piping.Data/Probabilistics/NormalDistribution.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1e4d77c17c6eac78bfd705efdff9e52b4fca2c7e refers to a dead (removed) revision in file `Ringtoets/Piping/src/Ringtoets.Piping.Data/Probabilistics/NormalDistributionDesignVariable.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1e4d77c17c6eac78bfd705efdff9e52b4fca2c7e refers to a dead (removed) revision in file `Ringtoets/Piping/src/Ringtoets.Piping.Data/Probabilistics/ShiftedLognormalDistribution.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1e4d77c17c6eac78bfd705efdff9e52b4fca2c7e refers to a dead (removed) revision in file `Ringtoets/Piping/src/Ringtoets.Piping.Data/Probabilistics/ShiftedLognormalDistributionDesignVariable.cs'. Fisheye: No comparison available. Pass `N' to diff? Index: Ringtoets/Piping/src/Ringtoets.Piping.Data/Properties/Resources.Designer.cs =================================================================== diff -u -r3ab528e2b002824d82df7b45c2901c4f96fa148c -r1e4d77c17c6eac78bfd705efdff9e52b4fca2c7e --- Ringtoets/Piping/src/Ringtoets.Piping.Data/Properties/Resources.Designer.cs (.../Resources.Designer.cs) (revision 3ab528e2b002824d82df7b45c2901c4f96fa148c) +++ Ringtoets/Piping/src/Ringtoets.Piping.Data/Properties/Resources.Designer.cs (.../Resources.Designer.cs) (revision 1e4d77c17c6eac78bfd705efdff9e52b4fca2c7e) @@ -1,7 +1,7 @@ //------------------------------------------------------------------------------ // // This code was generated by a tool. -// Runtime Version:4.0.30319.17929 +// Runtime Version:4.0.30319.42000 // // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. @@ -133,24 +133,6 @@ } /// - /// Looks up a localized string similar to Een kansverdeling moet opgegeven zijn om op basis van die data een rekenwaarde te bepalen.. - /// - public static string DesignVariable_GetDesignValue_Distribution_must_be_set { - get { - return ResourceManager.GetString("DesignVariable_GetDesignValue_Distribution_must_be_set", resourceCulture); - } - } - - /// - /// Looks up a localized string similar to Percentiel moet in het bereik van [0, 1] vallen.. - /// - public static string DesignVariable_Percentile_must_be_in_range { - get { - return ResourceManager.GetString("DesignVariable_Percentile_must_be_in_range", resourceCulture); - } - } - - /// /// Looks up a localized string similar to Kans moet in het bereik van [0, 1] opgegeven worden.. /// public static string IDistribution_InverseCDF_Probability_must_be_in_range { @@ -160,15 +142,6 @@ } /// - /// Looks up a localized string similar to Gemiddelde moet groter zijn dan 0.. - /// - public static string LognormalDistribution_Mean_must_be_greater_equal_to_zero { - get { - return ResourceManager.GetString("LognormalDistribution_Mean_must_be_greater_equal_to_zero", resourceCulture); - } - } - - /// /// Looks up a localized string similar to Nieuwe berekening. /// public static string PipingCalculation_DefaultName { @@ -304,14 +277,5 @@ return ResourceManager.GetString("RingtoetsPipingSurfaceLine_SurfaceLine_has_no_Geometry", resourceCulture); } } - - /// - /// Looks up a localized string similar to Standaard afwijking (σ) moet groter zijn dan of gelijk zijn aan 0.. - /// - public static string StandardDeviation_Should_be_greater_than_or_equal_to_zero { - get { - return ResourceManager.GetString("StandardDeviation_Should_be_greater_than_or_equal_to_zero", resourceCulture); - } - } } } Index: Ringtoets/Piping/src/Ringtoets.Piping.Data/Properties/Resources.resx =================================================================== diff -u -r3ab528e2b002824d82df7b45c2901c4f96fa148c -r1e4d77c17c6eac78bfd705efdff9e52b4fca2c7e --- Ringtoets/Piping/src/Ringtoets.Piping.Data/Properties/Resources.resx (.../Resources.resx) (revision 3ab528e2b002824d82df7b45c2901c4f96fa148c) +++ Ringtoets/Piping/src/Ringtoets.Piping.Data/Properties/Resources.resx (.../Resources.resx) (revision 1e4d77c17c6eac78bfd705efdff9e52b4fca2c7e) @@ -117,21 +117,9 @@ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - Standaard afwijking (σ) moet groter zijn dan of gelijk zijn aan 0. - - - Percentiel moet in het bereik van [0, 1] vallen. - - - Een kansverdeling moet opgegeven zijn om op basis van die data een rekenwaarde te bepalen. - Kans moet in het bereik van [0, 1] opgegeven worden. - - Gemiddelde moet groter zijn dan 0. - Kan geen hoogte bepalen op het punt L={0}, omdat de profielschematisatie verticaal loopt op dat punt. Index: Ringtoets/Piping/src/Ringtoets.Piping.Data/Ringtoets.Piping.Data.csproj =================================================================== diff -u -r1279dcba187f56c0ba96dfdb962067304e333475 -r1e4d77c17c6eac78bfd705efdff9e52b4fca2c7e --- Ringtoets/Piping/src/Ringtoets.Piping.Data/Ringtoets.Piping.Data.csproj (.../Ringtoets.Piping.Data.csproj) (revision 1279dcba187f56c0ba96dfdb962067304e333475) +++ Ringtoets/Piping/src/Ringtoets.Piping.Data/Ringtoets.Piping.Data.csproj (.../Ringtoets.Piping.Data.csproj) (revision 1e4d77c17c6eac78bfd705efdff9e52b4fca2c7e) @@ -42,10 +42,6 @@ ..\..\..\..\packages\log4net.2.0.4\lib\net40-full\log4net.dll - - ..\..\..\..\packages\MathNet.Numerics.3.8.0\lib\net40\MathNet.Numerics.dll - True - @@ -66,14 +62,6 @@ - - - - - - - - True Index: Ringtoets/Piping/src/Ringtoets.Piping.Data/packages.config =================================================================== diff -u -r10779bb6a6db2d00f4627b2bc190e7e35e1fee3e -r1e4d77c17c6eac78bfd705efdff9e52b4fca2c7e --- Ringtoets/Piping/src/Ringtoets.Piping.Data/packages.config (.../packages.config) (revision 10779bb6a6db2d00f4627b2bc190e7e35e1fee3e) +++ Ringtoets/Piping/src/Ringtoets.Piping.Data/packages.config (.../packages.config) (revision 1e4d77c17c6eac78bfd705efdff9e52b4fca2c7e) @@ -24,5 +24,4 @@ --> - \ No newline at end of file Index: Ringtoets/Piping/src/Ringtoets.Piping.Forms/PropertyClasses/PipingInputContextProperties.cs =================================================================== diff -u -r52fb2dd367bdca54564201857ed6e0b3cc244693 -r1e4d77c17c6eac78bfd705efdff9e52b4fca2c7e --- Ringtoets/Piping/src/Ringtoets.Piping.Forms/PropertyClasses/PipingInputContextProperties.cs (.../PipingInputContextProperties.cs) (revision 52fb2dd367bdca54564201857ed6e0b3cc244693) +++ Ringtoets/Piping/src/Ringtoets.Piping.Forms/PropertyClasses/PipingInputContextProperties.cs (.../PipingInputContextProperties.cs) (revision 1e4d77c17c6eac78bfd705efdff9e52b4fca2c7e) @@ -25,9 +25,9 @@ using Core.Common.Base.Data; using Core.Common.Gui.PropertyBag; using Core.Common.Utils.Attributes; +using Ringtoets.Common.Data.Probabilistics; using Ringtoets.HydraRing.Data; using Ringtoets.Piping.Data; -using Ringtoets.Piping.Data.Probabilistics; using Ringtoets.Piping.Forms.PresentationObjects; using Ringtoets.Piping.Forms.Properties; using Ringtoets.Piping.Forms.TypeConverters; @@ -176,7 +176,7 @@ data.WrappedData.SurfaceLine = value; PipingInputService.SetMatchingStochasticSoilModel(data.WrappedData, GetAvailableStochasticSoilModels()); - PipingCalculationScenarioService.SyncCalculationScenarioWithNewSurfaceLine((PipingCalculationScenario)data.PipingCalculationItem, new PipingFailureMechanism(), oldSurfaceLine); + PipingCalculationScenarioService.SyncCalculationScenarioWithNewSurfaceLine((PipingCalculationScenario) data.PipingCalculationItem, new PipingFailureMechanism(), oldSurfaceLine); data.WrappedData.NotifyObservers(); } } Index: Ringtoets/Piping/src/Ringtoets.Piping.Forms/TypeConverters/DesignVariableTypeConverter.cs =================================================================== diff -u -r9a4c2aa9a079d1d9389b488a90cffaa9db043570 -r1e4d77c17c6eac78bfd705efdff9e52b4fca2c7e --- Ringtoets/Piping/src/Ringtoets.Piping.Forms/TypeConverters/DesignVariableTypeConverter.cs (.../DesignVariableTypeConverter.cs) (revision 9a4c2aa9a079d1d9389b488a90cffaa9db043570) +++ Ringtoets/Piping/src/Ringtoets.Piping.Forms/TypeConverters/DesignVariableTypeConverter.cs (.../DesignVariableTypeConverter.cs) (revision 1e4d77c17c6eac78bfd705efdff9e52b4fca2c7e) @@ -26,7 +26,7 @@ using System.Linq.Expressions; using Core.Common.Base.Data; using Core.Common.Gui.PropertyBag; -using Ringtoets.Piping.Data.Probabilistics; +using Ringtoets.Common.Data.Probabilistics; using Ringtoets.Piping.Forms.TypeConverters.PropertyDescriptors; using PipingFormsResources = Ringtoets.Piping.Forms.Properties.Resources; @@ -69,10 +69,10 @@ for (int i = 0; i < Parameters.Length; i++) { var propertyDescriptor = CreatePropertyDescriptor(propertyDescriptorCollection, Parameters[i]); - propertyDescriptor = allParametersAreReadonly ? - new ReadOnlyPropertyDescriptorDecorator(propertyDescriptor) : - CreateContainingPropertyUpdateDescriptor(propertyDescriptor, context); - + propertyDescriptor = allParametersAreReadonly ? + new ReadOnlyPropertyDescriptorDecorator(propertyDescriptor) : + CreateContainingPropertyUpdateDescriptor(propertyDescriptor, context); + properties[i + 1] = propertyDescriptor; } properties[Parameters.Length + 1] = new SimpleReadonlyPropertyDescriptorItem(PipingFormsResources.DesignVariableTypeConverter_DesignValue_DisplayName, Index: Ringtoets/Piping/src/Ringtoets.Piping.Forms/TypeConverters/LognormalDistributionDesignVariableTypeConverter.cs =================================================================== diff -u -r4512af7782ee31b36941bb280b54d9da2953dd71 -r1e4d77c17c6eac78bfd705efdff9e52b4fca2c7e --- Ringtoets/Piping/src/Ringtoets.Piping.Forms/TypeConverters/LognormalDistributionDesignVariableTypeConverter.cs (.../LognormalDistributionDesignVariableTypeConverter.cs) (revision 4512af7782ee31b36941bb280b54d9da2953dd71) +++ Ringtoets/Piping/src/Ringtoets.Piping.Forms/TypeConverters/LognormalDistributionDesignVariableTypeConverter.cs (.../LognormalDistributionDesignVariableTypeConverter.cs) (revision 1e4d77c17c6eac78bfd705efdff9e52b4fca2c7e) @@ -21,8 +21,7 @@ using System; using System.ComponentModel; - -using Ringtoets.Piping.Data.Probabilistics; +using Ringtoets.Common.Data.Probabilistics; using Ringtoets.Piping.Forms.Properties; using Ringtoets.Piping.Forms.PropertyClasses; Index: Ringtoets/Piping/src/Ringtoets.Piping.Forms/TypeConverters/NormalDistributionDesignVariableTypeConverter.cs =================================================================== diff -u -r4512af7782ee31b36941bb280b54d9da2953dd71 -r1e4d77c17c6eac78bfd705efdff9e52b4fca2c7e --- Ringtoets/Piping/src/Ringtoets.Piping.Forms/TypeConverters/NormalDistributionDesignVariableTypeConverter.cs (.../NormalDistributionDesignVariableTypeConverter.cs) (revision 4512af7782ee31b36941bb280b54d9da2953dd71) +++ Ringtoets/Piping/src/Ringtoets.Piping.Forms/TypeConverters/NormalDistributionDesignVariableTypeConverter.cs (.../NormalDistributionDesignVariableTypeConverter.cs) (revision 1e4d77c17c6eac78bfd705efdff9e52b4fca2c7e) @@ -21,8 +21,7 @@ using System; using System.ComponentModel; - -using Ringtoets.Piping.Data.Probabilistics; +using Ringtoets.Common.Data.Probabilistics; using Ringtoets.Piping.Forms.Properties; using Ringtoets.Piping.Forms.PropertyClasses; Index: Ringtoets/Piping/src/Ringtoets.Piping.Forms/TypeConverters/ShiftedLognormalDistributionDesignVariableTypeConverter.cs =================================================================== diff -u -r4512af7782ee31b36941bb280b54d9da2953dd71 -r1e4d77c17c6eac78bfd705efdff9e52b4fca2c7e --- Ringtoets/Piping/src/Ringtoets.Piping.Forms/TypeConverters/ShiftedLognormalDistributionDesignVariableTypeConverter.cs (.../ShiftedLognormalDistributionDesignVariableTypeConverter.cs) (revision 4512af7782ee31b36941bb280b54d9da2953dd71) +++ Ringtoets/Piping/src/Ringtoets.Piping.Forms/TypeConverters/ShiftedLognormalDistributionDesignVariableTypeConverter.cs (.../ShiftedLognormalDistributionDesignVariableTypeConverter.cs) (revision 1e4d77c17c6eac78bfd705efdff9e52b4fca2c7e) @@ -21,8 +21,7 @@ using System; using System.ComponentModel; - -using Ringtoets.Piping.Data.Probabilistics; +using Ringtoets.Common.Data.Probabilistics; using Ringtoets.Piping.Forms.Properties; using Ringtoets.Piping.Forms.PropertyClasses; Index: Ringtoets/Piping/test/Ringtoets.Piping.Data.Test/DerivedPipingInputTest.cs =================================================================== diff -u -r2ed0db8299205024c1c6b1eb10da05f588f5d649 -r1e4d77c17c6eac78bfd705efdff9e52b4fca2c7e --- Ringtoets/Piping/test/Ringtoets.Piping.Data.Test/DerivedPipingInputTest.cs (.../DerivedPipingInputTest.cs) (revision 2ed0db8299205024c1c6b1eb10da05f588f5d649) +++ Ringtoets/Piping/test/Ringtoets.Piping.Data.Test/DerivedPipingInputTest.cs (.../DerivedPipingInputTest.cs) (revision 1e4d77c17c6eac78bfd705efdff9e52b4fca2c7e) @@ -23,8 +23,8 @@ using Core.Common.Base.Data; using Core.Common.TestUtil; using NUnit.Framework; +using Ringtoets.Common.Data.Probabilistics; using Ringtoets.HydraRing.Data; -using Ringtoets.Piping.Data.Probabilistics; using Ringtoets.Piping.Data.TestUtil; using Ringtoets.Piping.KernelWrapper.SubCalculator; using Ringtoets.Piping.KernelWrapper.TestUtil; Index: Ringtoets/Piping/test/Ringtoets.Piping.Data.Test/PipingInputTest.cs =================================================================== diff -u -rc61ef8d3ee0558d0a032085a3f1b3cc4c0503b64 -r1e4d77c17c6eac78bfd705efdff9e52b4fca2c7e --- Ringtoets/Piping/test/Ringtoets.Piping.Data.Test/PipingInputTest.cs (.../PipingInputTest.cs) (revision c61ef8d3ee0558d0a032085a3f1b3cc4c0503b64) +++ Ringtoets/Piping/test/Ringtoets.Piping.Data.Test/PipingInputTest.cs (.../PipingInputTest.cs) (revision 1e4d77c17c6eac78bfd705efdff9e52b4fca2c7e) @@ -25,8 +25,8 @@ using Core.Common.Base.Geometry; using Core.Common.TestUtil; using NUnit.Framework; +using Ringtoets.Common.Data.Probabilistics; using Ringtoets.HydraRing.Data; -using Ringtoets.Piping.Data.Probabilistics; using Ringtoets.Piping.Data.Properties; using Ringtoets.Piping.Data.TestUtil; using Ringtoets.Piping.KernelWrapper.SubCalculator; Fisheye: Tag 1e4d77c17c6eac78bfd705efdff9e52b4fca2c7e refers to a dead (removed) revision in file `Ringtoets/Piping/test/Ringtoets.Piping.Data.Test/Probabilistics/DesignVariableTest.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1e4d77c17c6eac78bfd705efdff9e52b4fca2c7e refers to a dead (removed) revision in file `Ringtoets/Piping/test/Ringtoets.Piping.Data.Test/Probabilistics/LognormalDistributionDesignVariableTest.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1e4d77c17c6eac78bfd705efdff9e52b4fca2c7e refers to a dead (removed) revision in file `Ringtoets/Piping/test/Ringtoets.Piping.Data.Test/Probabilistics/LognormalDistributionTest.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1e4d77c17c6eac78bfd705efdff9e52b4fca2c7e refers to a dead (removed) revision in file `Ringtoets/Piping/test/Ringtoets.Piping.Data.Test/Probabilistics/NormalDistributionDesignVariableTest.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1e4d77c17c6eac78bfd705efdff9e52b4fca2c7e refers to a dead (removed) revision in file `Ringtoets/Piping/test/Ringtoets.Piping.Data.Test/Probabilistics/NormalDistributionTest.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1e4d77c17c6eac78bfd705efdff9e52b4fca2c7e refers to a dead (removed) revision in file `Ringtoets/Piping/test/Ringtoets.Piping.Data.Test/Probabilistics/ShiftedLognormalDistributionDesignVariableTest.cs'. Fisheye: No comparison available. Pass `N' to diff? Fisheye: Tag 1e4d77c17c6eac78bfd705efdff9e52b4fca2c7e refers to a dead (removed) revision in file `Ringtoets/Piping/test/Ringtoets.Piping.Data.Test/Probabilistics/ShiftedLognormalDistributionTest.cs'. Fisheye: No comparison available. Pass `N' to diff? Index: Ringtoets/Piping/test/Ringtoets.Piping.Data.Test/Ringtoets.Piping.Data.Test.csproj =================================================================== diff -u -r1279dcba187f56c0ba96dfdb962067304e333475 -r1e4d77c17c6eac78bfd705efdff9e52b4fca2c7e --- Ringtoets/Piping/test/Ringtoets.Piping.Data.Test/Ringtoets.Piping.Data.Test.csproj (.../Ringtoets.Piping.Data.Test.csproj) (revision 1279dcba187f56c0ba96dfdb962067304e333475) +++ Ringtoets/Piping/test/Ringtoets.Piping.Data.Test/Ringtoets.Piping.Data.Test.csproj (.../Ringtoets.Piping.Data.Test.csproj) (revision 1e4d77c17c6eac78bfd705efdff9e52b4fca2c7e) @@ -68,13 +68,6 @@ - - - - - - - Index: Ringtoets/Piping/test/Ringtoets.Piping.Data.Test/packages.config =================================================================== diff -u -rc7c07db38829afdc5965c331844e1d39123944ff -r1e4d77c17c6eac78bfd705efdff9e52b4fca2c7e --- Ringtoets/Piping/test/Ringtoets.Piping.Data.Test/packages.config (.../packages.config) (revision c7c07db38829afdc5965c331844e1d39123944ff) +++ Ringtoets/Piping/test/Ringtoets.Piping.Data.Test/packages.config (.../packages.config) (revision 1e4d77c17c6eac78bfd705efdff9e52b4fca2c7e) @@ -23,7 +23,6 @@ All rights reserved. --> - \ No newline at end of file Index: Ringtoets/Piping/test/Ringtoets.Piping.Data.TestUtil/LimitedPrecisionHelper.cs =================================================================== diff -u -r3721b5bb1ae327907884a90d1a9bd300042e0540 -r1e4d77c17c6eac78bfd705efdff9e52b4fca2c7e --- Ringtoets/Piping/test/Ringtoets.Piping.Data.TestUtil/LimitedPrecisionHelper.cs (.../LimitedPrecisionHelper.cs) (revision 3721b5bb1ae327907884a90d1a9bd300042e0540) +++ Ringtoets/Piping/test/Ringtoets.Piping.Data.TestUtil/LimitedPrecisionHelper.cs (.../LimitedPrecisionHelper.cs) (revision 1e4d77c17c6eac78bfd705efdff9e52b4fca2c7e) @@ -1,9 +1,8 @@ using System; using Core.Common.Base.Data; +using Ringtoets.Common.Data.Probabilistics; -using Ringtoets.Piping.Data.Probabilistics; - namespace Ringtoets.Piping.Data.TestUtil { /// Index: Ringtoets/Piping/test/Ringtoets.Piping.Forms.Test/PropertyClasses/PipingInputContextPropertiesTest.cs =================================================================== diff -u -r0b081b2391e73b7e3ff04ef31fafd2df1b1571e3 -r1e4d77c17c6eac78bfd705efdff9e52b4fca2c7e --- Ringtoets/Piping/test/Ringtoets.Piping.Forms.Test/PropertyClasses/PipingInputContextPropertiesTest.cs (.../PipingInputContextPropertiesTest.cs) (revision 0b081b2391e73b7e3ff04ef31fafd2df1b1571e3) +++ Ringtoets/Piping/test/Ringtoets.Piping.Forms.Test/PropertyClasses/PipingInputContextPropertiesTest.cs (.../PipingInputContextPropertiesTest.cs) (revision 1e4d77c17c6eac78bfd705efdff9e52b4fca2c7e) @@ -29,9 +29,9 @@ using NUnit.Framework; using Rhino.Mocks; using Ringtoets.Common.Data.AssessmentSection; +using Ringtoets.Common.Data.Probabilistics; using Ringtoets.HydraRing.Data; using Ringtoets.Piping.Data; -using Ringtoets.Piping.Data.Probabilistics; using Ringtoets.Piping.Data.TestUtil; using Ringtoets.Piping.Forms.PresentationObjects; using Ringtoets.Piping.Forms.PropertyClasses; @@ -203,7 +203,7 @@ StochasticSoilModel stochasticSoilModel2 = ValidStochasticSoilModel(0.0, 4.0); var stochasticSoilProfile2 = stochasticSoilModel2.StochasticSoilProfiles.First(); - stochasticSoilModel2.StochasticSoilProfiles.Add(new StochasticSoilProfile(0.0,SoilProfileType.SoilProfile1D, 1234)); + stochasticSoilModel2.StochasticSoilProfiles.Add(new StochasticSoilProfile(0.0, SoilProfileType.SoilProfile1D, 1234)); // Call new PipingInputContextProperties Index: Ringtoets/Piping/test/Ringtoets.Piping.Forms.Test/TypeConverters/LognormalDistributionDesignVariableTypeConverterTest.cs =================================================================== diff -u -r52fb2dd367bdca54564201857ed6e0b3cc244693 -r1e4d77c17c6eac78bfd705efdff9e52b4fca2c7e --- Ringtoets/Piping/test/Ringtoets.Piping.Forms.Test/TypeConverters/LognormalDistributionDesignVariableTypeConverterTest.cs (.../LognormalDistributionDesignVariableTypeConverterTest.cs) (revision 52fb2dd367bdca54564201857ed6e0b3cc244693) +++ Ringtoets/Piping/test/Ringtoets.Piping.Forms.Test/TypeConverters/LognormalDistributionDesignVariableTypeConverterTest.cs (.../LognormalDistributionDesignVariableTypeConverterTest.cs) (revision 1e4d77c17c6eac78bfd705efdff9e52b4fca2c7e) @@ -10,8 +10,8 @@ using Rhino.Mocks; using Ringtoets.Common.Data; using Ringtoets.Common.Data.AssessmentSection; +using Ringtoets.Common.Data.Probabilistics; using Ringtoets.Piping.Data; -using Ringtoets.Piping.Data.Probabilistics; using Ringtoets.Piping.Forms.PresentationObjects; using Ringtoets.Piping.Forms.PropertyClasses; using Ringtoets.Piping.Forms.TypeConverters; Index: Ringtoets/Piping/test/Ringtoets.Piping.Forms.Test/TypeConverters/NormalDistributionDesignVariableTypeConverterTest.cs =================================================================== diff -u -r52fb2dd367bdca54564201857ed6e0b3cc244693 -r1e4d77c17c6eac78bfd705efdff9e52b4fca2c7e --- Ringtoets/Piping/test/Ringtoets.Piping.Forms.Test/TypeConverters/NormalDistributionDesignVariableTypeConverterTest.cs (.../NormalDistributionDesignVariableTypeConverterTest.cs) (revision 52fb2dd367bdca54564201857ed6e0b3cc244693) +++ Ringtoets/Piping/test/Ringtoets.Piping.Forms.Test/TypeConverters/NormalDistributionDesignVariableTypeConverterTest.cs (.../NormalDistributionDesignVariableTypeConverterTest.cs) (revision 1e4d77c17c6eac78bfd705efdff9e52b4fca2c7e) @@ -10,8 +10,8 @@ using Rhino.Mocks; using Ringtoets.Common.Data; using Ringtoets.Common.Data.AssessmentSection; +using Ringtoets.Common.Data.Probabilistics; using Ringtoets.Piping.Data; -using Ringtoets.Piping.Data.Probabilistics; using Ringtoets.Piping.Forms.PresentationObjects; using Ringtoets.Piping.Forms.PropertyClasses; using Ringtoets.Piping.Forms.TypeConverters; Index: Ringtoets/Piping/test/Ringtoets.Piping.Forms.Test/TypeConverters/ShiftedLognormalDistributionDesignVariableTypeConverterTest.cs =================================================================== diff -u -rf1bc823fd2e2937317d9a7075c195d0d14cf7222 -r1e4d77c17c6eac78bfd705efdff9e52b4fca2c7e --- Ringtoets/Piping/test/Ringtoets.Piping.Forms.Test/TypeConverters/ShiftedLognormalDistributionDesignVariableTypeConverterTest.cs (.../ShiftedLognormalDistributionDesignVariableTypeConverterTest.cs) (revision f1bc823fd2e2937317d9a7075c195d0d14cf7222) +++ Ringtoets/Piping/test/Ringtoets.Piping.Forms.Test/TypeConverters/ShiftedLognormalDistributionDesignVariableTypeConverterTest.cs (.../ShiftedLognormalDistributionDesignVariableTypeConverterTest.cs) (revision 1e4d77c17c6eac78bfd705efdff9e52b4fca2c7e) @@ -1,12 +1,8 @@ using System.ComponentModel; - using Core.Common.Base.Data; - using NUnit.Framework; - using Rhino.Mocks; - -using Ringtoets.Piping.Data.Probabilistics; +using Ringtoets.Common.Data.Probabilistics; using Ringtoets.Piping.Forms.TypeConverters; namespace Ringtoets.Piping.Forms.Test.TypeConverters @@ -43,9 +39,9 @@ // Setup var distribution = new ShiftedLognormalDistribution(5) { - Mean = (RoundedDouble)1.1, - StandardDeviation = (RoundedDouble)2.2, - Shift = (RoundedDouble)3.3 + Mean = (RoundedDouble) 1.1, + StandardDeviation = (RoundedDouble) 2.2, + Shift = (RoundedDouble) 3.3 }; var designVariable = new ShiftedLognormalDistributionDesignVariable(distribution); var converter = new ShiftedLognormalDistributionDesignVariableTypeConverter(); Index: Ringtoets/Piping/test/Ringtoets.Piping.KernelWrapper.Test/Ringtoets.Piping.KernelWrapper.Test.csproj =================================================================== diff -u -r10779bb6a6db2d00f4627b2bc190e7e35e1fee3e -r1e4d77c17c6eac78bfd705efdff9e52b4fca2c7e --- Ringtoets/Piping/test/Ringtoets.Piping.KernelWrapper.Test/Ringtoets.Piping.KernelWrapper.Test.csproj (.../Ringtoets.Piping.KernelWrapper.Test.csproj) (revision 10779bb6a6db2d00f4627b2bc190e7e35e1fee3e) +++ Ringtoets/Piping/test/Ringtoets.Piping.KernelWrapper.Test/Ringtoets.Piping.KernelWrapper.Test.csproj (.../Ringtoets.Piping.KernelWrapper.Test.csproj) (revision 1e4d77c17c6eac78bfd705efdff9e52b4fca2c7e) @@ -78,6 +78,10 @@ {D749EE4C-CE50-4C17-BF01-9A953028C126} Core.Common.TestUtil + + {D4200F43-3F72-4F42-AF0A-8CED416A38EC} + Ringtoets.Common.Data + {ce994cc9-6f6a-48ac-b4be-02c30a21f4db} Ringtoets.Piping.Data