コード例 #1
0
        public VectorGUInputGenerator GetGeneratorForContract(long conID)
        {
            ExposureDataAdaptor expData     = pData.GetExposureAdaptor(conID);
            RITEmapper1         mapper      = new RITEmapper1(expData, new RAPSettings(subperils), subperilConfig);
            GUInputGenerator    guGenerator = GeneratorFactory.GetGeneratorForContract(conID);

            return(new VectorGUInputGenerator(guGenerator, mapper));
        }
コード例 #2
0
        //RITE.ID -> numBldgs -> <timestamp -> list of loss>

        public GUInputGenerator(PartitionData PD, long conID, COLCollection _COLSet, TimeStyle _timestyle, LossStyle _lossstyle)
        {
            PartitionDataAdpator PData = new PartitionDataAdpator(PD);

            expData   = PData.GetExposureAdaptor(conID);
            COLSet    = _COLSet;
            timestyle = _timestyle;
            lossstyle = _lossstyle;
            //    Dictionary<long, Dictionary<int, Tuple<int, List<float>>>> GULosses = new Dictionary<long, Dictionary<int, Tuple<int, List<float>>>>();
        }
コード例 #3
0
        public PLTGenerator(PartitionData _PD, long _conID, int pid, COLCollection _COLSet, TimeStyle _timestyle, LossStyle _lossStyle, DateTime _start, DateTime _end)
        {
            PartitionDataAdpator PData = new PartitionDataAdpator(_PD);

            expData   = PData.GetExposureAdaptor(conID);
            PD        = _PD;
            conID     = _conID;
            COLSet    = _COLSet;
            timestyle = _timestyle;
            lossStyle = _lossStyle;
            PLT       = new PeriodLossTable(pid, _COLSet, _timestyle, _lossStyle, _start, _end);
        }
コード例 #4
0
        public double Execute(long conID, GraphType type, Dictionary <string, Dictionary <int, Dictionary <long, Tuple <double, uint, List <float> > > > > guLoss)
        {
            ExposureDataAdaptor expData = PDataAdaptor.GetExposureAdaptor(conID);
            string error;

            //Stopwatch watch = new Stopwatch();
            //watch.Start();
            Graph graph = GetGraph(type, expData);
            //watch.Stop();

            //long graphTime = watch.ElapsedMilliseconds;

            GraphExecuter Executer;

            if (graph is PrimaryGraph)
            {
                Executer = new PrimaryGraphExecuter(graph as PrimaryGraph);
            }
            else if (graph is TreatyGraph)
            {
                Executer = new TreatyGraphExecuter(graph as TreatyGraph);
            }
            else
            {
                throw new NotSupportedException("Can only handle graph of type Treaty and Primary");
            }

            //Execute Graph and Allocate graph
            double payout = Executer.Execute(guLoss);

            //Allocate Graph
            //GraphAllocation Allocater = new GraphAllocation(graph);
            //Allocater.AllocateGraph();

            return(payout);
        }
コード例 #5
0
 public ExposureDataAdaptor GetExposure(long conID)
 {
     return(PDataAdaptor.GetExposureAdaptor(conID));
 }
コード例 #6
0
 public void PrepareContract(long ConID, GraphType type = GraphType.Auto)
 {
     ExposureDataAdaptor expData   = PDataAdaptor.GetExposureAdaptor(ConID);
     IRITEindexMapper    mapper    = GetMapperForContract(expData);
     GraphInfo           graphInfo = GetGraph(type, expData, mapper);
 }
コード例 #7
0
        public GUInputGenerator GetGeneratorForContract(long ConID)
        {
            ExposureDataAdaptor expData = PData.GetExposureAdaptor(ConID);

            return(new GUInputGenerator(expData, subperils, timestyle, lossstyle));
        }