using System;

namespace Toolbox.Docking.Api.Objects.Qsar
{
    /// <summary>
    /// Basic statistics for the QSAR model used for display reasons.
    /// </summary>
    [Serializable]
    public sealed class TbQsarStatistics
    {
        /// <summary>
        /// The constructor
        /// </summary>
        /// <param name="trainingSetCount">The number of chemicals used for the training set. If null the number is unknown.</param>
        /// <param name="trainingSetDataCount">The number of data of the training set. If null the number is unknown.</param>
        /// <param name="testSetCount">The number of chemicals used for the test set. If null the number is unknown.</param>
        /// <param name="testSetDataCount">The number of data of the test set. If null the number is unknown.</param>
        public TbQsarStatistics(int? trainingSetCount, int? trainingSetDataCount, int? testSetCount, int? testSetDataCount)
            : this(trainingSetCount, null, trainingSetDataCount, testSetCount, null, testSetDataCount)
        {
            if (TrainingSetCount != null)
                ProprietaryTrainingSetCount = 0;
            if (TestSetCount != null)
                ProprietaryTestSetCount = 0;
        }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="trainingSetCount">The number of chemicals used for the training set. If null the number is unknown.</param>
        /// <param name="proprietaryTrainingSetCount">The number of proprietary chemicals in the training set. If null the number is unknown.</param>
        /// <param name="trainingSetDataCount">The number of data of the training set. If null the number is unknown.</param>
        /// <param name="testSetCount">The number of chemicals used for the test set. If null the number is unknown.</param>
        /// <param name="proprietaryTestSetCount">The number of proprietary chemicals in the test set. If null the number is unknown.</param>
        /// <param name="testSetDataCount">The number of data of the test set. If null the number is unknown.</param>
        public TbQsarStatistics(int? trainingSetCount, int? proprietaryTrainingSetCount, int? trainingSetDataCount, int? testSetCount, int? proprietaryTestSetCount, int? testSetDataCount)
        {
            TrainingSetCount = trainingSetCount;
            ProprietaryTrainingSetCount = proprietaryTrainingSetCount;
            TrainingSetDataCount = trainingSetDataCount;
            TestSetCount = testSetCount;
            ProprietaryTestSetCount = proprietaryTestSetCount;
            TestSetDataCount = testSetDataCount;
        }

        /// <summary>
        /// The number of chemicals used for the training set. If null the number is unknown.
        /// </summary>
        public int? TrainingSetCount { get; }
        /// <summary>
        /// The number of proprietary chemicals in the training set. If null the number is unknown.
        /// </summary>
        public int? ProprietaryTrainingSetCount { get; }
        /// <summary>
        /// The number of data of the training set. If null the number is unknown.
        /// </summary>
        public int? TrainingSetDataCount { get; }
        /// <summary>
        /// The number of chemicals used for the test set. If null the number is unknown.
        /// </summary>
        public int? TestSetCount { get; }
        /// <summary>
        /// The number of proprietary chemicals in the test set. If null the number is unknown.
        /// </summary>
        public int? ProprietaryTestSetCount { get; }
        /// <summary>
        /// The number of data of the test set. If null the number is unknown.
        /// </summary>
        public int? TestSetDataCount { get; }
    }
}