コード例 #1
0
        /// <summary>
        /// Creates a new instance of <see cref="GeneralResult{T}"/>
        /// </summary>
        /// <param name="governingWindDirection">The governing wind direction.</param>
        /// <param name="stochasts">The general alpha values.</param>
        /// <param name="topLevelIllustrationPoints">A collection of illustration points
        /// for every combination of wind directions and closing situations.</param>
        /// <exception cref="ArgumentNullException">Thrown when any of the input
        /// parameters is <c>null</c>.</exception>
        /// <exception cref="ArgumentException">Thrown when:
        /// <list type="bullet">
        /// <item>the stochasts in child nodes are not equal to the general result's stochasts;</item>
        /// <item>the general result's stochasts contains duplicates;</item>
        /// <item>the top level illustration points have a duplicate
        /// combination of closing situation and wind direction.</item>
        /// </list>
        /// </exception>
        public GeneralResult(WindDirection governingWindDirection,
                             IEnumerable <Stochast> stochasts,
                             IEnumerable <T> topLevelIllustrationPoints)
        {
            if (governingWindDirection == null)
            {
                throw new ArgumentNullException(nameof(governingWindDirection));
            }

            if (stochasts == null)
            {
                throw new ArgumentNullException(nameof(stochasts));
            }

            if (topLevelIllustrationPoints == null)
            {
                throw new ArgumentNullException(nameof(topLevelIllustrationPoints));
            }

            StochastValidator.ValidateStochasts(stochasts);
            ValidateTopLevelIllustrationPoints(topLevelIllustrationPoints);
            ValidateStochastInChildren(topLevelIllustrationPoints, stochasts);

            GoverningWindDirection = governingWindDirection;
            Stochasts = stochasts;
            TopLevelIllustrationPoints = topLevelIllustrationPoints;
        }
コード例 #2
0
        public virtual object Clone()
        {
            var clone = (TopLevelIllustrationPointBase)MemberwiseClone();

            clone.WindDirection = (WindDirection)WindDirection.Clone();

            return(clone);
        }
コード例 #3
0
        /// <summary>
        /// Creates a new instance of <see cref="TopLevelFaultTreeIllustrationPoint"/>.
        /// </summary>
        /// <param name="windDirection">The wind direction.</param>
        /// <param name="closingSituation">The closing situation.</param>
        /// <param name="faultTreeNodeRoot">The illustration point root node.</param>
        /// <exception cref="ArgumentNullException">Thrown when any input parameter
        /// is <c>null</c>.</exception>
        public TopLevelFaultTreeIllustrationPoint(WindDirection windDirection,
                                                  string closingSituation,
                                                  IllustrationPointNode faultTreeNodeRoot)
            : base(windDirection, closingSituation)
        {
            if (faultTreeNodeRoot == null)
            {
                throw new ArgumentNullException(nameof(faultTreeNodeRoot));
            }

            FaultTreeNodeRoot = faultTreeNodeRoot;
        }
コード例 #4
0
        /// <summary>
        /// Creates a new instance of <see cref="TopLevelSubMechanismIllustrationPoint"/>.
        /// </summary>
        /// <param name="windDirection">The wind direction.</param>
        /// <param name="closingSituation">The closing situation.</param>
        /// <param name="subMechanismIllustrationPoint">The illustration point.</param>
        /// <exception cref="ArgumentNullException">Thrown when any input parameter is <c>null</c>.</exception>
        public TopLevelSubMechanismIllustrationPoint(WindDirection windDirection,
                                                     string closingSituation,
                                                     SubMechanismIllustrationPoint subMechanismIllustrationPoint)
            : base(windDirection, closingSituation)
        {
            if (subMechanismIllustrationPoint == null)
            {
                throw new ArgumentNullException(nameof(subMechanismIllustrationPoint));
            }

            SubMechanismIllustrationPoint = subMechanismIllustrationPoint;
        }
コード例 #5
0
        /// <summary>
        /// Creates a new instance of <see cref="TopLevelIllustrationPointBase"/>.
        /// </summary>
        /// <param name="windDirection">The wind direction.</param>
        /// <param name="closingSituation">The closing situation.</param>
        /// <exception cref="ArgumentNullException">Thrown when any of the parameters
        /// is <c>null</c>.</exception>
        protected TopLevelIllustrationPointBase(WindDirection windDirection, string closingSituation)
        {
            if (windDirection == null)
            {
                throw new ArgumentNullException(nameof(windDirection));
            }

            if (closingSituation == null)
            {
                throw new ArgumentNullException(nameof(closingSituation));
            }

            WindDirection    = windDirection;
            ClosingSituation = closingSituation;
        }