Index: dam engine/trunk/src/Deltares.DamEngine.Data/General/Segment.cs =================================================================== diff -u -r452 -r537 --- dam engine/trunk/src/Deltares.DamEngine.Data/General/Segment.cs (.../Segment.cs) (revision 452) +++ dam engine/trunk/src/Deltares.DamEngine.Data/General/Segment.cs (.../Segment.cs) (revision 537) @@ -28,15 +28,62 @@ namespace Deltares.DamEngine.Data.General { + /// + /// Class holding the soilprofile (either 1D or 2D) and its probability + /// + /// public class SoilGeometryProbability : IComparable { + /// + /// Gets or sets the soil profile. + /// + /// + /// The soil profile. + /// public virtual SoilProfile1D SoilProfile { get; set; } + + /// + /// Gets or sets the name of the soilgeometry2d. + /// + /// + /// The name of the soilgeometry2d. + /// + public virtual string SoilGeometry2DName { get; set; } + + /// + /// Gets or sets the name of the soilgeometry1d. + /// + /// + /// The name of the soilgeometry1d. + /// + public virtual string SoilGeometry1DName { get; set; } + + /// + /// Gets or sets the soilprofile2d. + /// + /// + /// The soilprofile2d. + /// public virtual SoilProfile2D SoilProfile2D { get; set; } + + /// + /// Gets or sets the type of the segment failure mechanism. + /// + /// + /// The type of the segment failure mechanism. + /// public virtual FailureMechanismSystemType? SegmentFailureMechanismType { get; set; } - public virtual double Probability { get; set; } // Probability of occurance; number between 0.0 and 100.0 /// + /// Gets or sets the probability of occurance; number between 0.0 and 100.0. + /// + /// + /// The probability. + /// + public virtual double Probability { get; set; } + + /// /// Assigns the specified soil geometry probability. /// /// The soil geometry probability. @@ -52,6 +99,13 @@ SoilGeometry2DName = soilGeometryProbability.SoilGeometry2DName; } + /// + /// Gets the type of the soil geometry. + /// + /// + /// The type of the soil geometry. + /// + /// No soilprofile assigned public SoilGeometryType SoilGeometryType { get @@ -90,16 +144,32 @@ } } + /// + /// Compares the current instance with another object of the same type and returns an integer that indicates whether the current instance precedes, follows, or occurs in the same position in the sort order as the other object. + /// + /// An object to compare with this instance. + /// + /// A value that indicates the relative order of the objects being compared. The return value has these meanings: Value Meaning Less than zero This instance precedes in the sort order. Zero This instance occurs in the same position in the sort order as . Greater than zero This instance follows in the sort order. + /// public int CompareTo(SoilGeometryProbability other) { return - this.Probability.CompareTo(other.Probability); } } + /// + /// Class holding all soilprofiles (1D/2D) and their probabilities as segment. + /// public class Segment { private List soilGeometryProbabilities = new List(); + /// + /// Gets or sets the name. + /// + /// + /// The name. + /// public virtual string Name { get; set; } /// @@ -110,6 +180,11 @@ get { return this.soilGeometryProbabilities; } } + /// + /// Gets the most probable profile1D. + /// + /// Type of the segment failure mechanism. + /// public SoilProfile1D GetMostProbableProfile(FailureMechanismSystemType? segmentFailureMechanismType) { IEnumerable spps = from SoilGeometryProbability spp in this.soilGeometryProbabilities @@ -122,6 +197,11 @@ return null; } + /// + /// Gets the name of the most probable geometry2dname (name of profile2D). + /// + /// Type of the segment failure mechanism. + /// public string GetMostProbableGeometry2DName(FailureMechanismSystemType? segmentFailureMechanismType) { IEnumerable spps = from SoilGeometryProbability spp in this.soilGeometryProbabilities @@ -134,12 +214,24 @@ return null; } + /// + /// Adds the soilprofile1D probability. + /// + /// The soil profile. + /// The probability. + /// Type of the segment failure mechanism. public void AddSoilProfileProbability(SoilProfile1D soilProfile, double probability, FailureMechanismSystemType? segmentFailureMechanismType) { if (this.soilGeometryProbabilities.Where(x => x.SoilProfile == soilProfile && x.SegmentFailureMechanismType == segmentFailureMechanismType).Count() == 0) this.soilGeometryProbabilities.Add(new SoilGeometryProbability() { SoilProfile = soilProfile, Probability = probability, SegmentFailureMechanismType = segmentFailureMechanismType, SoilGeometry2DName = null }); } + /// + /// Gets the soilprofile1D probability. + /// + /// The soil profile. + /// Type of the segment failure mechanism. + /// public double? GetSoilProfileProbability(SoilProfile1D soilProfile, FailureMechanismSystemType? segmentFailureMechanismType) { IEnumerable probs = this.soilGeometryProbabilities.Where( @@ -152,12 +244,24 @@ return null; } + /// + /// Adds the soilgeometry2d probability. + /// + /// Name of the soilgeometry2d (= profile2D). + /// The probability. + /// Type of the segment failure mechanism. public void AddSoilGeometry2DProbability(string soilGeometry2DName, double probability, FailureMechanismSystemType? segmentFailureMechanismType) { if (this.soilGeometryProbabilities.Where(x => x.SoilGeometry2DName == soilGeometry2DName && x.SegmentFailureMechanismType == segmentFailureMechanismType).Count() == 0) this.soilGeometryProbabilities.Add(new SoilGeometryProbability() { SoilProfile = null, Probability = probability, SegmentFailureMechanismType = segmentFailureMechanismType, SoilGeometry2DName = soilGeometry2DName }); } + /// + /// Gets the soilgeometry2d probability. + /// + /// Name of the soilgeometry2d (=profile2D). + /// Type of the segment failure mechanism. + /// public double? GetSoilGeometry2DProbability(string soilGeometry2DName, FailureMechanismSystemType? segmentFailureMechanismType) { IEnumerable probs = this.soilGeometryProbabilities.Where( @@ -170,6 +274,12 @@ return null; } + /// + /// Returns a that represents this instance. + /// + /// + /// A that represents this instance. + /// public override string ToString() { StringBuilder sb = new StringBuilder(); @@ -198,6 +308,8 @@ /// /// Assemble a list of key/value pairs with the relevant parameters for the specified 1d-profile /// + /// The soil profile1 d identifier. + /// Type of the failure mechanism system. /// public Dictionary GetParametersForSoilProfile1DAsNameValuePairs(string soilProfile1DId, FailureMechanismSystemType failureMechanismSystemType) {