Index: Ringtoets/StabilityPointStructures/src/Ringtoets.StabilityPointStructures.Data/StabilityPointStructure.cs =================================================================== diff -u -rff948d4633181ead2677ab35467a93b4118c6751 -re70c00d8db0fdded4e7ed647cfaa994923078d8e --- Ringtoets/StabilityPointStructures/src/Ringtoets.StabilityPointStructures.Data/StabilityPointStructure.cs (.../StabilityPointStructure.cs) (revision ff948d4633181ead2677ab35467a93b4118c6751) +++ Ringtoets/StabilityPointStructures/src/Ringtoets.StabilityPointStructures.Data/StabilityPointStructure.cs (.../StabilityPointStructure.cs) (revision e70c00d8db0fdded4e7ed647cfaa994923078d8e) @@ -148,151 +148,220 @@ /// Gets the storage area of the stability point structure. /// [m^2] /// - public VariationCoefficientLogNormalDistribution StorageStructureArea { get; private set; } + public VariationCoefficientLogNormalDistribution StorageStructureArea { get; } /// /// Gets the allowed increase of level for storage of the stability point structure. /// [m] /// - public LogNormalDistribution AllowedLevelIncreaseStorage { get; private set; } + public LogNormalDistribution AllowedLevelIncreaseStorage { get; } /// /// Gets the width of the flow apertures of the stability point structure. /// [m] /// - public NormalDistribution WidthFlowApertures { get; private set; } + public NormalDistribution WidthFlowApertures { get; } /// /// Gets the interior water level of the stability point structure. /// [m+NAP] /// - public NormalDistribution InsideWaterLevel { get; private set; } + public NormalDistribution InsideWaterLevel { get; } /// /// Gets the threshold height of the opened stability point structure. /// [m+NAP] /// - public NormalDistribution ThresholdHeightOpenWeir { get; private set; } + public NormalDistribution ThresholdHeightOpenWeir { get; } /// /// Gets the critical overtopping discharge per meter of the stability point structure. /// [m^3/s/m] /// - public VariationCoefficientLogNormalDistribution CriticalOvertoppingDischarge { get; private set; } + public VariationCoefficientLogNormalDistribution CriticalOvertoppingDischarge { get; } /// /// Gets the flow width of the stability point structure at the bottom protection. /// [m] /// - public LogNormalDistribution FlowWidthAtBottomProtection { get; private set; } + public LogNormalDistribution FlowWidthAtBottomProtection { get; } /// /// Gets the constructive strength of the linear load model of the stability point structure. /// [kN/m^2] /// - public VariationCoefficientLogNormalDistribution ConstructiveStrengthLinearLoadModel { get; private set; } + public VariationCoefficientLogNormalDistribution ConstructiveStrengthLinearLoadModel { get; } /// /// Gets the constructive strength of the quadratic load model of the stability point structure. /// [kN/m] /// - public VariationCoefficientLogNormalDistribution ConstructiveStrengthQuadraticLoadModel { get; private set; } + public VariationCoefficientLogNormalDistribution ConstructiveStrengthQuadraticLoadModel { get; } /// /// Gets the bank width of the stability point structure. /// [m] /// - public NormalDistribution BankWidth { get; private set; } + public NormalDistribution BankWidth { get; } /// /// Gets the inside water level failure construction of the stability point structure. /// [m+NAP] /// - public NormalDistribution InsideWaterLevelFailureConstruction { get; private set; } + public NormalDistribution InsideWaterLevelFailureConstruction { get; } /// /// Gets the evaluation level of the stability point structure. /// [m+NAP] /// - public RoundedDouble EvaluationLevel { get; private set; } + public RoundedDouble EvaluationLevel { get; } /// /// Gets the crest level of the stability point structure. /// [m+NAP] /// - public NormalDistribution LevelCrestStructure { get; private set; } + public NormalDistribution LevelCrestStructure { get; } /// /// Gets the vertical distance of the stability point structure. /// [m] /// - public RoundedDouble VerticalDistance { get; private set; } + public RoundedDouble VerticalDistance { get; } /// /// Gets the probability of failing to repair a failed closure of the stability point structure. /// [1/year] /// - public double FailureProbabilityRepairClosure { get; private set; } + public double FailureProbabilityRepairClosure { get; } /// /// Gets the failure collision energy of the stability point structure. /// [kN m] /// - public VariationCoefficientLogNormalDistribution FailureCollisionEnergy { get; private set; } + public VariationCoefficientLogNormalDistribution FailureCollisionEnergy { get; } /// /// Gets the mass of the ship. /// [ton] /// - public VariationCoefficientNormalDistribution ShipMass { get; private set; } + public VariationCoefficientNormalDistribution ShipMass { get; } /// /// Gets the velocity of the ship. /// [m/s] /// - public VariationCoefficientNormalDistribution ShipVelocity { get; private set; } + public VariationCoefficientNormalDistribution ShipVelocity { get; } /// /// Gets the levelling count. /// [1/year] /// - public int LevellingCount { get; private set; } + public int LevellingCount { get; } /// /// Gets the probability of a secondary collision on the structure per levelling. /// [1/year/levelling] /// - public double ProbabilityCollisionSecondaryStructure { get; private set; } + public double ProbabilityCollisionSecondaryStructure { get; } /// /// Gets the maximum flow velocity at which the structure is closable. /// [m/s] /// - public VariationCoefficientNormalDistribution FlowVelocityStructureClosable { get; private set; } + public VariationCoefficientNormalDistribution FlowVelocityStructureClosable { get; } /// /// Gets the stability properties of the linear load model of the stability point structure. /// [kN/m^2] /// - public VariationCoefficientLogNormalDistribution StabilityLinearLoadModel { get; private set; } + public VariationCoefficientLogNormalDistribution StabilityLinearLoadModel { get; } /// /// Gets the stability properties of the quadratic load model of the stability point structure. /// [kN/m] /// - public VariationCoefficientLogNormalDistribution StabilityQuadraticLoadModel { get; private set; } + public VariationCoefficientLogNormalDistribution StabilityQuadraticLoadModel { get; } /// /// Gets the area of the flow aperture of the stability point structure. /// [m^2] /// - public LogNormalDistribution AreaFlowApertures { get; private set; } + public LogNormalDistribution AreaFlowApertures { get; } /// /// Gets the type of stability point structure inflow model. /// - public StabilityPointStructureInflowModelType InflowModelType { get; private set; } + public StabilityPointStructureInflowModelType InflowModelType { get; } + public override bool Equals(object obj) + { + return base.Equals(obj) && Equals((StabilityPointStructure) obj); + } + + public override int GetHashCode() + { + unchecked + { + int hashCode = base.GetHashCode(); + hashCode = (hashCode * 397) ^ StorageStructureArea.GetHashCode(); + hashCode = (hashCode * 397) ^ AllowedLevelIncreaseStorage.GetHashCode(); + hashCode = (hashCode * 397) ^ WidthFlowApertures.GetHashCode(); + hashCode = (hashCode * 397) ^ InsideWaterLevel.GetHashCode(); + hashCode = (hashCode * 397) ^ ThresholdHeightOpenWeir.GetHashCode(); + hashCode = (hashCode * 397) ^ CriticalOvertoppingDischarge.GetHashCode(); + hashCode = (hashCode * 397) ^ FlowWidthAtBottomProtection.GetHashCode(); + hashCode = (hashCode * 397) ^ ConstructiveStrengthLinearLoadModel.GetHashCode(); + hashCode = (hashCode * 397) ^ ConstructiveStrengthQuadraticLoadModel.GetHashCode(); + hashCode = (hashCode * 397) ^ BankWidth.GetHashCode(); + hashCode = (hashCode * 397) ^ InsideWaterLevelFailureConstruction.GetHashCode(); + hashCode = (hashCode * 397) ^ EvaluationLevel.GetHashCode(); + hashCode = (hashCode * 397) ^ LevelCrestStructure.GetHashCode(); + hashCode = (hashCode * 397) ^ VerticalDistance.GetHashCode(); + hashCode = (hashCode * 397) ^ FailureProbabilityRepairClosure.GetHashCode(); + hashCode = (hashCode * 397) ^ FailureCollisionEnergy.GetHashCode(); + hashCode = (hashCode * 397) ^ ShipMass.GetHashCode(); + hashCode = (hashCode * 397) ^ ShipVelocity.GetHashCode(); + hashCode = (hashCode * 397) ^ LevellingCount.GetHashCode(); + hashCode = (hashCode * 397) ^ ProbabilityCollisionSecondaryStructure.GetHashCode(); + hashCode = (hashCode * 397) ^ FlowVelocityStructureClosable.GetHashCode(); + hashCode = (hashCode * 397) ^ StabilityLinearLoadModel.GetHashCode(); + hashCode = (hashCode * 397) ^ StabilityQuadraticLoadModel.GetHashCode(); + hashCode = (hashCode * 397) ^ AreaFlowApertures.GetHashCode(); + hashCode = (hashCode * 397) ^ InflowModelType.GetHashCode(); + + return hashCode; + } + } + + private bool Equals(StabilityPointStructure other) + { + return StorageStructureArea.Equals(other.StorageStructureArea) + && AllowedLevelIncreaseStorage.Equals(other.AllowedLevelIncreaseStorage) + && WidthFlowApertures.Equals(other.WidthFlowApertures) + && InsideWaterLevel.Equals(other.InsideWaterLevel) + && ThresholdHeightOpenWeir.Equals(other.ThresholdHeightOpenWeir) + && CriticalOvertoppingDischarge.Equals(other.CriticalOvertoppingDischarge) + && FlowWidthAtBottomProtection.Equals(other.FlowWidthAtBottomProtection) + && ConstructiveStrengthLinearLoadModel.Equals(other.ConstructiveStrengthLinearLoadModel) + && ConstructiveStrengthQuadraticLoadModel.Equals(other.ConstructiveStrengthQuadraticLoadModel) + && BankWidth.Equals(other.BankWidth) + && InsideWaterLevelFailureConstruction.Equals(other.InsideWaterLevelFailureConstruction) + && EvaluationLevel.Equals(other.EvaluationLevel) + && LevelCrestStructure.Equals(other.LevelCrestStructure) + && VerticalDistance.Equals(other.VerticalDistance) + && FailureProbabilityRepairClosure.Equals(other.FailureProbabilityRepairClosure) + && FailureCollisionEnergy.Equals(other.FailureCollisionEnergy) + && ShipMass.Equals(other.ShipMass) + && ShipVelocity.Equals(other.ShipVelocity) + && LevellingCount.Equals(other.LevellingCount) + && ProbabilityCollisionSecondaryStructure.Equals(other.ProbabilityCollisionSecondaryStructure) + && FlowVelocityStructureClosable.Equals(other.FlowVelocityStructureClosable) + && StabilityLinearLoadModel.Equals(other.StabilityLinearLoadModel) + && StabilityQuadraticLoadModel.Equals(other.StabilityQuadraticLoadModel) + && AreaFlowApertures.Equals(other.AreaFlowApertures) + && InflowModelType.Equals(other.InflowModelType); + } + /// /// Class holding the various construction parameters for . /// Index: Ringtoets/StabilityPointStructures/test/Ringtoets.StabilityPointStructures.Data.TestUtil.Test/StabilityPointStructurePermutationHelperTest.cs =================================================================== diff -u -rad440d0e14ea249a0ae198e634ab6aa5d72a3977 -re70c00d8db0fdded4e7ed647cfaa994923078d8e --- Ringtoets/StabilityPointStructures/test/Ringtoets.StabilityPointStructures.Data.TestUtil.Test/StabilityPointStructurePermutationHelperTest.cs (.../StabilityPointStructurePermutationHelperTest.cs) (revision ad440d0e14ea249a0ae198e634ab6aa5d72a3977) +++ Ringtoets/StabilityPointStructures/test/Ringtoets.StabilityPointStructures.Data.TestUtil.Test/StabilityPointStructurePermutationHelperTest.cs (.../StabilityPointStructurePermutationHelperTest.cs) (revision e70c00d8db0fdded4e7ed647cfaa994923078d8e) @@ -79,7 +79,7 @@ differentStructures.Add(structures.Single(s => !s.StabilityQuadraticLoadModel.Equals(referenceStructure.StabilityQuadraticLoadModel))); differentStructures.Add(structures.Single(s => !s.AreaFlowApertures.Equals(referenceStructure.AreaFlowApertures))); differentStructures.Add(structures.Single(s => !s.InflowModelType.Equals(referenceStructure.InflowModelType))); - Assert.AreEqual(27, differentStructures.Count); + Assert.AreEqual(27, differentStructures.Distinct().Count()); } [Test] @@ -133,7 +133,7 @@ differentStructures.Add(structures.Single(s => !s.StabilityQuadraticLoadModel.Equals(referenceStructure.StabilityQuadraticLoadModel))); differentStructures.Add(structures.Single(s => !s.AreaFlowApertures.Equals(referenceStructure.AreaFlowApertures))); differentStructures.Add(structures.Single(s => !s.InflowModelType.Equals(referenceStructure.InflowModelType))); - Assert.AreEqual(25, differentStructures.Count); + Assert.AreEqual(25, differentStructures.Distinct().Count()); } } } \ No newline at end of file