Exemple #1
0
 public PLTGenertorFactory(PartitionData PD, COLCollection _COLSet, SubSamplingAnalysisSetting subSamplingSettings, DateTime _start, TimeStyle _timestyle, LossStyle _lossstyle)
 {
     Start            = _start;
     End              = _start.AddYears(6);
     pData            = new PartitionDataAdpator(PD, subSamplingSettings);
     GeneratorFactory = new GUInputGeneratorFactory(pData, _COLSet, _timestyle, _lossstyle);
 }
Exemple #2
0
 public GUInputGeneratorFactory(PartitionDataAdpator _PData, COLCollection _COLSet, TimeStyle _timestyle, LossStyle _lossstyle)
 {
     PData            = _PData;
     NeedDisposePData = false;
     subperils        = _COLSet.GetSubperils();
     timestyle        = _timestyle;
     lossstyle        = _lossstyle;
 }
Exemple #3
0
 public GUInputGeneratorFactory(PartitionData PD, COLCollection _COLSet, SubSamplingAnalysisSetting subSmaplingSettings, TimeStyle _timestyle, LossStyle _lossstyle)
 {
     PData            = new PartitionDataAdpator(PD, subSmaplingSettings);
     NeedDisposePData = true;
     subperils        = _COLSet.GetSubperils();
     timestyle        = _timestyle;
     lossstyle        = _lossstyle;
 }
Exemple #4
0
 public ReinsuranceSubject(ScheduleOfContracts _schedule, ExposureTypeCollection _exposureTypes, COLCollection _causeOfLossSet) : base()
 {
     schedule        = _schedule;
     exposureTypes   = _exposureTypes;
     causeOfLossSet  = _causeOfLossSet;
     SubjectFunction = FunctionType.Sum;
     TotalNumSubjects++;
     ID = TotalNumSubjects;
 }
Exemple #5
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>>>>();
        }
Exemple #6
0
 public PeriodLossTable(int pid, COLCollection _COLSet, TimeStyle _timestyle, LossStyle _lossstyle, DateTime _start, DateTime _end)
 {
     PID       = pid;
     Start     = _start;
     End       = _end;
     COLSet    = _COLSet;
     timestyle = _timestyle;
     lossstyle = _lossstyle;
     PGULosses = new List <Dictionary <string, Dictionary <int, Dictionary <long, Tuple <double, uint, List <float> > > > > >();
 }
Exemple #7
0
        protected override Subject GetSubjectForTerm(Dictionary <string, object> termDict)
        {
            string                 termSchedule = termDict["Schedule"].ToString();
            COLCollection          termCOL      = GetCOLHashSet(termDict["CausesOfLoss"].ToString());
            ExposureTypeCollection termExp      = GetExpTypeHashSet(termDict["ExposureTypes"].ToString());
            ScheduleOfRITEs        schedule     = GetSchedule(termSchedule);

            PrimarySubject sub = new PrimarySubject(schedule, termExp, termCOL);

            return(sub);
        }
Exemple #8
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);
        }
Exemple #9
0
        protected override HashSet <Subject> GetSubjectForTerm(Dictionary <string, object> termDict)
        {
            string expTypes = termDict["ExposureTypes"].ToString();
            string COLTypes = termDict["CausesOfLoss"].ToString();

            ExposureTypeCollection termExp;
            COLCollection          termCOL;

            if (COLTypes == "")
            {
                termCOL = contractSubject.CauseOfLossSet;
            }
            else
            {
                termCOL = new COLCollection(COLTypes);
            }

            if (expTypes == "")
            {
                termExp = contractSubject.ExposureTypes;
            }
            else
            {
                termExp = ExposureTypeCollection.BuildFromString(expTypes);
            }

            string          termSchedule = termDict["Schedule"].ToString();
            ScheduleOfRITEs schedule     = ExpData.GetSchedule(termSchedule);

            bool isPerRisk = false;

            if (termDict.ContainsKey("PerRisk") & termDict["PerRisk"].ToString() == "True")
            {
                isPerRisk = true;
            }

            PrimarySubject sub = new PrimarySubject(schedule, termExp, termCOL, isPerRisk);

            //DO NOT Explode
            //if (termDict.ContainsKey("PerRisk")
            //    & termDict["PerRisk"].ToString() == "True")
            //    return new HashSet<Subject>(ExplodeSubjectForPerRisk(sub).Cast<Subject>());
            //else
            //    return new HashSet<Subject>(){sub};

            return(new HashSet <Subject>()
            {
                sub
            });
        }
Exemple #10
0
        public PrimarySubject(ScheduleOfRITEs _schedule, ExposureTypeCollection _exposureTypes, COLCollection _causeOfLossSet, bool _isPerRisk = false) : base()
        {
            schedule       = _schedule;
            exposureTypes  = _exposureTypes;
            causeOfLossSet = _causeOfLossSet;
            if (_schedule != null && _schedule.IsLocation && _exposureTypes.Count == 1)
            {
                isLocCvg = true;
            }
            else
            {
                isLocCvg = false;
            }

            IsPerRisk = _isPerRisk;
        }
Exemple #11
0
        protected override HashSet <Subject> GetSubjectForTerm(Dictionary <string, object> termDict)
        {
            string expTypes = termDict["ExposureTypes"].ToString();
            string COLTypes = termDict["CausesOfLoss"].ToString();

            ExposureTypeCollection termExp;
            COLCollection          termCOL;

            if (COLTypes == "")
            {
                termCOL = contractSubject.CauseOfLossSet;
            }
            else
            {
                termCOL = new COLCollection(COLTypes);
            }

            if (expTypes == "")
            {
                termExp = contractSubject.ExposureTypes;
            }
            else
            {
                termExp = ExposureTypeCollection.BuildFromString(expTypes);
            }

            string termSchedule = termDict["Schedule"].ToString();
            ScheduleOfContracts grossSchedule;
            ScheduleOfContracts cededSchedule;

            if (termSchedule == "")
            {
                ReinsuranceSubject treatyConCub = contractSubject as ReinsuranceSubject;
                grossSchedule = treatyConCub.GrossSchedule;
                cededSchedule = treatyConCub.CededSchedule;
            }
            else
            {
                throw new NotSupportedException("Cannot support treaty terms with Schedule Of Contract subjects...");
            }

            return(new HashSet <Subject>()
            {
                new ReinsuranceSubject(grossSchedule, cededSchedule, termExp, termCOL)
            });
        }
Exemple #12
0
        private COLCollection GetContractCOLs()
        {
            COLCollection CausesofLoss;

            object Component;

            _contractJSON.TryGetValue("Declarations", out Component);
            Dictionary <String, Object> cdl_declarations = Component as Dictionary <String, object>;

            if (cdl_declarations.ContainsKey("CausesOfLoss"))
            {
                CausesofLoss = new COLCollection(Convert.ToString(cdl_declarations["CausesOfLoss"]));
            }
            else
            {
                CausesofLoss = CauseOfLoss.GetDefaultCOLs();
            }

            return(CausesofLoss);
        }
Exemple #13
0
        protected override Subject GetSubjectForTerm(Dictionary <string, object> termDict)
        {
            string                 termSchedule = termDict["Schedule"].ToString();
            COLCollection          termCOL      = GetCOLHashSet(termDict["CausesOfLoss"].ToString());
            ExposureTypeCollection termExp      = GetExpTypeHashSet(termDict["ExposureTypes"].ToString());

            ScheduleOfContracts schedule;

            if (termSchedule == "")
            {
                ReinsuranceSubject treatyConCub = ContractSubject as ReinsuranceSubject;
                schedule = treatyConCub.GrossSchedule;
            }
            else
            {
                throw new NotSupportedException("Cannot support treaty terms with Schedule Of Contract subjects...");
            }

            return(new ReinsuranceSubject(schedule, termExp, termCOL));
        }