public override HashSet <AtomicRITE> GetAtomicRites() { if (!IsDerived) { HashSet <CoverageAtomicRITE> ARITEs = new HashSet <CoverageAtomicRITE>(); foreach (ExposureType expType in ExposureTypes) { var RITChars = Schedule.RITChars.Where(RitChar => RitChar.ExpType == expType || ExposureTypeCollection.GetMappedType(RitChar.ExpType) == expType); foreach (RITCharacteristic RITChar in RITChars) { foreach (string subperil in CauseOfLossSet.GetSubperils()) { ARITEs.Add(new CoverageAtomicRITE(subperil, ExposureTypeCollection.GetMappedType(RITChar.ExpType), RITChar.ParentRITE, RITChar.ID)); //IEnumerable<RITCharacteristic> RITChars; //RITChars = rite.RiskCharacteristics.Where(RitChar => RitChar.ExpType == expType || ExposureTypeCollection.GetMappedType(RitChar.ExpType) == expType); //foreach (RITCharacteristic RitChar in RITChars) //{ // ARITEs.Add(new CoverageAtomicRITE(subperil, ExposureTypeCollection.GetMappedType(RitChar.ExpType), rite, RitChar.ID)); //} } } } return(new HashSet <AtomicRITE>(ARITEs.Cast <AtomicRITE>())); } else { throw new InvalidOperationException("Cannot get Atomic Rites for derived subjects!"); } }
public override string ToString() { if (IsDerived) { return(String.Join(",", ChildrenCoverNodeList)); } else { return(CauseOfLossSet.ToString() + "; " + exposureTypes.ToString()); } }
public override int GetHashCode() { if (IsDerived) { int code = 0; foreach (string s in ChildrenCoverNodeList) { code = code + s.GetHashCode() * 31; } return(code); } else { return(CauseOfLossSet.GetHashCode() ^ exposureTypes.GetHashCode()); } }
public override HashSet <AtomicRITE> GetAtomicRites() { if (!IsDerived) { HashSet <ContractAtomicRITE> ARITEs = new HashSet <ContractAtomicRITE>(); //Build Contract Atomic Rites for Gross Position foreach (GraphInfo contractGraph in GrossSchedule.ScheduleList) { foreach (string subperil in CauseOfLossSet.GetSubperils()) { foreach (ExposureType expType in ExposureTypes) { ARITEs.Add(new ContractAtomicRITE(contractGraph, subperil, expType, PositionType.Gross)); } } } //Build Contract Atomic Rites for Ceded Position foreach (GraphInfo contractGraph in CededSchedule.ScheduleList) { foreach (string subperil in CauseOfLossSet.GetSubperils()) { foreach (ExposureType expType in ExposureTypes) { ARITEs.Add(new ContractAtomicRITE(contractGraph, subperil, expType, PositionType.Ceded)); } } } return(new HashSet <AtomicRITE>(ARITEs.Cast <AtomicRITE>()));; } else { throw new InvalidOperationException("Cannot get Atomic Rites for derived subjects!"); } }