コード例 #1
0
        public void GenerateCalculationItemsStructure_Always_CreateCalculationsWithSurfaceLineNameSoilProfileNameGeneralInputAndSemiProbabilisticInput()
        {
            // Setup
            var soilProfile1 = new MacroStabilityInwardsSoilProfile1D("Profile 1", -10.0, new[]
            {
                new MacroStabilityInwardsSoilLayer1D(-5.0),
                new MacroStabilityInwardsSoilLayer1D(-2.0),
                new MacroStabilityInwardsSoilLayer1D(1.0)
            });
            var soilProfile2 = new MacroStabilityInwardsSoilProfile1D("Profile 2", -8.0, new[]
            {
                new MacroStabilityInwardsSoilLayer1D(-4.0),
                new MacroStabilityInwardsSoilLayer1D(0.0),
                new MacroStabilityInwardsSoilLayer1D(4.0)
            });

            var soilModel = new MacroStabilityInwardsStochasticSoilModel("A", new[]
            {
                new Point2D(1.0, 0.0),
                new Point2D(5.0, 0.0)
            }, new[]
            {
                new MacroStabilityInwardsStochasticSoilProfile(0.3, soilProfile1),
                new MacroStabilityInwardsStochasticSoilProfile(0.7, soilProfile2)
            });

            MacroStabilityInwardsStochasticSoilModel[] availableSoilModels =
            {
                soilModel
            };

            var surfaceLine = new MacroStabilityInwardsSurfaceLine("Surface Line");

            surfaceLine.SetGeometry(new[]
            {
                new Point3D(3.0, 5.0, 0.0),
                new Point3D(3.0, 0.0, 1.0),
                new Point3D(3.0, -5.0, 0.0)
            });

            MacroStabilityInwardsSurfaceLine[] surfaceLines =
            {
                surfaceLine
            };

            // Call
            IEnumerable <ICalculationBase> result = MacroStabilityInwardsCalculationConfigurationHelper.GenerateCalculationItemsStructure(
                surfaceLines,
                availableSoilModels).ToArray();

            // Assert
            var group = result.First(sl => sl.Name == surfaceLine.Name) as CalculationGroup;

            Assert.NotNull(group);
            var calculationInput1 = (MacroStabilityInwardsCalculationScenario)group.Children[0];
            var calculationInput2 = (MacroStabilityInwardsCalculationScenario)group.Children[1];

            Assert.AreEqual($"{surfaceLine.Name} {soilProfile1.Name}", calculationInput1.Name);
            Assert.AreEqual($"{surfaceLine.Name} {soilProfile2.Name}", calculationInput2.Name);
        }
コード例 #2
0
        /// <summary>
        /// Gets the available stochastic soil models on <see cref="MacroStabilityInwardsCalculationScenarioContext"/>.
        /// </summary>
        public IEnumerable <MacroStabilityInwardsStochasticSoilModel> GetAvailableStochasticSoilModels()
        {
            if (data.WrappedData.SurfaceLine == null)
            {
                return(data.AvailableStochasticSoilModels);
            }

            return(MacroStabilityInwardsCalculationConfigurationHelper.GetStochasticSoilModelsForSurfaceLine(data.WrappedData.SurfaceLine, data.AvailableStochasticSoilModels));
        }
コード例 #3
0
        public void GenerateCalculationItemsStructure_WithoutSoilModels_ThrowsArgumentNullException()
        {
            // Call
            TestDelegate test = () => MacroStabilityInwardsCalculationConfigurationHelper.GenerateCalculationItemsStructure(
                Enumerable.Empty <MacroStabilityInwardsSurfaceLine>(),
                null);

            // Assert
            string parameter = Assert.Throws <ArgumentNullException>(test).ParamName;

            Assert.AreEqual("soilModels", parameter);
        }
コード例 #4
0
        public void GetStochasticSoilModelsForSurfaceLine_SurfaceLineIntersectingSoilModel_ReturnSoilModel()
        {
            // Setup
            var soilProfile1 = new MacroStabilityInwardsStochasticSoilProfile(0.3, new MacroStabilityInwardsSoilProfile1D("Profile 1", -10.0, new[]
            {
                new MacroStabilityInwardsSoilLayer1D(-5.0),
                new MacroStabilityInwardsSoilLayer1D(-2.0),
                new MacroStabilityInwardsSoilLayer1D(1.0)
            }));
            var soilProfile2 = new MacroStabilityInwardsStochasticSoilProfile(0.7, new MacroStabilityInwardsSoilProfile1D("Profile 2", -8.0, new[]
            {
                new MacroStabilityInwardsSoilLayer1D(-4.0),
                new MacroStabilityInwardsSoilLayer1D(0.0),
                new MacroStabilityInwardsSoilLayer1D(4.0)
            }));

            var soilModel = new MacroStabilityInwardsStochasticSoilModel("A", new[]
            {
                new Point2D(1.0, 0.0),
                new Point2D(5.0, 0.0)
            }, new[]
            {
                soilProfile1,
                soilProfile2
            });

            MacroStabilityInwardsStochasticSoilModel[] availableSoilModels =
            {
                soilModel
            };

            var surfaceLine = new MacroStabilityInwardsSurfaceLine(string.Empty);

            surfaceLine.SetGeometry(new[]
            {
                new Point3D(3.0, 5.0, 0.0),
                new Point3D(3.0, 0.0, 1.0),
                new Point3D(3.0, -5.0, 0.0)
            });

            // Call
            IEnumerable <MacroStabilityInwardsStochasticSoilModel> result = MacroStabilityInwardsCalculationConfigurationHelper.GetStochasticSoilModelsForSurfaceLine(
                surfaceLine,
                availableSoilModels);

            // Assert
            MacroStabilityInwardsStochasticSoilModel[] expected =
            {
                soilModel
            };
            CollectionAssert.AreEquivalent(expected, result);
        }
コード例 #5
0
        public void GetStochasticSoilModelsForSurfaceLine_SoilModelGeometryNotIntersecting_ReturnEmpty()
        {
            // Setup
            var soilProfile1 = new MacroStabilityInwardsSoilProfile1D("Profile 1", -10.0, new[]
            {
                new MacroStabilityInwardsSoilLayer1D(-5.0),
                new MacroStabilityInwardsSoilLayer1D(-2.0),
                new MacroStabilityInwardsSoilLayer1D(1.0)
            });
            var soilProfile2 = new MacroStabilityInwardsSoilProfile1D("Profile 2", -8.0, new[]
            {
                new MacroStabilityInwardsSoilLayer1D(-4.0),
                new MacroStabilityInwardsSoilLayer1D(0.0),
                new MacroStabilityInwardsSoilLayer1D(4.0)
            });

            var soilModel = new MacroStabilityInwardsStochasticSoilModel("A", new[]
            {
                new Point2D(1.0, 0.0),
                new Point2D(5.0, 0.0)
            }, new[]
            {
                new MacroStabilityInwardsStochasticSoilProfile(0.3, soilProfile1),
                new MacroStabilityInwardsStochasticSoilProfile(0.7, soilProfile2)
            });

            MacroStabilityInwardsStochasticSoilModel[] availableSoilModels =
            {
                soilModel
            };

            var surfaceLine = new MacroStabilityInwardsSurfaceLine(string.Empty);

            surfaceLine.SetGeometry(new[]
            {
                new Point3D(0.0, 1.0, 0.0),
                new Point3D(2.5, 1.0, 1.0),
                new Point3D(5.0, 1.0, 0.0)
            });

            // Call
            IEnumerable <MacroStabilityInwardsStochasticSoilModel> result = MacroStabilityInwardsCalculationConfigurationHelper.GetStochasticSoilModelsForSurfaceLine(surfaceLine, availableSoilModels);

            // Assert
            CollectionAssert.IsEmpty(result);
        }
コード例 #6
0
        public void GetStochasticSoilModelsForSurfaceLine_NoSoilModels_ReturnEmpty()
        {
            // Setup
            var surfaceLine = new MacroStabilityInwardsSurfaceLine(string.Empty);

            surfaceLine.SetGeometry(new[]
            {
                new Point3D(3.0, 5.0, 0.0),
                new Point3D(3.0, 0.0, 1.0),
                new Point3D(3.0, -5.0, 0.0)
            });

            // Call
            IEnumerable <MacroStabilityInwardsStochasticSoilModel> result = MacroStabilityInwardsCalculationConfigurationHelper.GetStochasticSoilModelsForSurfaceLine(
                surfaceLine,
                Enumerable.Empty <MacroStabilityInwardsStochasticSoilModel>());

            // Assert
            CollectionAssert.IsEmpty(result);
        }
コード例 #7
0
        protected override void GenerateCalculations()
        {
            var calculationGroup = (CalculationGroup)Data;

            using (var dialog = new MacroStabilityInwardsSurfaceLineSelectionDialog(Parent, FailureMechanism.SurfaceLines))
            {
                dialog.ShowDialog();

                if (dialog.SelectedItems.Any())
                {
                    IEnumerable <ICalculationBase> calculationsStructure = MacroStabilityInwardsCalculationConfigurationHelper.GenerateCalculationItemsStructure(
                        dialog.SelectedItems,
                        FailureMechanism.StochasticSoilModels);
                    foreach (ICalculationBase item in calculationsStructure)
                    {
                        calculationGroup.Children.Add(item);
                    }

                    calculationGroup.NotifyObservers();
                }
            }
        }
コード例 #8
0
        public void GenerateCalculationItemsStructure_WithSurfaceLinesWithEmptySoilModels_LogFourWarnings()
        {
            // Setup
            const string testName1 = "group1";
            const string testName2 = "group2";
            const string testName3 = "group3";
            const string testName4 = "group4";

            var surfaceLines = new List <MacroStabilityInwardsSurfaceLine>
            {
                new MacroStabilityInwardsSurfaceLine(testName1),
                new MacroStabilityInwardsSurfaceLine(testName2),
                new MacroStabilityInwardsSurfaceLine(testName3),
                new MacroStabilityInwardsSurfaceLine(testName4)
            };
            IEnumerable <ICalculationBase> result = null;

            // Call
            Action call = () =>
            {
                result = MacroStabilityInwardsCalculationConfigurationHelper.GenerateCalculationItemsStructure(
                    surfaceLines,
                    Enumerable.Empty <MacroStabilityInwardsStochasticSoilModel>()).ToArray();
            };

            // Assert
            const string format = "Geen ondergrondschematisaties gevonden voor profielschematisatie '{0}'. De profielschematisatie is overgeslagen.";

            Tuple <string, LogLevelConstant>[] expectedMessages =
            {
                Tuple.Create(string.Format(format, testName1), LogLevelConstant.Warn),
                Tuple.Create(string.Format(format, testName2), LogLevelConstant.Warn),
                Tuple.Create(string.Format(format, testName3), LogLevelConstant.Warn),
                Tuple.Create(string.Format(format, testName4), LogLevelConstant.Warn)
            };
            TestHelper.AssertLogMessagesWithLevelAreGenerated(call, expectedMessages);
            CollectionAssert.IsEmpty(result);
        }
コード例 #9
0
        public void GenerateCalculationItemsStructure_OneSurfaceLineIntersectingSoilModelOneSurfaceLineNoIntersection_ReturnOneGroupsWithProfilesAndLogOneWarning()
        {
            // Setup
            var soilProfile1 = new MacroStabilityInwardsStochasticSoilProfile(1.0, new MacroStabilityInwardsSoilProfile1D("Profile 1", -10.0, new[]
            {
                new MacroStabilityInwardsSoilLayer1D(-5.0),
                new MacroStabilityInwardsSoilLayer1D(-2.0),
                new MacroStabilityInwardsSoilLayer1D(1.0)
            }));
            var soilProfile2 = new MacroStabilityInwardsStochasticSoilProfile(1.0, new MacroStabilityInwardsSoilProfile1D("Profile 2", -8.0, new[]
            {
                new MacroStabilityInwardsSoilLayer1D(-4.0),
                new MacroStabilityInwardsSoilLayer1D(0.0),
                new MacroStabilityInwardsSoilLayer1D(4.0)
            }));

            const double y          = 1.1;
            var          soilModel1 = new MacroStabilityInwardsStochasticSoilModel("A", new[]
            {
                new Point2D(1.0, y),
                new Point2D(2.0, y)
            }, new[]
            {
                soilProfile1,
                soilProfile2
            });

            var soilModel2 = new MacroStabilityInwardsStochasticSoilModel("A", new[]
            {
                new Point2D(3.0, y),
                new Point2D(4.0, y)
            }, new[]
            {
                soilProfile2
            });

            MacroStabilityInwardsStochasticSoilModel[] availableSoilModels =
            {
                soilModel1,
                soilModel2
            };

            const string surfaceLineName1 = "surface line 1";
            const string surfaceLineName2 = "surface line 2";
            var          surfaceLine1     = new MacroStabilityInwardsSurfaceLine(surfaceLineName1);

            surfaceLine1.SetGeometry(new[]
            {
                new Point3D(2.5, y, 1.0),
                new Point3D(0.0, y, 0.0)
            });
            var surfaceLine2 = new MacroStabilityInwardsSurfaceLine(surfaceLineName2);

            surfaceLine2.SetGeometry(new[]
            {
                new Point3D(5.0, y, 1.0),
                new Point3D(6.4, y, 0.0)
            });

            MacroStabilityInwardsSurfaceLine[] surfaceLines =
            {
                surfaceLine1,
                surfaceLine2
            };

            ICalculationBase[] result = null;

            // Call
            Action call = () =>
            {
                result = MacroStabilityInwardsCalculationConfigurationHelper.GenerateCalculationItemsStructure(
                    surfaceLines,
                    availableSoilModels).ToArray();
            };

            // Assert
            Tuple <string, LogLevelConstant> expectedMessage = Tuple.Create(
                $"Geen ondergrondschematisaties gevonden voor profielschematisatie '{surfaceLineName2}'. De profielschematisatie is overgeslagen.",
                LogLevelConstant.Warn);

            TestHelper.AssertLogMessageWithLevelIsGenerated(call, expectedMessage, 1);

            Assert.AreEqual(1, result.Length);
            var calculationGroup1 = result.First(g => g.Name == surfaceLineName1) as CalculationGroup;

            Assert.NotNull(calculationGroup1);

            Assert.AreEqual(2, calculationGroup1.Children.Count);
            CollectionAssert.AllItemsAreInstancesOfType(calculationGroup1.Children, typeof(MacroStabilityInwardsCalculationScenario));

            var calculationScenario1 = (MacroStabilityInwardsCalculationScenario)calculationGroup1.Children[0];

            Assert.AreEqual((RoundedDouble)soilProfile1.Probability, calculationScenario1.Contribution);

            MacroStabilityInwardsInput calculationInput1 = calculationScenario1.InputParameters;

            Assert.AreSame(soilProfile1, calculationInput1.StochasticSoilProfile);
            Assert.AreSame(surfaceLine1, calculationInput1.SurfaceLine);

            MacroStabilityInwardsInput calculationInput2 = ((MacroStabilityInwardsCalculationScenario)calculationGroup1.Children[1]).InputParameters;

            Assert.AreSame(soilProfile2, calculationInput2.StochasticSoilProfile);
            Assert.AreSame(surfaceLine1, calculationInput2.SurfaceLine);
        }
コード例 #10
0
        public void GenerateCalculationItemsStructure_SurfaceLinesEachIntersectingSoilModel_ReturnTwoGroupsWithProfilesFromIntersectingSoilModels()
        {
            // Setup
            var soilProfile1 = new MacroStabilityInwardsStochasticSoilProfile(1.0, new MacroStabilityInwardsSoilProfile1D("Profile 1", -10.0, new[]
            {
                new MacroStabilityInwardsSoilLayer1D(-5.0),
                new MacroStabilityInwardsSoilLayer1D(-2.0),
                new MacroStabilityInwardsSoilLayer1D(1.0)
            }));
            var soilProfile2 = new MacroStabilityInwardsStochasticSoilProfile(1.0, new MacroStabilityInwardsSoilProfile1D("Profile 2", -8.0, new[]
            {
                new MacroStabilityInwardsSoilLayer1D(-4.0),
                new MacroStabilityInwardsSoilLayer1D(0.0),
                new MacroStabilityInwardsSoilLayer1D(4.0)
            }));

            const double y          = 1.1;
            var          soilModel1 = new MacroStabilityInwardsStochasticSoilModel("A", new[]
            {
                new Point2D(1.0, y),
                new Point2D(2.0, y)
            }, new[]
            {
                soilProfile1,
                soilProfile2
            });

            var soilModel2 = new MacroStabilityInwardsStochasticSoilModel("A", new[]
            {
                new Point2D(3.0, y),
                new Point2D(4.0, y)
            }, new[]
            {
                soilProfile2
            });

            MacroStabilityInwardsStochasticSoilModel[] availableSoilModels =
            {
                soilModel1,
                soilModel2
            };

            const string surfaceLineName1 = "surface line 1";
            const string surfaceLineName2 = "surface line 2";
            var          surfaceLine1     = new MacroStabilityInwardsSurfaceLine(surfaceLineName1);

            surfaceLine1.SetGeometry(new[]
            {
                new Point3D(2.5, y, 1.0),
                new Point3D(0.0, y, 0.0)
            });
            var surfaceLine2 = new MacroStabilityInwardsSurfaceLine(surfaceLineName2);

            surfaceLine2.SetGeometry(new[]
            {
                new Point3D(2.5, y, 1.0),
                new Point3D(5.0, y, 0.0)
            });

            MacroStabilityInwardsSurfaceLine[] surfaceLines =
            {
                surfaceLine1,
                surfaceLine2
            };

            // Call
            IEnumerable <ICalculationBase> result = MacroStabilityInwardsCalculationConfigurationHelper.GenerateCalculationItemsStructure(
                surfaceLines,
                availableSoilModels).ToArray();

            // Assert
            Assert.AreEqual(2, result.Count());
            var calculationGroup1 = result.First(g => g.Name == surfaceLineName1) as CalculationGroup;

            Assert.NotNull(calculationGroup1);

            Assert.AreEqual(2, calculationGroup1.Children.Count);
            CollectionAssert.AllItemsAreInstancesOfType(calculationGroup1.Children, typeof(MacroStabilityInwardsCalculationScenario));

            var calculationScenario1 = (MacroStabilityInwardsCalculationScenario)calculationGroup1.Children[0];

            Assert.AreEqual((RoundedDouble)soilProfile1.Probability, calculationScenario1.Contribution);

            MacroStabilityInwardsInput calculationInput1 = calculationScenario1.InputParameters;

            Assert.AreSame(soilProfile1, calculationInput1.StochasticSoilProfile);
            Assert.AreSame(surfaceLine1, calculationInput1.SurfaceLine);

            var calculationScenario2 = (MacroStabilityInwardsCalculationScenario)calculationGroup1.Children[1];

            Assert.AreEqual((RoundedDouble)soilProfile2.Probability, calculationScenario1.Contribution);

            MacroStabilityInwardsInput calculationInput2 = calculationScenario2.InputParameters;

            Assert.AreSame(soilProfile2, calculationInput2.StochasticSoilProfile);
            Assert.AreSame(surfaceLine1, calculationInput2.SurfaceLine);

            var calculationGroup2 = result.First(g => g.Name == surfaceLineName2) as CalculationGroup;

            Assert.NotNull(calculationGroup2);

            Assert.AreEqual(1, calculationGroup2.Children.Count);
            CollectionAssert.AllItemsAreInstancesOfType(calculationGroup2.Children, typeof(MacroStabilityInwardsCalculationScenario));

            var calculationScenario3 = (MacroStabilityInwardsCalculationScenario)calculationGroup2.Children[0];

            Assert.AreEqual((RoundedDouble)soilProfile2.Probability, calculationScenario1.Contribution);

            MacroStabilityInwardsInput calculationInput3 = calculationScenario3.InputParameters;

            Assert.AreSame(soilProfile2, calculationInput3.StochasticSoilProfile);
            Assert.AreSame(surfaceLine2, calculationInput3.SurfaceLine);
        }
コード例 #11
0
        public void GenerateCalculationItemsStructure_SoilModelGeometryNotIntersecting_LogWarning()
        {
            // Setup
            var soilProfile1 = new MacroStabilityInwardsSoilProfile1D("Profile 1", -10.0, new[]
            {
                new MacroStabilityInwardsSoilLayer1D(-5.0),
                new MacroStabilityInwardsSoilLayer1D(-2.0),
                new MacroStabilityInwardsSoilLayer1D(1.0)
            });
            var soilProfile2 = new MacroStabilityInwardsSoilProfile1D("Profile 2", -8.0, new[]
            {
                new MacroStabilityInwardsSoilLayer1D(-4.0),
                new MacroStabilityInwardsSoilLayer1D(0.0),
                new MacroStabilityInwardsSoilLayer1D(4.0)
            });

            var soilModel = new MacroStabilityInwardsStochasticSoilModel("A", new[]
            {
                new Point2D(1.0, 0.0),
                new Point2D(5.0, 0.0)
            }, new[]
            {
                new MacroStabilityInwardsStochasticSoilProfile(0.3, soilProfile1),
                new MacroStabilityInwardsStochasticSoilProfile(0.7, soilProfile2)
            });

            MacroStabilityInwardsStochasticSoilModel[] availableSoilModels =
            {
                soilModel
            };

            const string testName    = "testName";
            var          surfaceLine = new MacroStabilityInwardsSurfaceLine(testName);

            surfaceLine.SetGeometry(new[]
            {
                new Point3D(0.0, 1.0, 0.0),
                new Point3D(2.5, 1.0, 1.0),
                new Point3D(5.0, 1.0, 0.0)
            });

            MacroStabilityInwardsSurfaceLine[] surfaceLines =
            {
                surfaceLine
            };

            IEnumerable <ICalculationBase> result = null;

            // Call
            Action call = () =>
            {
                result = MacroStabilityInwardsCalculationConfigurationHelper.GenerateCalculationItemsStructure(
                    surfaceLines,
                    availableSoilModels).ToArray();
            };

            // Assert
            Tuple <string, LogLevelConstant> expectedMessage = Tuple.Create(
                $"Geen ondergrondschematisaties gevonden voor profielschematisatie '{testName}'. De profielschematisatie is overgeslagen.",
                LogLevelConstant.Warn);

            TestHelper.AssertLogMessageWithLevelIsGenerated(call, expectedMessage);
            CollectionAssert.IsEmpty(result);
        }
コード例 #12
0
        public void GenerateCalculationItemsStructure_SurfaceLineIntersectingSoilModel_ReturnOneGroupWithTwoCalculations()
        {
            // Setup
            var soilProfile1 = new MacroStabilityInwardsStochasticSoilProfile(0.3, new MacroStabilityInwardsSoilProfile1D("Profile 1", -10.0, new[]
            {
                new MacroStabilityInwardsSoilLayer1D(-5.0),
                new MacroStabilityInwardsSoilLayer1D(-2.0),
                new MacroStabilityInwardsSoilLayer1D(1.0)
            }));
            var soilProfile2 = new MacroStabilityInwardsStochasticSoilProfile(0.7, new MacroStabilityInwardsSoilProfile1D("Profile 2", -8.0, new[]
            {
                new MacroStabilityInwardsSoilLayer1D(-4.0),
                new MacroStabilityInwardsSoilLayer1D(0.0),
                new MacroStabilityInwardsSoilLayer1D(4.0)
            }));

            var soilModel = new MacroStabilityInwardsStochasticSoilModel("A", new[]
            {
                new Point2D(1.0, 0.0),
                new Point2D(5.0, 0.0)
            }, new[]
            {
                soilProfile1,
                soilProfile2
            });

            MacroStabilityInwardsStochasticSoilModel[] availableSoilModels =
            {
                soilModel
            };

            var surfaceLine = new MacroStabilityInwardsSurfaceLine(string.Empty);

            surfaceLine.SetGeometry(new[]
            {
                new Point3D(3.0, 5.0, 0.0),
                new Point3D(3.0, 0.0, 1.0),
                new Point3D(3.0, -5.0, 0.0)
            });

            MacroStabilityInwardsSurfaceLine[] surfaceLines =
            {
                surfaceLine
            };

            // Call
            IEnumerable <ICalculationBase> result = MacroStabilityInwardsCalculationConfigurationHelper.GenerateCalculationItemsStructure(
                surfaceLines,
                availableSoilModels).ToArray();

            // Assert
            Assert.AreEqual(1, result.Count());
            var calculationGroup = result.First() as CalculationGroup;

            Assert.NotNull(calculationGroup);

            Assert.AreEqual(2, calculationGroup.Children.Count);
            CollectionAssert.AllItemsAreInstancesOfType(calculationGroup.Children, typeof(MacroStabilityInwardsCalculationScenario));

            var calculationScenario1 = (MacroStabilityInwardsCalculationScenario)calculationGroup.Children[0];

            Assert.AreEqual((RoundedDouble)soilProfile1.Probability, calculationScenario1.Contribution);

            MacroStabilityInwardsInput calculationInput1 = calculationScenario1.InputParameters;

            Assert.AreSame(soilProfile1, calculationInput1.StochasticSoilProfile);
            Assert.AreSame(surfaceLine, calculationInput1.SurfaceLine);

            var calculationScenario2 = (MacroStabilityInwardsCalculationScenario)calculationGroup.Children[1];

            Assert.AreEqual((RoundedDouble)soilProfile2.Probability, calculationScenario2.Contribution);

            MacroStabilityInwardsInput calculationInput2 = calculationScenario2.InputParameters;

            Assert.AreSame(soilProfile2, calculationInput2.StochasticSoilProfile);
            Assert.AreSame(surfaceLine, calculationInput2.SurfaceLine);
        }
コード例 #13
0
 private IEnumerable <MacroStabilityInwardsStochasticSoilModel> GetSoilModelsForCalculation(MacroStabilityInwardsCalculation calculation)
 {
     return(MacroStabilityInwardsCalculationConfigurationHelper.GetStochasticSoilModelsForSurfaceLine(
                calculation.InputParameters.SurfaceLine,
                FailureMechanism.StochasticSoilModels));
 }
コード例 #14
0
 private IEnumerable <MacroStabilityInwardsStochasticSoilModel> GetAvailableStochasticSoilModels(MacroStabilityInwardsSurfaceLine surfaceLine)
 {
     return(MacroStabilityInwardsCalculationConfigurationHelper.GetStochasticSoilModelsForSurfaceLine(surfaceLine,
                                                                                                      FailureMechanism.StochasticSoilModels));
 }