예제 #1
0
        /// <summary>
        /// Creates a new instance of <see cref="SerializableTotalAssemblyResult"/>.
        /// </summary>
        /// <param name="id">The unique assembly ID.</param>
        /// <param name="assessmentProcess">The assessment process this result belongs to.</param>
        /// <param name="probabilityAssemblyMethod">The method used to assemble the probability of this result.</param>
        /// <param name="assemblyGroupAssemblyMethod">The method used to assemble the assembly group of this result.</param>
        /// <param name="assemblyGroup">The group of this assembly result.</param>
        /// <param name="probability">The probability of this assembly result.</param>
        /// <exception cref="ArgumentNullException">Thrown when <paramref name="assessmentProcess"/> is <c>null</c>.</exception>
        /// <exception cref="ArgumentException">Thrown when <paramref name="id"/> is invalid.</exception>
        public SerializableTotalAssemblyResult(string id,
                                               SerializableAssessmentProcess assessmentProcess,
                                               SerializableAssemblyMethod probabilityAssemblyMethod,
                                               SerializableAssemblyMethod assemblyGroupAssemblyMethod,
                                               SerializableAssessmentSectionAssemblyGroup assemblyGroup,
                                               double probability) : this()
        {
            SerializableIdValidator.ThrowIfInvalid(id);

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

            Id = id;
            AssessmentProcessId         = assessmentProcess.Id;
            ProbabilityAssemblyMethod   = probabilityAssemblyMethod;
            AssemblyGroupAssemblyMethod = assemblyGroupAssemblyMethod;
            AssemblyGroup = assemblyGroup;
            Probability   = probability;
        }
예제 #2
0
        /// <summary>
        /// Creates a new instance of <see cref="SerializableAssembly"/>.
        /// </summary>
        /// <param name="id">The unique assembly ID.</param>
        /// <param name="lowerCorner">The lower corner of the assembly map boundary.</param>
        /// <param name="upperCorner">The upper corner of the assembly map boundary.</param>
        /// <param name="assessmentSection">The <see cref="SerializableAssessmentSection"/> that belongs to the assembly.</param>
        /// <param name="assessmentProcess">The <see cref="SerializableAssessmentProcess"/> that belongs to the assembly.</param>
        /// <param name="totalAssemblyResult">The <see cref="SerializableTotalAssemblyResult"/> that belongs to the assembly.</param>
        /// <param name="failureMechanisms">The collection of <see cref="SerializableFailureMechanism"/> that
        /// belong to the assembly.</param>
        /// <param name="failureMechanismSectionAssemblies">The collection of <see cref="SerializableFailureMechanismSectionAssembly"/> that
        /// belong to the assembly.</param>
        /// <param name="combinedFailureMechanismSectionAssemblies">The collection of <see cref="SerializableCombinedFailureMechanismSectionAssembly"/> that
        /// belong to the assembly.</param>
        /// <param name="failureMechanismSectionCollections">The collection of <see cref="SerializableFailureMechanismSectionCollection"/> that
        /// belong to the assembly.</param>
        /// <param name="failureMechanismSections">The collection of <see cref="SerializableFailureMechanismSection"/> that
        /// belong to the assembly.</param>
        /// <exception cref="ArgumentNullException">Thrown when any parameter except <paramref name="id"/> is <c>null</c>.</exception>
        /// <exception cref="ArgumentException">Thrown when <paramref name="id"/> is invalid.</exception>
        public SerializableAssembly(string id,
                                    Point2D lowerCorner,
                                    Point2D upperCorner,
                                    SerializableAssessmentSection assessmentSection,
                                    SerializableAssessmentProcess assessmentProcess,
                                    SerializableTotalAssemblyResult totalAssemblyResult,
                                    IEnumerable <SerializableFailureMechanism> failureMechanisms,
                                    IEnumerable <SerializableFailureMechanismSectionAssembly> failureMechanismSectionAssemblies,
                                    IEnumerable <SerializableCombinedFailureMechanismSectionAssembly> combinedFailureMechanismSectionAssemblies,
                                    IEnumerable <SerializableFailureMechanismSectionCollection> failureMechanismSectionCollections,
                                    IEnumerable <SerializableFailureMechanismSection> failureMechanismSections)
        {
            SerializableIdValidator.ThrowIfInvalid(id);

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

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

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

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

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

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

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

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

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

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

            Id       = id;
            Boundary = new SerializableBoundary(lowerCorner, upperCorner);

            var featureMembers = new List <SerializableFeatureMember>
            {
                assessmentSection,
                assessmentProcess,
                totalAssemblyResult
            };

            featureMembers.AddRange(failureMechanisms);
            featureMembers.AddRange(failureMechanismSectionAssemblies);
            featureMembers.AddRange(combinedFailureMechanismSectionAssemblies);
            featureMembers.AddRange(failureMechanismSectionCollections);
            featureMembers.AddRange(failureMechanismSections);
            FeatureMembers = featureMembers.ToArray();
        }