Esempio n. 1
0
        public void CalcularMOMMCCoyAproximadoNoTerceiroMomentoTeste()
        {
            double passoDeTempo = 0.01;
            int numeroDePassosDeTempo = 1100;
            double t0 = 0.0;
            const int numeroDePontos = 4;
            const double limiteMinimo = 125.0;
            double limiteMaximo = double.MaxValue;

            Integral.Funcao funcaoInicial = FuncaoMcCoy;

            MoM.TermoFonteMoM termoFonteMoM = MOMMcCoyTruncadoNoTerceiroMomento;
            MoM mom = new MoM(numeroDePassosDeTempo, passoDeTempo, t0, numeroDePontos, funcaoInicial,
                limiteMinimo, limiteMaximo, termoFonteMoM);
            mom.FuncaoAtual = FuncaoAtual;
            mom.NumeroMaximoDePontos = 10;

            List<double[]> momentos = mom.CalcularMomentos();

            //Loop do cálculo da concentração a partir dos momentos

            double[] alfa = new double[numeroDePassosDeTempo];
            double[] beta = new double[numeroDePassosDeTempo];
            List<double[]> concentracao = new List<double[]>();

            for (int t = 0; t < numeroDePassosDeTempo; t++)
            {
                CalcularAlfaEBeta(momentos[t], out alfa[t], out beta[t]);
                concentracao.Add(CalcularConcentracao(alfa[t], beta[t]));
            }

            CriarScripParaMatlabMomentos(@"MoMMcCoy\TruncadoTerceiroMomento\momentosMcCoy3", mom.Passos, momentos);
            CriarScripParaMatlabConcentracao(@"MoMMcCoy\TruncadoTerceiroMomento\concentracaoMcCoy3", mom.Passos, concentracao);
            CriarScripParaMatlabAlfaBeta(@"MoMMcCoy\TruncadoTerceiroMomento\alfa3Momento", mom.Passos, alfa);
            CriarScripParaMatlabAlfaBeta(@"MoMMcCoy\TruncadoTerceiroMomento\beta3Momento", mom.Passos, beta);
        }
Esempio n. 2
0
        public MoMs MeetingSummary(Int64 Id)
        {
            MoMs           objMoM = new MoMs();
            MOMDataManager objDM  = new MOMDataManager();
            DataSet        ds     = objDM.MeetingSummary(Id);

            if (ds != null && ds.Tables[0].Rows.Count > 0)
            {
                int tblIndex = -1;

                #region "Total Of MOM Notification"
                tblIndex++;
                if (ds.Tables.Count > tblIndex && ds.Tables[tblIndex].Rows.Count > 0)
                {
                    List <MoM> MOMNotification = new List <MoM>();
                    foreach (DataRow dr in ds.Tables[tblIndex].Rows)
                    {
                        MoM objMOMList = new MoM();
                        objMOMList.MeetingDate          = Convert.ToString(dr["MeetingDate"]);
                        objMOMList.SPSNotificationCount = Convert.ToInt32(dr["SPSNotification"]);
                        objMOMList.TBTNotificationCount = Convert.ToInt32(dr["TBTNotification"]);
                        objMOMList.Observation          = Convert.ToString(dr["Observation"]);
                        MOMNotification.Add(objMOMList);
                    }
                    objMoM.MoMList = MOMNotification;
                }
                #endregion

                #region "TBT Notification"
                tblIndex++;
                if (ds.Tables.Count > tblIndex && ds.Tables[tblIndex].Rows.Count > 0)
                {
                    List <Notification_Mom> MOMNotificationList = new List <Notification_Mom>();
                    foreach (DataRow dr in ds.Tables[tblIndex].Rows)
                    {
                        Notification_Mom objList = new Notification_Mom();
                        objList.NotificationId     = Convert.ToInt64(dr["NotificationId"]);
                        objList.NotificationNumber = Convert.ToString(dr["NotificationNumber"]);
                        objList.DateOfNotification = Convert.ToString(dr["DateOfNotification"]);
                        objList.Country            = Convert.ToString(dr["Country"]);
                        objList.Description        = Convert.ToString(dr["Description"]);
                        objList.Action             = Convert.ToString(dr["Action"]);
                        MOMNotificationList.Add(objList);
                    }
                    objMoM.TBTNotificationList = MOMNotificationList;
                }
                #endregion

                #region "SPS Notification"
                tblIndex++;
                if (ds.Tables.Count > tblIndex && ds.Tables[tblIndex].Rows.Count > 0)
                {
                    List <Notification_Mom> MOMNotificationList = new List <Notification_Mom>();
                    foreach (DataRow dr in ds.Tables[tblIndex].Rows)
                    {
                        Notification_Mom objList = new Notification_Mom();
                        objList.NotificationId     = Convert.ToInt64(dr["NotificationId"]);
                        objList.NotificationNumber = Convert.ToString(dr["NotificationNumber"]);
                        objList.DateOfNotification = Convert.ToString(dr["DateOfNotification"]);
                        objList.Country            = Convert.ToString(dr["Country"]);
                        objList.Description        = Convert.ToString(dr["Description"]);
                        objList.Action             = Convert.ToString(dr["Action"]);
                        MOMNotificationList.Add(objList);
                    }
                    objMoM.SPSNotificationList = MOMNotificationList;
                }
                #endregion
                #region "Regulatory Notification"
                tblIndex++;
                if (ds.Tables.Count > tblIndex && ds.Tables[tblIndex].Rows.Count > 0)
                {
                    List <Notification_Mom> MOMNotificationList = new List <Notification_Mom>();
                    foreach (DataRow dr in ds.Tables[tblIndex].Rows)
                    {
                        Notification_Mom objList = new Notification_Mom();
                        objList.ItemNumber         = Convert.ToInt32(dr["RowNumber"]);
                        objList.NotificationId     = Convert.ToInt64(dr["NotificationId"]);
                        objList.NotificationNumber = Convert.ToString(dr["NotificationNumber"]);
                        objList.Country            = Convert.ToString(dr["Country"]);
                        objList.Description        = Convert.ToString(dr["Description"]);
                        objList.Regulatory         = Convert.ToString(dr["Regulators"]).Replace("|", ", ");
                        MOMNotificationList.Add(objList);
                    }
                    objMoM.RegulatoryNotificationList = MOMNotificationList;
                }
                #endregion
                #region "Regulatory Notification"
                tblIndex++;
                if (ds.Tables.Count > tblIndex && ds.Tables[tblIndex].Rows.Count > 0)
                {
                    List <Notification_Mom> MOMNotificationList = new List <Notification_Mom>();
                    foreach (DataRow dr in ds.Tables[tblIndex].Rows)
                    {
                        Notification_Mom objList = new Notification_Mom();
                        objList.ItemNumber         = Convert.ToInt32(dr["RowNumber"]);
                        objList.NotificationId     = Convert.ToInt64(dr["NotificationId"]);
                        objList.NotificationNumber = Convert.ToString(dr["NotificationNumber"]);
                        objList.Country            = Convert.ToString(dr["Country"]);
                        objList.Description        = Convert.ToString(dr["Description"]);
                        MOMNotificationList.Add(objList);
                    }
                    objMoM.PolicyNotificationList = MOMNotificationList;
                }
                #endregion
            }

            return(objMoM);
        }
Esempio n. 3
0
        public MoMs GetMOMListData()
        {
            MoMs           objMoM = new MoMs();
            MOMDataManager objDM  = new MOMDataManager();
            DataSet        ds     = objDM.GetMOMListData();

            if (ds != null && ds.Tables[0].Rows.Count > 0)
            {
                int tblIndex = -1;

                #region "Master Actions List"
                tblIndex++;
                if (ds.Tables.Count > tblIndex && ds.Tables[tblIndex].Rows.Count > 0)
                {
                    List <BusinessObjects.MOM.Action> ActionList = new List <BusinessObjects.MOM.Action>();
                    foreach (DataRow dr in ds.Tables[tblIndex].Rows)
                    {
                        BusinessObjects.MOM.Action objAction = new BusinessObjects.MOM.Action();
                        objAction.ActionId   = Convert.ToInt32(dr["ActionId"]);
                        objAction.ActionName = Convert.ToString(dr["Action"]);
                        ActionList.Add(objAction);
                    }
                    objMoM.Actions = ActionList;
                }
                #endregion

                #region "MoMs Notification List"
                tblIndex++;
                if (ds.Tables.Count > tblIndex)
                {
                    List <MoM> NotificationList = new List <MoM>();
                    int        i = 1;
                    string     hdnRelatedStakeHolder = string.Empty;
                    foreach (DataRow dr in ds.Tables[tblIndex].Rows)
                    {
                        MoM objNotification = new MoM();
                        objNotification.ItemNumber        = i;
                        objNotification.MoMId             = Convert.ToInt64(dr["MomId"]);
                        objNotification.NotificationCount = Convert.ToInt32(dr["NotificationCount"]);
                        objNotification.PendingCount      = Convert.ToInt32(dr["PendingCount"]);
                        objNotification.MeetingDate       = Convert.ToString(dr["MeetingDate"]);
                        objNotification.IsActive          = Convert.ToBoolean(dr["IsActive"]);
                        i++;
                        NotificationList.Add(objNotification);
                    }
                    objMoM.MoMList = NotificationList;
                }
                #endregion

                #region "Notification Actions List"
                tblIndex++;
                if (ds.Tables.Count > tblIndex && ds.Tables[tblIndex].Rows.Count > 0)
                {
                    List <MoMAction> MoMActionList = new List <MoMAction>();
                    foreach (DataRow dr in ds.Tables[tblIndex].Rows)
                    {
                        MoMAction objAction = new MoMAction();
                        objAction.MoMId        = Convert.ToInt64(dr["MomId"]);
                        objAction.ActionId     = Convert.ToInt32(dr["ActionId"]);
                        objAction.PendingCount = Convert.ToInt64(dr["PendingCount"]);
                        objAction.TotalCount   = Convert.ToInt64(dr["TotalCount"]);
                        MoMActionList.Add(objAction);
                    }
                    objMoM.MoMActionList = MoMActionList;
                }
                #endregion
            }

            return(objMoM);
        }