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)); }
//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>>>>(); }
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); }
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); }
public ExposureDataAdaptor GetExposure(long conID) { return(PDataAdaptor.GetExposureAdaptor(conID)); }
public void PrepareContract(long ConID, GraphType type = GraphType.Auto) { ExposureDataAdaptor expData = PDataAdaptor.GetExposureAdaptor(ConID); IRITEindexMapper mapper = GetMapperForContract(expData); GraphInfo graphInfo = GetGraph(type, expData, mapper); }
public GUInputGenerator GetGeneratorForContract(long ConID) { ExposureDataAdaptor expData = PData.GetExposureAdaptor(ConID); return(new GUInputGenerator(expData, subperils, timestyle, lossstyle)); }