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(); }
protected override void SetContractSubject() { string position = Declarations.GrossPosition; HashSet <long> contractsIDs; if (ExpData.Positions.ContractsForPosition(position, out contractsIDs)) { HashSet <Graph> contractGraphs = BuildPosition(contractsIDs); ScheduleOfContracts schedule = new ScheduleOfContracts(position, contractGraphs); ContractSubject = new ReinsuranceSubject(schedule, Declarations.ExposureTypes, Declarations.CausesofLoss); } else { throw new InvalidOperationException("Cannot find position: " + position + " in position data."); } }
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) }); }
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)); }
protected override void SetContractSubject() { List <string> grossPositions = Declarations.GrossPosition; List <string> cededPositions = Declarations.CededPosition; ScheduleOfContracts grossSchedule = new ScheduleOfContracts(string.Join(",", grossPositions.ToArray())); ScheduleOfContracts cededSchedule = new ScheduleOfContracts(string.Join(",", cededPositions.ToArray()));; HashSet <long> contractsIDs; //Build gross Position Schedule foreach (string grossPosition in grossPositions) { if (ExpData.Positions.ContractsForPosition(grossPosition, out contractsIDs)) { HashSet <GraphInfo> contractGraphs = BuildPosition(contractsIDs); grossSchedule.AddItemList(contractGraphs); } else { throw new InvalidOperationException("Cannot find position: " + grossPosition + " in position data."); } } //Build ceded Position Schedule foreach (string cededPosition in cededPositions) { if (ExpData.Positions.ContractsForPosition(cededPosition, out contractsIDs)) { HashSet <GraphInfo> contractGraphs = BuildPosition(contractsIDs); cededSchedule.AddItemList(contractGraphs); } else { throw new InvalidOperationException("Cannot find position: " + cededPosition + " in position data."); } } ContractSubject = new ReinsuranceSubject(grossSchedule, cededSchedule, Declarations.ExposureTypes, Declarations.CausesofLoss); }