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!"); } }
//Comparison Methods public bool LargerOrEqualThan(ExposureTypeCollection other, bool IsLocCvg = false) { if (IsLocCvg) { return(this.collection.First() == other.collection.First()); } return(other.All(expType => this.collection.Contains(expType) || this.collection.Contains(ExposureTypeCollection.GetMappedType(expType)))); }
public bool LargerThan(ExposureTypeCollection other, bool IsLocCvg = false) { if (IsLocCvg) { return(false); } return(other.All(expType => this.collection.Contains(expType) || this.collection.Contains(ExposureTypeCollection.GetMappedType(expType))) && !this.Equals(other)); }