Exemplo n.º 1
0
        private ScheduleOfRITEs BuildScheduleFromRITChars(string name, HashSet <long> EDSschedule)
        {
            ScheduleOfRITEs newSchedule = new ScheduleOfRITEs(name);

            foreach (long RITCharID in EDSschedule)
            {
                long RITEID = EDSDataExtract.CoverageIdAttrMap[RITCharID].RITExposureId;

                RITCharacteristic characteristicToAdd = _characteristics.Where(ritchar => ritchar.ID == RITCharID).FirstOrDefault();
                RITE ritetoAdd = _rites.Where(rite => rite.ExposureID == RITEID).FirstOrDefault();

                if (characteristicToAdd != null)
                {
                    newSchedule.AddCharacteristic(characteristicToAdd);
                }
                else
                {
                    throw new IndexOutOfRangeException("Error building schedule with RITCharacteristics: Cannot find RITCharacteristic with id = " + RITCharID + " in Exposure Data");
                }

                if (ritetoAdd != null)
                {
                    newSchedule.AddItem(ritetoAdd);
                }
                else
                {
                    throw new IndexOutOfRangeException("Error building schedule with RITEs: Cannot find RITE with id = " + RITEID + " in Exposure Data");
                }
            }

            return(newSchedule);
        }
Exemplo n.º 2
0
        private ScheduleOfRITEs BuildScheduleFromRITChars2(string name, HashSet <long> EDSschedule)
        {
            ScheduleOfRITEs newSchedule = new ScheduleOfRITEs(name);

            foreach (long RITCharID in EDSschedule)
            {
                RITCharacteristic characteristicToAdd;
                if (!_characteristicsDict.TryGetValue(RITCharID, out characteristicToAdd))
                {
                    throw new IndexOutOfRangeException("Error building schedule with RITCharacteristics: Cannot find RITCharacteristic with id = " + RITCharID + " in Exposure Data");
                }
                newSchedule.AddCharacteristic(characteristicToAdd);

                //long RITEID = EDSDataExtract.CoverageIdAttrMap[RITCharID].RITExposureId;
                long RITEID = characteristicToAdd.ParentRITE.ExposureID;

                RITE ritetoAdd;
                if (!_ritesDict.TryGetValue(RITEID, out ritetoAdd))
                {
                    throw new IndexOutOfRangeException("Error building schedule with RITEs: Cannot find RITE with id = " + RITEID + " in Exposure Data");
                }
                newSchedule.AddItem(ritetoAdd);
            }

            return(newSchedule);
        }
Exemplo n.º 3
0
        public void AddScheduleFromRITChars(string name, HashSet <RITCharacteristic> RITChars)
        {
            ScheduleOfRITEs newSchedule = new ScheduleOfRITEs(name);

            foreach (RITCharacteristic RITChar in RITChars)
            {
                newSchedule.AddItem(RITChar.ParentRITE);
                newSchedule.AddCharacteristic(RITChar);
            }
            _schedules.Add(newSchedule);
            _schedulesDict.Add(newSchedule.Name, newSchedule);
        }
Exemplo n.º 4
0
        public void AddSchedule(string name, HashSet <RITE> rites)
        {
            ScheduleOfRITEs newSchedule = new ScheduleOfRITEs(name);

            foreach (RITE rite in rites)
            {
                newSchedule.AddItem(rite);
                newSchedule.RITChars.UnionWith(rite.RiskCharacteristics);
            }
            _schedules.Add(newSchedule);
            _schedulesDict.Add(newSchedule.Name, newSchedule);
        }
Exemplo n.º 5
0
        private ScheduleOfRITEs BuildScheduleFromRITs2(string name, HashSet <long> EDSschedule)
        {
            ScheduleOfRITEs newSchedule = new ScheduleOfRITEs(name);

            foreach (long riteID in EDSschedule)
            {
                RITE ritetoAdd;
                if (!_ritesDict.TryGetValue(riteID, out ritetoAdd))
                {
                    throw new IndexOutOfRangeException("Error building schedule with RITEs: Cannot find RITE with id = " + riteID + " in Exposure Data");
                }

                newSchedule.AddItem(ritetoAdd);
                newSchedule.RITChars.UnionWith(ritetoAdd.RiskCharacteristics);
            }

            return(newSchedule);
        }
Exemplo n.º 6
0
        private ScheduleOfRITEs BuildScheduleFromRITs(string name, HashSet <long> EDSschedule)
        {
            ScheduleOfRITEs newSchedule = new ScheduleOfRITEs(name);

            foreach (long riteID in EDSschedule)
            {
                RITE ritetoAdd = _rites.Where(rite => rite.ExposureID == riteID).FirstOrDefault();

                if (ritetoAdd != null)
                {
                    newSchedule.AddItem(ritetoAdd);
                    newSchedule.RITChars.UnionWith(ritetoAdd.RiskCharacteristics);
                }
                else
                {
                    throw new IndexOutOfRangeException("Error building schedule with RITEs: Cannot find RITE with id = " + riteID + " in Exposure Data");
                }
            }

            return(newSchedule);
        }