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(); }
public ReinsuranceSubject(ScheduleOfContracts _schedule, ExposureTypeCollection _exposureTypes, COLCollection _causeOfLossSet) : base() { schedule = _schedule; exposureTypes = _exposureTypes; causeOfLossSet = _causeOfLossSet; SubjectFunction = FunctionType.Sum; TotalNumSubjects++; ID = TotalNumSubjects; }
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 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); }