Example #1
0
        public override void Run(OutputManager outs)
        {
            Init();

            // 월간 루프
            for (p.ProjMth = 1; p.ProjMth <= p.ProjPeriod; p.ProjMth++)
            {
                SetInitValues();
                SetPremAndLoadings();
                SetGmxbFee();
                SetBonus();
                SetFundReturn();
                DoRebalancing();
                SetDecrement();
                SetClaim();
                SetResult(outs);
            }

            if (printsThisProjection)
            {
                Tools.LibFile.WriteFile(@"D:\testAnn.csv", MthlyVars, '\t');
            }
        }
Example #2
0
        /// <summary>
        /// 런실행
        /// </summary>
        /// <param name="id">아이디(사망률_해지율_금리커브_계약번호)</param>
        public void Execute(string id, List <Policy> pols)
        {
            // date4 gets 4/9/1996 5:55:00 PM.
            DateTime DateStart = DateTime.Now;

            // 100번 배치, 총 "BatchCnt * ScenCntByBatch" 번의 시나리오
            for (int batchSeq = 1; batchSeq <= RSettings.ScenBatchCnt; batchSeq++)
            {
                //int scenStartSeq = (batchSeq - 1) * RSettings.ScenCntOneBatch + 1;
                SM.SetScenDataFromFile(RSettings.ScenCntOneBatch);

                var outs = new OutputManager(RSettings, DbParams, pols.Select(x => x.Rec.ContNo).ToList(), 1);

                // 시나리오 루프
                for (int scenNo = 1; scenNo <= RSettings.ScenCntOneBatch; scenNo++)
                {
                    SM.SetCurrentScen(scenNo);

                    // 보유계약 루프
                    foreach (var pol in pols)
                    {
                        ModelBase md = ModelBase.GetSelectedModel(RSettings, pol, SM);
                        md.Run(outs);
                    }

                    if (scenNo % 10 == 0)
                    {
                        DateTime DateAft = DateTime.Now;
                        TimeSpan span    = DateAft - DateStart;
                        Console.WriteLine($@"finish {scenNo} Scen of Inf {pols.First().Rec.ContNo} ~ {pols.Last().Rec.ContNo} : Duration {span}");
                    }
                }

                int minPolNo = pols.Select(x => x.Rec.ContNo).Min();
                outs.InsertToDB(RSettings.ResultLabel, minPolNo * batchSeq);
            }
        }
Example #3
0
 public virtual void Run(OutputManager outs)
 {
 }