// Copyright (C) Stichting Deltares 2017. 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.Collections.Generic; using Ringtoets.Common.Data.Probabilistics; using Ringtoets.Common.Data.Structures; using Ringtoets.Common.IO.Configurations; using Ringtoets.HeightStructures.Data; namespace Ringtoets.HeightStructures.IO.Configurations { /// /// Validates and assigns stochast configurations to a height structure calculation input. /// public class HeightStructuresCalculationStochastAssigner : StructuresCalculationStochastAssigner { /// /// Creates a new instance of /// /// The configuration that is used for stochast parameter source. /// The target calculation. public HeightStructuresCalculationStochastAssigner( HeightStructuresCalculationConfiguration configuration, StructuresCalculation calculation) : base(configuration, calculation) {} protected override IEnumerable GetStandardDeviationStochasts(bool onlyStructureDependent = false) { yield return new StandardDeviationDefinition( HeightStructuresConfigurationSchemaIdentifiers.LevelCrestStructureStochastName, Configuration.LevelCrestStructure, i => i.LevelCrestStructure, (i, d) => i.LevelCrestStructure = (NormalDistribution) d); yield return new StandardDeviationDefinition( ConfigurationSchemaIdentifiers.AllowedLevelIncreaseStorageStochastName, Configuration.AllowedLevelIncreaseStorage, i => i.AllowedLevelIncreaseStorage, (i, d) => i.AllowedLevelIncreaseStorage = (LogNormalDistribution) d); yield return new StandardDeviationDefinition( ConfigurationSchemaIdentifiers.FlowWidthAtBottomProtectionStochastName, Configuration.FlowWidthAtBottomProtection, i => i.FlowWidthAtBottomProtection, (i, d) => i.FlowWidthAtBottomProtection = (LogNormalDistribution) d); yield return new StandardDeviationDefinition( ConfigurationSchemaIdentifiers.WidthFlowAperturesStochastName, Configuration.WidthFlowApertures, i => i.WidthFlowApertures, (i, d) => i.WidthFlowApertures = (NormalDistribution) d); if (!onlyStructureDependent) { yield return new StandardDeviationDefinition( ConfigurationSchemaIdentifiers.ModelFactorSuperCriticalFlowStochastName, Configuration.ModelFactorSuperCriticalFlow, i => i.ModelFactorSuperCriticalFlow, (i, d) => i.ModelFactorSuperCriticalFlow = (NormalDistribution) d); } } protected override IEnumerable GetVariationCoefficientStochasts(bool onlyStructureDependent = false) { yield return new VariationCoefficientDefinition( ConfigurationSchemaIdentifiers.CriticalOvertoppingDischargeStochastName, Configuration.CriticalOvertoppingDischarge, i => i.CriticalOvertoppingDischarge, (i, d) => i.CriticalOvertoppingDischarge = (VariationCoefficientLogNormalDistribution) d); yield return new VariationCoefficientDefinition( ConfigurationSchemaIdentifiers.StorageStructureAreaStochastName, Configuration.StorageStructureArea, i => i.StorageStructureArea, (i, d) => i.StorageStructureArea = (VariationCoefficientLogNormalDistribution) d); if (!onlyStructureDependent) { yield return new VariationCoefficientDefinition( ConfigurationSchemaIdentifiers.StormDurationStochastName, Configuration.StormDuration, i => i.StormDuration, (i, d) => i.StormDuration = (VariationCoefficientLogNormalDistribution) d); } } } }