// GET: DoptimizeExperiment
        //D优化法实验
        public ActionResult DoptimizeExperiment(int dop_id)
        {
            DoptimizeExperimentModel  doptimizeExperimentModel = new DoptimizeExperimentModel();
            DoptimizeExperimentTable  det      = dbDrive.GetDoptimizeExperimentTable(dop_id);
            List <DoptimizeDataTable> ddt_list = dbDrive.GetDoptimizeDataTables(dop_id);

            doptimizeExperimentModel.doptimizeNameSeting = DoptimizePublic.DistributionState(det);
            doptimizeExperimentModel.sq  = ddt_list[ddt_list.Count - 1].ddt_StimulusQuantity;
            doptimizeExperimentModel.det = det;
            return(View(doptimizeExperimentModel));
        }
        public static List <Doptimization_list> Doptimization_list(IDbDrive dbDrive, List <DoptimizeExperimentTable> det_list, int first)
        {
            List <Doptimization_list> doptimization_Lists = new List <Doptimization_list>();

            for (int i = det_list.Count - 1; i >= 0; i--)
            {
                var doptimization_List = GetDoptimization(det_list[i]);
                doptimization_List.number = i + 1 + first;
                doptimization_List.count  = dbDrive.GetDoptimizeDataTables(det_list[i].det_Id).Count - 1;
                doptimization_Lists.Add(doptimization_List);
            }
            return(doptimization_Lists);
        }
        public static List <Doptimization_list> Doptimization_list(IDbDrive dbDrive, List <DoptimizeExperimentTable> det_list)
        {
            List <Doptimization_list> doptimization_Lists = new List <Doptimization_list>();

            for (int i = 0; i < det_list.Count; i++)
            {
                var doptimization_List = GetDoptimization(det_list[i]);
                doptimization_List.number = i + 1;
                doptimization_List.count  = dbDrive.GetDoptimizeDataTables(det_list[i].det_Id).Count - 1;
                doptimization_Lists.Add(doptimization_List);
            }
            doptimization_Lists.Reverse();
            return(doptimization_Lists);
        }
        public static DoptimizeDataTable DoptimizeDataTable(int det_Id, IDbDrive dbDrive, double sq, OutputParameters outputParameters)
        {
            DoptimizeDataTable doptimizeDataTable = new DoptimizeDataTable();

            doptimizeDataTable.ddt_ExperimentTableId = det_Id;
            doptimizeDataTable.ddt_StimulusQuantity  = double.Parse(sq.ToString("f6"));
            doptimizeDataTable.ddt_Number            = dbDrive.GetDoptimizeDataTables(det_Id).Count + 1;
            doptimizeDataTable.ddt_Response          = 0;
            doptimizeDataTable.ddt_Mean = 0;
            doptimizeDataTable.ddt_StandardDeviation         = 0;
            doptimizeDataTable.ddt_SigmaGuess                = outputParameters.sigmaguess;
            doptimizeDataTable.ddt_StandardDeviationVariance = 0;
            doptimizeDataTable.ddt_MeanVariance              = 0;
            doptimizeDataTable.ddt_Covmusigma                = 0;
            doptimizeDataTable.ddt_Note1 = "";
            return(doptimizeDataTable);
        }