Index: Riskeer/MacroStabilityInwards/src/Riskeer.MacroStabilityInwards.IO/Factories/PersistableStateFactory.cs =================================================================== diff -u -r8717913cf7befbb647a6be23f9493e99435d0d4a -rdb6b3624eb33a8c762dec9f4565c18cd229fba5f --- Riskeer/MacroStabilityInwards/src/Riskeer.MacroStabilityInwards.IO/Factories/PersistableStateFactory.cs (.../PersistableStateFactory.cs) (revision 8717913cf7befbb647a6be23f9493e99435d0d4a) +++ Riskeer/MacroStabilityInwards/src/Riskeer.MacroStabilityInwards.IO/Factories/PersistableStateFactory.cs (.../PersistableStateFactory.cs) (revision db6b3624eb33a8c762dec9f4565c18cd229fba5f) @@ -23,8 +23,10 @@ using System.Collections.Generic; using System.Linq; using Components.Persistence.Stability.Data; +using Core.Common.Base.Data; using Core.Common.Base.Geometry; using Core.Common.Geometry; +using Riskeer.Common.Data.Probabilistics; using Riskeer.MacroStabilityInwards.Data.SoilProfile; using Riskeer.MacroStabilityInwards.Primitives; @@ -76,7 +78,7 @@ Id = idFactory.Create(), StateLines = Enumerable.Empty(), StatePoints = MacroStabilityInwardsSoilProfile2DLayersHelper.GetLayersRecursively(soilProfile.Layers) - .Where(l => l.Data.UsePop) + .Where(l => l.Data.UsePop && HasValidPop(l.Data.Pop)) .Select(l => CreateStatePoint(l, stageType, idFactory, registry)) .ToArray() }; @@ -86,6 +88,12 @@ return state; } + private static bool HasValidPop(IVariationCoefficientDistribution pop) + { + return pop.Mean != RoundedDouble.NaN + && pop.CoefficientOfVariation != RoundedDouble.NaN; + } + private static PersistableStatePoint CreateStatePoint(MacroStabilityInwardsSoilLayer2D layer, MacroStabilityInwardsExportStageType stageType, IdFactory idFactory, MacroStabilityInwardsExportRegistry registry) { Index: Riskeer/MacroStabilityInwards/test/Riskeer.MacroStabilityInwards.IO.Test/Factories/PersistableStateFactoryTest.cs =================================================================== diff -u -r6ff01e7ca7bcb0fefcef033ae31738c401bcf24f -rdb6b3624eb33a8c762dec9f4565c18cd229fba5f --- Riskeer/MacroStabilityInwards/test/Riskeer.MacroStabilityInwards.IO.Test/Factories/PersistableStateFactoryTest.cs (.../PersistableStateFactoryTest.cs) (revision 6ff01e7ca7bcb0fefcef033ae31738c401bcf24f) +++ Riskeer/MacroStabilityInwards/test/Riskeer.MacroStabilityInwards.IO.Test/Factories/PersistableStateFactoryTest.cs (.../PersistableStateFactoryTest.cs) (revision db6b3624eb33a8c762dec9f4565c18cd229fba5f) @@ -23,14 +23,13 @@ using System.Collections.Generic; using System.Linq; using Components.Persistence.Stability.Data; -using Core.Common.Base.Geometry; -using Core.Common.Geometry; +using Core.Common.Base.Data; using Core.Common.Util.Extensions; using NUnit.Framework; using Rhino.Mocks; +using Riskeer.Common.Data.Probabilistics; using Riskeer.Common.Data.TestUtil; using Riskeer.MacroStabilityInwards.Data; -using Riskeer.MacroStabilityInwards.Data.SoilProfile; using Riskeer.MacroStabilityInwards.Data.TestUtil; using Riskeer.MacroStabilityInwards.IO.Factories; using Riskeer.MacroStabilityInwards.IO.TestUtil; @@ -93,6 +92,11 @@ MacroStabilityInwardsCalculationScenario calculation = MacroStabilityInwardsCalculationScenarioTestFactory.CreateMacroStabilityInwardsCalculationScenarioWithValidInput( new TestHydraulicBoundaryLocation()); IMacroStabilityInwardsSoilProfileUnderSurfaceLine soilProfile = calculation.InputParameters.SoilProfileUnderSurfaceLine; + soilProfile.Layers.First().Data.Pop = new VariationCoefficientLogNormalDistribution + { + Mean = (RoundedDouble) 1, + CoefficientOfVariation = (RoundedDouble) 2 + }; soilProfile.Layers.ForEachElementDo(l => l.Data.UsePop = true); var idFactory = new IdFactory(); Index: Riskeer/MacroStabilityInwards/test/Riskeer.MacroStabilityInwards.IO.TestUtil/PersistableDataModelTestHelper.cs =================================================================== diff -u -r7fd9d2bf74176ea1d05e7bb7619a09a5ec7caec0 -rdb6b3624eb33a8c762dec9f4565c18cd229fba5f --- Riskeer/MacroStabilityInwards/test/Riskeer.MacroStabilityInwards.IO.TestUtil/PersistableDataModelTestHelper.cs (.../PersistableDataModelTestHelper.cs) (revision 7fd9d2bf74176ea1d05e7bb7619a09a5ec7caec0) +++ Riskeer/MacroStabilityInwards/test/Riskeer.MacroStabilityInwards.IO.TestUtil/PersistableDataModelTestHelper.cs (.../PersistableDataModelTestHelper.cs) (revision db6b3624eb33a8c762dec9f4565c18cd229fba5f) @@ -405,7 +405,9 @@ Assert.AreEqual(2, states.Count()); IEnumerable layersWithPop = MacroStabilityInwardsSoilProfile2DLayersHelper.GetLayersRecursively(soilProfile.Layers) - .Where(l => l.Data.UsePop); + .Where(l => l.Data.UsePop + && l.Data.Pop.Mean != RoundedDouble.NaN + && l.Data.Pop.CoefficientOfVariation != RoundedDouble.NaN); for (var i = 0; i < states.Count(); i++) {