Пример #1
0
        public override void Initialize()
        {
            _contractRITEs = new HashSet <ContractAtomicRITE>();
            //Build Graph here....
            graphNodes          = new List <GraphNode>();
            parentToChildrenMap = new Dictionary <GraphNode, List <GraphNode> >();
            atomicCoverageRITEs = new HashSet <CoverageAtomicRITE>();

            //Add Contract Declarations
            Declarations = new Declarations();

            Graph overlapGraph;

            cache.GetContract(11331, out overlapGraph);
            Graph normalGraph;

            cache.GetContract(11324656, out normalGraph);

            ScheduleOfContracts schedule = new ScheduleOfContracts("PositionA_Gross",
                                                                   new HashSet <Graph>()
            {
                overlapGraph, normalGraph
            });
            ReinsuranceSubject TreatyNodeSub = new ReinsuranceSubject(schedule, Loss, EQ);
            CoverNode          TreatyNode    = new CoverNode(TreatyNodeSub, "OccLim");

            //TreatyNode.SetCoverTerms(false, 100, 100000, 1);
            graphNodes.Add(TreatyNode);
            this.TopNodes = new List <GraphNode>()
            {
                TreatyNode
            };

            this.BuildAtomicRITEs();
        }
Пример #2
0
 public ContractExtractor(ExposureDataAdaptor _expData)
 {
     ExpData         = _expData;
     jsonParseResult = _expData.ContractJSON;
     CoverComponent  = new Dictionary <Subject, Dictionary <string, Cover> >();
     Declarations    = new Declarations();
     SetContractDeclarations();
 }
Пример #3
0
 public Graph(long ID, List <GraphNode> _topNodes, List <GraphNode> _graphNodes, Dictionary <GraphNode, List <GraphNode> > _parentToChildrenMap, Declarations _declarations)
 {
     IsExecuted          = false;
     contractID          = ID;
     TopNodes            = _topNodes;
     graphNodes          = _graphNodes;
     parentToChildrenMap = _parentToChildrenMap;
     Declarations        = _declarations;
 }
Пример #4
0
        public bool GetDeclarations(Declarations declarations, out string message)
        {
            message = "";
            object Component;

            expData.ContractJSON.TryGetValue("Declarations", out Component);
            Dictionary <String, Object> list = Component as Dictionary <String, object>;

            return(SetDeclarations(declarations, list, out message));
        }
Пример #5
0
        public FixedPrimaryGraph(ExposureDataAdaptor _expdata)
            : base(_expdata.ContractID)
        {
            expdata = _expdata;

            //Build Graph here....
            graphNodes          = new List <GraphNode>();
            parentToChildrenMap = new Dictionary <GraphNode, List <GraphNode> >();
            atomicCoverageRITEs = new HashSet <CoverageAtomicRITE>();

            //Add Contract Declarations
            Declarations = new Declarations();
        }
Пример #6
0
 public TreatyGraph(long ID, List <GraphNode> _topNodes, List <GraphNode> _graphNodes, Dictionary <GraphNode, List <GraphNode> > _parentToChildrenMap, Declarations _declarations)
     : base(ID, _topNodes, _graphNodes, _parentToChildrenMap, _declarations)
 {
 }
Пример #7
0
        public static Limit GetLimitForTerm(Dictionary <string, object> termDictionary, Declarations declarations)
        {
            Value         limValue;
            TermValueType limPtype;
            //if (!TryConvert(termDictionary["Value"], out limValue))
            //    throw new InvalidOperationException("Limit is not coded as monetary amount in CDL, cannot be supported at this time...");
            bool isPerRisk = false;

            if (termDictionary["PerRisk"].ToString() == "True")
            {
                isPerRisk = true;
            }
            TimeBasis timeBasis;

            GetInfoFromJSONTermExp(termDictionary, out limValue, out limPtype, out timeBasis);

            return(new Limit(declarations.GroundUpSublimits, limValue, isPerRisk, limPtype));
        }
Пример #8
0
 public TreatyGraph(long ID, List <GraphNode> _topNodes, List <GraphNode> _graphNodes, Dictionary <GraphNode, List <GraphNode> > _parentToChildrenMap, Declarations _declarations, Dictionary <long, Declarations> _primarydeclarationsSet)
     : base(ID, _topNodes, _graphNodes, _parentToChildrenMap, _declarations)
 {
     declarationsForAssociatedContracts = _primarydeclarationsSet;
     declarationsForAssociatedContracts.Add(ID, _declarations);
 }
Пример #9
0
 public HoursClauseWindowGenerator(Declarations ContractDeclarations)
 {
     _contractDeclarations = ContractDeclarations;
 }
Пример #10
0
        public static Deductible GetDedForTerm(Dictionary <string, object> termDictionary, Declarations declarations)
        {
            bool          isPerRisk = false;
            TermValueType dedPtype;

            if (termDictionary["PerRisk"].ToString() == "True")
            {
                isPerRisk = true;
            }
            int  index     = Convert.ToInt32(termDictionary["Index"]);
            bool franchise = Convert.ToBoolean(termDictionary["IsFranchise"]);
            DedInteractionType dedInterType = (DedInteractionType)Enum.Parse(typeof(DedInteractionType), termDictionary["Interaction"].ToString());

            if (dedInterType == DedInteractionType.MIN & declarations.MinimumAbsorbingDed)
            {
                dedInterType = DedInteractionType.Absorbing;
            }

            Value     dedValue;
            TimeBasis timeBasis;

            GetInfoFromJSONTermExp(termDictionary, out dedValue, out dedPtype, out timeBasis);

            return(new Deductible(franchise, dedInterType, dedValue, isPerRisk, dedPtype));
        }
Пример #11
0
 public GraphOfMatrix(long ID, IExecutableMatrixGraph _matrixGraph, Declarations _declarations)
     : base(ID, _declarations)
 {
     matrixGraph = _matrixGraph;
     //TopCover = _topCover;
 }
Пример #12
0
        public List <AtomicLoss> GetAllocatedLossList(float[] AllocatedLossVector, int[] GULossIndicies, uint[] TimeStamps, Declarations contractDeclarations)
        {
            List <AtomicLoss> AllocatedLosses = new List <AtomicLoss>();
            int NumOfArites = AllocatedLossVector.Length;

            for (int i = 0; i < NumOfArites; i++)
            {
                if (AllocatedLossVector[i] > 0)
                {
                    AtomicLoss loss = new AtomicLoss();
                    loss.ExposureID = Mapper.GetRITEIDFromIndex(GULossIndicies[i]);
                    loss.Subperil   = Mapper.GetSubPerilFromIndex(GULossIndicies[i]);
                    loss.Loss       = AllocatedLossVector[i];
                    RITCharacteristic RitChar = Mapper.GetRITCharObject(loss.ExposureID);
                    loss.RITE    = RitChar.ParentRITE;
                    loss.ExpType = RitChar.ExpType;

                    //Get TimeStamp using Mapper:
                    int      ContractYear    = contractDeclarations.Inception.Year;
                    uint     timestamp       = TimeStamps[GULossIndicies[i]];
                    DateTime ActualTimeStamp = new DateTime(ContractYear, 1, 1);
                    ActualTimeStamp = ActualTimeStamp.AddDays((double)timestamp - 1);
                    loss.timestamp  = ActualTimeStamp;
                    AllocatedLosses.Add(loss);
                }
            }

            return(AllocatedLosses);
        }
Пример #13
0
        private bool SetDeclarations(Declarations graph_declarations, Dictionary <String, Object> cdl_declarations, out string message)
        {
            message = "";
            try
            {
                graph_declarations.Name = Convert.ToString(cdl_declarations["Name"]);

                if (cdl_declarations.ContainsKey("Currency"))
                {
                    graph_declarations.Currency = Convert.ToString(cdl_declarations["Currency"]);
                }
                if (cdl_declarations.ContainsKey("Inception"))
                {
                    graph_declarations.Inception = Convert.ToDateTime(cdl_declarations["Inception"]);
                }
                else
                {
                    graph_declarations.Inception = DateTime.Now;
                }
                if (cdl_declarations.ContainsKey("Expiration"))
                {
                    graph_declarations.Expiration = Convert.ToDateTime(cdl_declarations["Expiration"]);
                }
                else
                {
                    graph_declarations.Expiration = graph_declarations.Inception.AddYears(1);
                }

                if (cdl_declarations.ContainsKey("ContractType"))
                {
                    graph_declarations.ContractType = Convert.ToString(cdl_declarations["ContractType"]);
                }
                else
                {
                    throw new NotSupportedException("This prototype requies CDL to specify a recognized Contract Type");
                }

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

                if (cdl_declarations.ContainsKey("ExposureTypes"))
                {
                    graph_declarations.ExposureTypes = ExposureTypeCollection.BuildFromString(Convert.ToString(cdl_declarations["ExposureTypes"]));
                }
                else
                {
                    graph_declarations.ExposureTypes = ExposureTypeCollection.GetDefaultExposureTypes();
                }

                if (cdl_declarations.ContainsKey("Schedule"))
                {
                    try { graph_declarations.Schedule = expData.GetSchedule(Convert.ToString(cdl_declarations["Schedule"])); }
                    catch (Exception ex) { graph_declarations.Schedule = null; }
                }

                if (cdl_declarations.ContainsKey("GrossPosition"))
                {
                    graph_declarations.GrossPosition = Convert.ToString(cdl_declarations["GrossPosition"]).Split(',').ToList();
                }
                else
                {
                    graph_declarations.GrossPosition = new List <string>();
                }

                if (cdl_declarations.ContainsKey("CededPosition"))
                {
                    graph_declarations.CededPosition = Convert.ToString(cdl_declarations["CededPosition"]).Split(',').ToList();
                }
                else
                {
                    graph_declarations.CededPosition = new List <string>();
                }

                //Handle Claims Adjustment Options
                if (cdl_declarations.ContainsKey("Claims Adjustment Options"))
                {
                    Dictionary <String, Object> ClaimsAdjustmentOptions = cdl_declarations["Claims Adjustment Options"] as Dictionary <String, Object>;
                    if (ClaimsAdjustmentOptions.ContainsKey("Claims Adjustment Sublimits"))
                    {
                        string sublimitAdjustment = ClaimsAdjustmentOptions["Claims Adjustment Sublimits"].ToString();
                        if (sublimitAdjustment == "Net Of Deductible")
                        {
                            graph_declarations.GroundUpSublimits = false;
                        }
                        else if (sublimitAdjustment == "GroundUp")
                        {
                            graph_declarations.GroundUpSublimits = true;
                        }
                        else
                        {
                            throw new JSONParseException("Cannot support Claims Adjustment Option for Sublimits: " + sublimitAdjustment);
                        }
                    }

                    if (ClaimsAdjustmentOptions.ContainsKey("Claims Adjustment Deductibles"))
                    {
                        string dedAdjustment = ClaimsAdjustmentOptions["Claims Adjustment Deductibles"].ToString();
                        if (dedAdjustment == "Absorbable")
                        {
                            graph_declarations.MinimumAbsorbingDed = true;
                        }
                        else
                        {
                            throw new JSONParseException("Cannot support Claims Adjustment Option for Deductibles: " + dedAdjustment);
                        }
                    }
                }

                //Get Hours clause declarations
                graph_declarations.HoursClauses = new List <HoursClause>();
                Object[] hoursclauses;
                if (cdl_declarations.ContainsKey("Hours Clauses"))
                {
                    hoursclauses = cdl_declarations["Hours Clauses"] as object[];
                    List <Object> lst_hoursclauses = hoursclauses.OfType <Object>().ToList();

                    foreach (Dictionary <String, Object> hc in lst_hoursclauses)
                    {
                        HoursClause objHC = new HoursClause();
                        objHC.SetHoursClause(hc);
                        graph_declarations.HoursClauses.Add(objHC);
                    }

                    graph_declarations.IsHoursClause = true;
                }
            }
            catch (Exception ex)
            {
                throw ex;
            }
            return(true);
        }
Пример #14
0
 public Graph(long ID, Declarations _declarations)
 {
     IsExecuted   = false;
     contractID   = ID;
     Declarations = _declarations;
 }
Пример #15
0
 public TreatyTermExtractor(ExposureDataAdaptor _expData, Declarations _Declarations, GraphBuildCache _graphCache)
     : base(_expData, _Declarations)
 {
     graphCache = _graphCache;
     SetContractSubject();
 }
Пример #16
0
 public PrimaryTermExtractor(ExposureDataAdaptor _expData, Declarations _Declarations)
     : base(_expData, _Declarations)
 {
     SetContractSubject();
 }
Пример #17
0
 public FinancialTermExtractor(ExposureDataAdaptor _expData, Declarations _Declarations)
 {
     ExpData      = _expData;
     Declarations = _Declarations;
 }