Ejemplo n.º 1
0
        private static void TestRITEMap(PartitionData pd, long conID)
        {
            //Default SubSampling Settings
            SubSamplingAnalysisSetting subSamplingSettings = new SubSamplingAnalysisSetting(false, 1, 0, 250, "", "");

            PartitionDataAdpator PDataAdap    = new PartitionDataAdpator(pd, subSamplingSettings);
            ExposureDataAdaptor  expData      = PDataAdap.GetExposureAdaptor(conID);
            ISubPerilConfig      subperilInfo = new RMSSubPerilConfig();

            RITEmapper1 mapper = new RITEmapper1(expData, new RAPSettings(new HashSet <string> {
                "EQ"
            }), subperilInfo);
        }
Ejemplo n.º 2
0
        private static void TestGULossVector(PartitionData pd, long conID)
        {
            //Default SubSampling Settings
            SubSamplingAnalysisSetting subSamplingSettings = new SubSamplingAnalysisSetting(false, 1, 0, 250, "", "");

            PartitionDataAdpator PDataAdap    = new PartitionDataAdpator(pd, subSamplingSettings);
            ExposureDataAdaptor  expData      = PDataAdap.GetExposureAdaptor(conID);
            ISubPerilConfig      subperilInfo = new RMSSubPerilConfig();

            IRITEindexMapper mapper = new RITEmapper1(expData, new RAPSettings(new HashSet <string> {
                "EQ"
            }), subperilInfo);
            HashSet <String> subperils = new HashSet <string> {
                "EQ", "WS"
            };


            VectorGUInputGeneratorFactory vectorgeneratorFactory = new VectorGUInputGeneratorFactory(pd, new HashSet <string> {
                "EQ"
            }, TimeStyle.ConstantTimeStamps, LossStyle.GroundUp, true, subSamplingSettings);
            VectorGUInputGenerator ReferenceEventGen = vectorgeneratorFactory.GetGeneratorForContract(conID);

            IVectorEvent Event = ReferenceEventGen.GenerateRITELoss(1);
        }
Ejemplo n.º 3
0
        private static void TestMatrixHDFM(PartitionData pd, long conID)
        {
            Stopwatch sw = new Stopwatch();

            //Default SubSampling Settings
            SubSamplingAnalysisSetting subSamplingSettings = new SubSamplingAnalysisSetting(false, 1, 0, 250, "", "");

            PartitionDataAdpator PDataAdap    = new PartitionDataAdpator(pd, subSamplingSettings);
            ExposureDataAdaptor  expData      = PDataAdap.GetExposureAdaptor(conID);
            ISubPerilConfig      subperilInfo = new RMSSubPerilConfig();

            HashSet <String> subperils = new HashSet <string> {
                "WI"
            };
            IRITEindexMapper mapper = new RITEmapper1(expData, new RAPSettings(subperils), subperilInfo);



            VectorGUInputGeneratorFactory vectorgeneratorFactory = new VectorGUInputGeneratorFactory(pd, subperils, TimeStyle.ConstantTimeStamps, LossStyle.GroundUp, true, subSamplingSettings);
            VectorGUInputGenerator        vectorGenerator        = vectorgeneratorFactory.GetGeneratorForContract(conID);


            FixedMatrixGraphJPTY JPTYGraph = new FixedMatrixGraphJPTY(expData);

            JPTYGraph.Initialize();

            MatrixGraphExecuter executer = new MatrixGraphExecuter(JPTYGraph);

            int    NumOfEvents = 100;
            double totalTime   = 0;

            for (int eventId = 6; eventId < NumOfEvents; eventId++)
            {
                IVectorEvent Event = vectorGenerator.GenerateRITELoss(eventId);

                sw.Start();
                float payout = (float)(executer.Run(Event).TotalPayOut);
                sw.Stop();
                long test = sw.ElapsedMilliseconds;

                //totalTime += sw.Elapsed.TotalMilliseconds;
            }

            double avgTime         = sw.Elapsed.TotalMilliseconds / NumOfEvents;
            double avgGraphState   = executer.IniGraphState.Elapsed.TotalMilliseconds / NumOfEvents;
            double avgAggregation  = executer.Aggregation.Elapsed.TotalMilliseconds / NumOfEvents;
            double avgInteraction  = executer.Interaction.Elapsed.TotalMilliseconds / NumOfEvents;
            double avgFillARite    = executer.AssignGUtoARite.Elapsed.TotalMilliseconds / NumOfEvents;
            double avgSumByPattern = executer.Aggregation1.Elapsed.TotalMilliseconds / NumOfEvents;
            double avgAllocation   = executer.Allocationtimer.Elapsed.TotalMilliseconds / NumOfEvents;


            Console.WriteLine("For " + NumOfEvents + " Events avg execution time is "
                              + avgTime + " Milliseconds");
            Console.WriteLine("For" + NumOfEvents + "avg GraphState Instantiation is "
                              + avgGraphState + "Milliseconds");
            Console.WriteLine("For" + NumOfEvents + "avg Aggregation is "
                              + avgAggregation + "Milliseconds");
            Console.WriteLine("For" + NumOfEvents + "avg Interaction is "
                              + avgInteraction + "Milliseconds");
            Console.WriteLine("For" + NumOfEvents + "avg Assigning GU to Arites is "
                              + avgFillARite + "Milliseconds");
            Console.WriteLine("For" + NumOfEvents + "avg SumArrayByPattern is "
                              + avgSumByPattern + "Milliseconds");
            Console.WriteLine("For" + NumOfEvents + "avg allocation time is "
                              + avgAllocation + "Milliseconds");

            Console.ReadLine();
        }