Beispiel #1
0
        public override bool ScheduleListEquals(Schedule <RITE> other)
        {
            ScheduleOfRITEs otherSch = other as ScheduleOfRITEs;

            if (otherSch == null)
            {
                return(false);
            }

            if (IsLocation)
            {
                if (this.RITChars.SetEquals(otherSch.RITChars))
                {
                    return(true);
                }
                else
                {
                    return(false);
                }
            }
            else
            {
                if (this.ScheduleList.SetEquals(otherSch.ScheduleList))
                {
                    return(true);
                }
                else
                {
                    return(false);
                }
            }
        }
Beispiel #2
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);
        }
Beispiel #3
0
        public SubjectCompareOutcome CompareTwoSchedules(ScheduleOfRITEs s1, ScheduleOfRITEs s2)
        {
            HashSet <RITE> list1 = s1.ScheduleList;
            HashSet <RITE> list2 = s2.ScheduleList;

            if (list1.Count == list2.Count && list1.IsSubsetOf(list2))
            {
                return(SubjectCompareOutcome.Equal);
            }
            else if (list1.Count < list2.Count && list1.IsProperSubsetOf(list2))
            {
                return(SubjectCompareOutcome.Parent);
            }
            else if (list1.Count > list2.Count && list1.IsProperSupersetOf(list2))
            {
                return(SubjectCompareOutcome.Child);
            }
            else if (list1.Overlaps(list2))
            {
                return(SubjectCompareOutcome.Overlap);
            }
            else
            {
                return(SubjectCompareOutcome.Disjoin);
            }
        }
Beispiel #4
0
        public ScheduleInput FormScheduleFromARITE(RITE aRite, out bool existed)
        {
            ScheduleInput sInput = null;

            existed = false;

            HashSet <RITE> riteSet = new HashSet <RITE>()
            {
                aRite
            };

            //check if already exists
            foreach (IScheduleInput schedule in OriginalSchedules)
            {
                if (schedule.NumOfRites == 1 && schedule.GetScheduleRITEList().SetEquals(riteSet))
                {
                    existed = true;
                    break;
                }
            }

            if (!existed)
            {
                string          sName   = "exploded." + aRite.ExposureID;
                ScheduleOfRITEs sOfRite = new ScheduleOfRITEs(sName, riteSet, aRite.RiskCharacteristics);
                sInput = new ScheduleInput(sOfRite);
                WholeSchedules.Add(sInput);
            }
            return(sInput);
        }
Beispiel #5
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);
        }
Beispiel #6
0
        public override bool IsLargerOrEqualThan(Schedule <RITE> other)
        {
            ScheduleOfRITEs otherSch = other as ScheduleOfRITEs;

            if (otherSch == null)
            {
                return(false);
            }

            if (IsLocation)
            {
                if (this.RITChars.IsSupersetOf(otherSch.RITChars))
                {
                    return(true);
                }
                else
                {
                    return(false);
                }
            }
            else
            {
                if (this.ScheduleList.IsSupersetOf(other.ScheduleList))
                {
                    return(true);
                }
                else
                {
                    return(false);
                }
            }
        }
Beispiel #7
0
        public HashSet <PrimarySubject> GetDistinctPerRiskSubjects()
        {
            HashSet <PrimarySubject> DistinctPerRiskSubjects = new HashSet <PrimarySubject>(OriginalPerRiskSubjects);
            HashSet <PrimarySubject> NewPerRiskSubjects      = new HashSet <PrimarySubject>();

            //remove children Per Risk Subjects
            foreach (PrimarySubject s1 in OriginalPerRiskSubjects)
            {
                foreach (PrimarySubject s2 in OriginalPerRiskSubjects)
                {
                    if (s1.ID == s2.ID)
                    {
                        continue;
                    }
                    else if (SubjectTreeMatrix[s1.ID, s2.ID] == SubjectCompareOutcome.Equal)
                    {
                        DistinctPerRiskSubjects.Remove(s1);
                    }
                    else if (CompareTwoCOLs(s1.CauseOfLossSet.Collection, s2.CauseOfLossSet.Collection) == SubjectCompareOutcome.Equal &&
                             CompareTwoExpTypes(s1.ExposureTypes.Collection, s2.ExposureTypes.Collection) == SubjectCompareOutcome.Equal)
                    {
                        if (SubjectTreeMatrix[s1.ID, s2.ID] == SubjectCompareOutcome.Child)
                        {
                            DistinctPerRiskSubjects.Remove(s2);
                        }
                        else if (SubjectTreeMatrix[s1.ID, s2.ID] == SubjectCompareOutcome.Parent)
                        {
                            DistinctPerRiskSubjects.Remove(s1);
                        }
                        else if (SubjectTreeMatrix[s1.ID, s2.ID] == SubjectCompareOutcome.Overlap)
                        {
                            //just merge the two schedules, form a new Subject with disjoined Schedules
                            HashSet <RITE> list1 = s1.Schedule.ScheduleList;
                            HashSet <RITE> list2 = s2.Schedule.ScheduleList;

                            list1.UnionWith(list2);
                            ScheduleOfRITEs newSchedule = new ScheduleOfRITEs(s1.Schedule.Name + s2.Schedule.Name, list1, new HashSet <RITCharacteristic> {
                            });
                            PrimarySubject newSubject   = FormNewSubject(s1, newSchedule);

                            DistinctPerRiskSubjects.Remove(s1);
                            DistinctPerRiskSubjects.Remove(s2);
                            DistinctPerRiskSubjects.Add(newSubject);
                            NewPerRiskSubjects.Add(newSubject);
                            //add to SubjectTree for this new Subject
                        }
                    }
                }
            }
            foreach (PrimarySubject newS in NewPerRiskSubjects)
            {
                foreach (PrimarySubject oldS in DistinctPerRiskSubjects)
                {
                    SubjectTreeMatrix[newS.ID, oldS.ID] = CompareTwoSubjects(newS, oldS);
                }
            }
            return(DistinctPerRiskSubjects);
        }
Beispiel #8
0
        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());
            ScheduleOfRITEs        schedule     = GetSchedule(termSchedule);

            PrimarySubject sub = new PrimarySubject(schedule, termExp, termCOL);

            return(sub);
        }
Beispiel #9
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);
        }
Beispiel #10
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);
        }
Beispiel #11
0
        public ScheduleInput FormScheduleFromARITE2(RITE aRite)
        {
            string         sName   = "exploded." + aRite.ExposureID;
            HashSet <RITE> riteSet = new HashSet <RITE>()
            {
                aRite
            };
            ScheduleOfRITEs sOfRite = new ScheduleOfRITEs(sName, riteSet, aRite.RiskCharacteristics);
            ScheduleInput   sInput  = new ScheduleInput(sOfRite);

            return(sInput);
        }
Beispiel #12
0
        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();
            ScheduleOfRITEs schedule     = ExpData.GetSchedule(termSchedule);

            bool isPerRisk = false;

            if (termDict.ContainsKey("PerRisk") & termDict["PerRisk"].ToString() == "True")
            {
                isPerRisk = true;
            }

            PrimarySubject sub = new PrimarySubject(schedule, termExp, termCOL, isPerRisk);

            //DO NOT Explode
            //if (termDict.ContainsKey("PerRisk")
            //    & termDict["PerRisk"].ToString() == "True")
            //    return new HashSet<Subject>(ExplodeSubjectForPerRisk(sub).Cast<Subject>());
            //else
            //    return new HashSet<Subject>(){sub};

            return(new HashSet <Subject>()
            {
                sub
            });
        }
Beispiel #13
0
        public PrimarySubject(ScheduleOfRITEs _schedule, ExposureTypeCollection _exposureTypes, COLCollection _causeOfLossSet, bool _isPerRisk = false) : base()
        {
            schedule       = _schedule;
            exposureTypes  = _exposureTypes;
            causeOfLossSet = _causeOfLossSet;
            if (_schedule != null && _schedule.IsLocation && _exposureTypes.Count == 1)
            {
                isLocCvg = true;
            }
            else
            {
                isLocCvg = false;
            }

            IsPerRisk = _isPerRisk;
        }
Beispiel #14
0
        private bool FindScheduleWithRite(RITE rite, out ScheduleOfRITEs schedule)
        {
            schedule = null;
            bool found = false;

            foreach (ScheduleOfRITEs sch in ExpData.Schedules)
            {
                if (sch.IsLocation &&
                    sch.ScheduleList.First().Equals(rite))
                {
                    schedule = sch;
                    found    = true;
                }
            }

            return(found);
        }
Beispiel #15
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);
        }
Beispiel #16
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);
        }
Beispiel #17
0
        public override void Initialize()
        {
            //Create Schedules
            ScheduleOfRITEs S16_EQ      = expdata.Schedules.ToList()[0];
            ScheduleOfRITEs S16_EQ_5229 = expdata.Schedules.ToList()[1];
            ScheduleOfRITEs S16_EQ_5228 = expdata.Schedules.ToList()[2];
            ScheduleOfRITEs S16_EQ_46   = expdata.Schedules.ToList()[3];
            ScheduleOfRITEs S16_EQ_47   = expdata.Schedules.ToList()[4];
            ScheduleOfRITEs S16_EQ_48   = expdata.Schedules.ToList()[5];

            //Create Subjects
            PrimarySubject Node27BSub  = new PrimarySubject(S16_EQ, Building, EQ);
            PrimarySubject Node27CSub  = new PrimarySubject(S16_EQ, Contents, EQ);
            PrimarySubject Node27BISub = new PrimarySubject(S16_EQ, BI, EQ);

            PrimarySubject Node25Sub = new PrimarySubject(S16_EQ, Building_Contents, EQ);
            PrimarySubject Node26Sub = new PrimarySubject(S16_EQ, Contents_BI, EQ);
            PrimarySubject Node27Sub = new PrimarySubject(S16_EQ, Loss, EQ);

            PrimarySubject Node11Sub = new PrimarySubject(S16_EQ, Loss, EQ);


            //Create Nodes and Add to Node List
            CoverNode Node27B = new CoverNode(Node27BSub, "L939_27_Building");

            graphNodes.Add(Node27B);

            CoverNode Node27C = new CoverNode(Node27CSub, "L939_27_Contents");

            graphNodes.Add(Node27C);

            CoverNode Node27BI = new CoverNode(Node27BISub, "L939_27_BI");

            graphNodes.Add(Node27BI);

            CoverNode Node27 = new CoverNode(Node27Sub, "L939_27");

            graphNodes.Add(Node27);

            CoverNode Node26 = new CoverNode(Node26Sub, "L938_26");

            graphNodes.Add(Node26);

            CoverNode Node25 = new CoverNode(Node25Sub, "L937_25");

            graphNodes.Add(Node25);


            CoverNode Node11 = new CoverNode(Node11Sub, "Blanket_EQ");

            graphNodes.Add(Node11);

            //Build Parent to Child Mapping
            List <GraphNode> Node11Children = new List <GraphNode>()
            {
                Node25, Node26, Node27
            };

            parentToChildrenMap.Add(Node11, Node11Children);

            List <GraphNode> Node27Children = new List <GraphNode>()
            {
                Node27B, Node27C, Node27BI
            };

            parentToChildrenMap.Add(Node27, Node27Children);

            AssignLevelToNode();

            TopNodes = new List <GraphNode>()
            {
                Node11
            };

            BuildAtomicRITEs();

            GraphReady = true;
        } //end of Initialize
Beispiel #18
0
 public PrimarySubject FormNewSubject(PrimarySubject s, ScheduleOfRITEs _schedule)
 {
     return(new PrimarySubject(_schedule, s.ExposureTypes, s.CauseOfLossSet));
 }
Beispiel #19
0
 public ScheduleInput(ScheduleOfRITEs _schedule, bool _isPerRisk = false)
 {
     Schedule  = _schedule;
     IsPerRisk = _isPerRisk;
 }
Beispiel #20
0
        public override void Initialize()
        {
            //Create Schedules
            ScheduleOfRITEs S16_EQ              = expdata.Schedules.ToList()[0]; //new Schedule("S16.EQ");
            ScheduleOfRITEs S16_EQ_5229         = expdata.Schedules.ToList()[1]; //new Schedule("S16.EQ.SubPolicy5229");
            ScheduleOfRITEs S16_EQ_5229_5228    = expdata.Schedules.ToList()[2]; //new Schedule("S16.EQ.SubPolicy5229.SubPolicy5228");
            ScheduleOfRITEs S16_EQ_5229_5228_46 = expdata.Schedules.ToList()[3]; //new Schedule("S16.EQ.SubPolicy5229.SubPolicy5228.46");
            ScheduleOfRITEs S16_EQ_5229_47      = expdata.Schedules.ToList()[4]; //new Schedule("S16.EQ.SubPolicy5229.47");
            ScheduleOfRITEs S16_EQ_48           = expdata.Schedules.ToList()[5]; //new Schedule("S16.EQ.48");

            //Create Subjects
            PrimarySubject Node53Sub = new PrimarySubject(S16_EQ_5229_5228_46, Building, EQ);
            PrimarySubject Node54Sub = new PrimarySubject(S16_EQ_5229_5228_46, Contents, EQ);
            PrimarySubject Node55Sub = new PrimarySubject(S16_EQ_5229_5228_46, BI, EQ);

            PrimarySubject Node56Sub = new PrimarySubject(S16_EQ_5229_47, Building, EQWS);
            PrimarySubject Node57Sub = new PrimarySubject(S16_EQ_5229_47, Contents, EQWS);
            PrimarySubject Node58Sub = new PrimarySubject(S16_EQ_5229_47, BI, EQWS);

            PrimarySubject Node59Sub = new PrimarySubject(S16_EQ_48, Building, EQWS);
            PrimarySubject Node60Sub = new PrimarySubject(S16_EQ_48, Contents, EQWS);
            PrimarySubject Node61Sub = new PrimarySubject(S16_EQ_48, BI, EQWS);

            PrimarySubject Node46Sub = new PrimarySubject(S16_EQ_5229_5228_46, Loss, EQ);
            PrimarySubject Node47Sub = new PrimarySubject(S16_EQ_5229_47, Loss, EQWS);
            PrimarySubject Node48Sub = new PrimarySubject(S16_EQ_48, Loss, EQWS);

            PrimarySubject NodeBSub = new PrimarySubject(S16_EQ, Building, EQWS);
            PrimarySubject NodeCSub = new PrimarySubject(S16_EQ, Contents, EQWS);

            PrimarySubject NodeBISub = new PrimarySubject(S16_EQ, BI, EQWS);

            PrimarySubject Node21Sub = new PrimarySubject(S16_EQ, Loss, EQWS);

            //Nodes
            TermNode Node53 = new TermNode(Node53Sub); //loccvg

            graphNodes.Add(Node53);
            TermNode Node54 = new TermNode(Node54Sub); //loccvg

            graphNodes.Add(Node54);
            TermNode Node55 = new TermNode(Node55Sub); //loccvg

            graphNodes.Add(Node55);

            TermNode Node56 = new TermNode(Node56Sub); //loccvg

            graphNodes.Add(Node56);
            TermNode Node57 = new TermNode(Node57Sub); //loccvg

            graphNodes.Add(Node57);
            TermNode Node58 = new TermNode(Node58Sub); //loccvg

            graphNodes.Add(Node58);

            TermNode Node59 = new TermNode(Node59Sub); //loccvg

            graphNodes.Add(Node59);
            TermNode Node60 = new TermNode(Node60Sub); //loccvg

            graphNodes.Add(Node60);
            TermNode Node61 = new TermNode(Node61Sub); //loccvg

            graphNodes.Add(Node61);

            //loc term
            TermNode Node46 = new TermNode(Node46Sub);  //loc

            graphNodes.Add(Node46);
            TermNode Node47 = new TermNode(Node47Sub);  //loc

            graphNodes.Add(Node47);
            TermNode Node48 = new TermNode(Node48Sub);  //loc

            graphNodes.Add(Node48);

            //policy coverage
            TermNode NodeB = new TermNode(NodeBSub);

            graphNodes.Add(NodeB);
            TermNode NodeC = new TermNode(NodeCSub);

            graphNodes.Add(NodeC);
            TermNode NodeBI = new TermNode(NodeBISub);

            graphNodes.Add(NodeBI);

            TermNode Node21 = new TermNode(Node21Sub);

            graphNodes.Add(Node21);

            //policy cover
            CoverNode Node11 = new CoverNode(Node21Sub, " L937_16");

            graphNodes.Add(Node11);

            //Build Parent to Child Mapping
            List <GraphNode> Node11Children = new List <GraphNode>()
            {
                Node21
            };

            parentToChildrenMap.Add(Node11, Node11Children);

            List <GraphNode> Node21Children = new List <GraphNode>()
            {
                Node46, Node47, Node48, NodeB, NodeC, NodeBI
            };

            parentToChildrenMap.Add(Node21, Node21Children);

            //List<GraphNode> Node32Children = new List<GraphNode>() { Node46, Node31, Node47 };
            //_parentToChildrenMap.Add(Node32, Node32Children);

            //List<GraphNode> Node31Children = new List<GraphNode>() { Node46 };
            //_parentToChildrenMap.Add(Node31, Node31Children);

            List <GraphNode> Node46Children = new List <GraphNode>()
            {
                Node53, Node54, Node55
            };

            parentToChildrenMap.Add(Node46, Node46Children);

            List <GraphNode> Node47Children = new List <GraphNode>()
            {
                Node56, Node57, Node58
            };

            parentToChildrenMap.Add(Node47, Node47Children);

            List <GraphNode> Node48Children = new List <GraphNode>()
            {
                Node59, Node60, Node61
            };

            parentToChildrenMap.Add(Node48, Node48Children);

            List <GraphNode> NodeBChildren = new List <GraphNode>()
            {
                Node53, Node56, Node59
            };

            parentToChildrenMap.Add(NodeB, NodeBChildren);

            List <GraphNode> NodeCChildren = new List <GraphNode>()
            {
                Node54, Node57, Node60
            };

            parentToChildrenMap.Add(NodeC, NodeCChildren);

            List <GraphNode> NodeBIChildren = new List <GraphNode>()
            {
                Node55, Node58, Node61
            };

            parentToChildrenMap.Add(NodeBI, NodeBIChildren);

            TopNodes = new List <GraphNode>()
            {
                Node11
            };
            AssignLevelToNode();
            BuildAtomicRITEs();
            GraphReady = true;
        } //end of Initialize
Beispiel #21
0
        public override void Initialize()
        {
            ////Build Graph here....
            //_graphNodes = new List<GraphNode>();
            //_parentToChildrenMap = new Dictionary<GraphNode, List<GraphNode>>();
            //_rites = new List<RITE>();
            //_schedules = new List<Schedule>();
            //_characteristics = new List<RITCharacteristic>();

            ////Add Contract Declarations
            //Declarations = new Declarations();

            ////Create RITECharacteristics
            //RITCharacteristic RITChar18 = new RITCharacteristic(19419518, ExposureType.Building, 100000);
            //RITCharacteristic RITChar19 = new RITCharacteristic(19419519, ExposureType.Contents, 10000);
            //RITCharacteristic RITChar20 = new RITCharacteristic(19419520, ExposureType.Building, 100000);
            //RITCharacteristic RITChar21 = new RITCharacteristic(19419521, ExposureType.Contents, 10000);
            //_characteristics.Add(RITChar18);
            //_characteristics.Add(RITChar19);
            //_characteristics.Add(RITChar20);
            //_characteristics.Add(RITChar21);

            ////Create RITEs
            //RITE rite57 = new RITE(11324657, 1);
            //rite57.AddCharacteristic(RITChar18);
            //rite57.AddCharacteristic(RITChar19);
            //RITE rite58 = new RITE(11324658, 1);
            //rite58.AddCharacteristic(RITChar20);
            //rite58.AddCharacteristic(RITChar21);
            //_rites.Add(rite57);
            //_rites.Add(rite58);

            ////Create Schedules
            //Schedule S2729_EQ = new Schedule("S2729.EQ");
            //S2729_EQ.AddRITE(rite57);
            //S2729_EQ.AddRITE(rite58);
            //_schedules.Add(S2729_EQ);

            //Schedule S2729_EQ_59491 = new Schedule("S2729.EQ.59491");
            //S2729_EQ_59491.AddRITE(rite57);
            //_schedules.Add(S2729_EQ_59491);

            //Schedule S2729_EQ_59492 = new Schedule("S2729.EQ.59492");
            //S2729_EQ_59492.AddRITE(rite58);
            //_schedules.Add(S2729_EQ_59492);

            //Create Schedules
            ScheduleOfRITEs S2729_EQ       = expdata.Schedules.ToList()[0];
            ScheduleOfRITEs S2729_EQ_59491 = expdata.Schedules.ToList()[1];
            ScheduleOfRITEs S2729_EQ_59492 = expdata.Schedules.ToList()[2];

            //Create Subjects
            PrimarySubject Node41Sub = new PrimarySubject(S2729_EQ_59491, Building, EQWS);
            PrimarySubject Node42Sub = new PrimarySubject(S2729_EQ_59491, Contents, EQWS);

            PrimarySubject Node31Sub = new PrimarySubject(S2729_EQ_59491, Loss, EQWS);
            PrimarySubject Node32Sub = new PrimarySubject(S2729_EQ_59492, Loss, EQWS);

            PrimarySubject Node21Sub = new PrimarySubject(S2729_EQ, Loss, EQWS);

            PrimarySubject Node01Sub = new PrimarySubject(null, null, null);

            Node01Sub.IsDerived = true;
            List <String> temp = new List <String>();

            temp.Add("Node11");
            Node01Sub.ChildrenCoverNodeList = temp;

            //TermNode Node41 = new TermNode(Node41Sub, false, false, 8000000, 10000000); //loccvg
            TermNode Node41 = new TermNode(Node41Sub); //loccvg

            graphNodes.Add(Node41);
            TermNode Node42 = new TermNode(Node42Sub);  //loccvg

            graphNodes.Add(Node42);

            //loc terms
            TermNode Node31 = new TermNode(Node31Sub); //loc

            graphNodes.Add(Node31);
            TermNode Node32 = new TermNode(Node32Sub); //loc

            graphNodes.Add(Node32);

            //policy term
            TermNode Node21 = new TermNode(Node21Sub);  //policy term, no limit term, so limit = 0?

            graphNodes.Add(Node21);

            //policy cover
            CoverNode Node11 = new CoverNode(Node21Sub, "L102_3222");  //policy layer

            graphNodes.Add(Node11);

            //treaty layer
            CoverNode Node01 = new CoverNode(Node01Sub, "OccLim");
            //_graphNodes.Add(Node01);

            //Build Parent to Child Mapping
            List <GraphNode> Node01Children = new List <GraphNode>()
            {
                Node11
            };

            parentToChildrenMap.Add(Node01, Node01Children);

            List <GraphNode> Node11Children = new List <GraphNode>()
            {
                Node21
            };

            parentToChildrenMap.Add(Node11, Node11Children);

            List <GraphNode> Node21Children = new List <GraphNode>()
            {
                Node31, Node32
            };

            parentToChildrenMap.Add(Node21, Node21Children);

            List <GraphNode> Node31Children = new List <GraphNode>()
            {
                Node41, Node42
            };

            parentToChildrenMap.Add(Node31, Node31Children);

            //raintest, add TopNode treaty term manually for now
            Cover topCover = new Cover("TreatyCover", false, new MonetaryValue(600.0), new MonetaryValue(1000000.0), new PercentValue(100), false, TimeBasis.Occurrence, TimeBasis.Occurrence, TermValueType.Numeric);

            Node01.Cover = topCover;
            //end of hack

            TopNodes = new List <GraphNode>()
            {
                Node01
            };
            GraphReady = true;
        } //end of Initialize
Beispiel #22
0
        public override void Initialize()
        {
            // //Create RITECharacteristics
            // RITCharacteristic RITChar18 = new RITCharacteristic(19419518, ExposureType.Building, 100000);
            // RITCharacteristic RITChar19 = new RITCharacteristic(19419519, ExposureType.Contents, 10000);
            // RITCharacteristic RITChar20 = new RITCharacteristic(19419520, ExposureType.Building, 100000);
            // RITCharacteristic RITChar21 = new RITCharacteristic(19419521, ExposureType.Contents, 10000);
            // _characteristics.Add(RITChar18);
            // _characteristics.Add(RITChar19);
            // _characteristics.Add(RITChar20);
            // _characteristics.Add(RITChar21);

            // //Create RITEs
            // RITE rite57 = new RITE(11324657, 1);
            // rite57.AddCharacteristic(RITChar18);
            // rite57.AddCharacteristic(RITChar19);
            // RITE rite58 = new RITE(11324658, 1);
            // rite58.AddCharacteristic(RITChar20);
            // rite58.AddCharacteristic(RITChar21);
            // _rites.Add(rite57);
            // _rites.Add(rite58);

            // //Create AtomicRITE
            //// AtomicRITE(string _subperil, ExposureType _expType, RITE _rite, long ID)
            // AtomicRITE aRite5718EQ = new AtomicRITE("EQ", ExposureType.Building, rite57, 19419518);
            // AtomicRITE aRite5718WS = new AtomicRITE("WS", ExposureType.Building, rite57, 19419518);
            // AtomicRITE aRite5719EQ = new AtomicRITE("EQ", ExposureType.Building, rite57, 19419519);
            // AtomicRITE aRite5719WS = new AtomicRITE("WS", ExposureType.Building, rite57, 19419519);
            // AtomicRITE aRite5820EQ = new AtomicRITE("EQ", ExposureType.Building, rite58, 19419520);
            // AtomicRITE aRite5820WS = new AtomicRITE("WS", ExposureType.Building, rite58, 19419520);
            // AtomicRITE aRite5821EQ = new AtomicRITE("EQ", ExposureType.Building, rite58, 19419521);
            // AtomicRITE aRite5821WS = new AtomicRITE("WS", ExposureType.Building, rite58, 19419521);

            // _atomicCoverageRITEs.Add(aRite5718EQ);
            // _atomicCoverageRITEs.Add(aRite5718WS);
            // _atomicCoverageRITEs.Add(aRite5719EQ);
            // _atomicCoverageRITEs.Add(aRite5719WS);
            // _atomicCoverageRITEs.Add(aRite5820EQ);
            // _atomicCoverageRITEs.Add(aRite5820WS);
            // _atomicCoverageRITEs.Add(aRite5821EQ);
            // _atomicCoverageRITEs.Add(aRite5821WS);

            //Create Schedules
            ScheduleOfRITEs S2729_EQ       = expdata.Schedules.ToList()[0];
            ScheduleOfRITEs S2729_EQ_59491 = expdata.Schedules.ToList()[1];
            ScheduleOfRITEs S2729_EQ_59492 = expdata.Schedules.ToList()[2];

            //Create Subjects
            PrimarySubject Node41Sub = new PrimarySubject(S2729_EQ_59491, Building, EQ);
            PrimarySubject Node42Sub = new PrimarySubject(S2729_EQ_59491, Contents, EQ);

            PrimarySubject Node31Sub = new PrimarySubject(S2729_EQ_59491, Loss, EQ);
            PrimarySubject Node32Sub = new PrimarySubject(S2729_EQ_59492, Loss, EQ);

            PrimarySubject Node21Sub = new PrimarySubject(S2729_EQ, Loss, EQ);

            ///////////// New Contructors for Node, for reading from JSON prototype///Sunny
            //Create Nodes and Add to Node List
            //loccvg terms
            //TermNode Node41 = new TermNode(Node41Sub, false, false, 8000000, 10000000); //loccvg
            TermNode Node41 = new TermNode(Node41Sub); //loccvg

            graphNodes.Add(Node41);
            TermNode Node42 = new TermNode(Node42Sub);  //loccvg

            graphNodes.Add(Node42);

            //loc terms
            TermNode Node31 = new TermNode(Node31Sub); //loc

            graphNodes.Add(Node31);
            TermNode Node32 = new TermNode(Node32Sub); //loc

            graphNodes.Add(Node32);

            //policy term
            TermNode Node21 = new TermNode(Node21Sub);  //policy term, no limit term, so limit = 0?

            graphNodes.Add(Node21);

            //policy cover
            CoverNode Node11 = new CoverNode(Node21Sub, "L102_3222");  //policy layer

            graphNodes.Add(Node11);

            //Build Parent to Child Mapping
            List <GraphNode> Node11Children = new List <GraphNode>()
            {
                Node21
            };

            parentToChildrenMap.Add(Node11, Node11Children);

            List <GraphNode> Node21Children = new List <GraphNode>()
            {
                Node31, Node32
            };

            parentToChildrenMap.Add(Node21, Node21Children);

            List <GraphNode> Node31Children = new List <GraphNode>()
            {
                Node41, Node42
            };

            parentToChildrenMap.Add(Node31, Node31Children);

            AssignLevelToNode();

            TopNodes = new List <GraphNode>()
            {
                Node11
            };

            BuildAtomicRITEs();

            GraphReady = true;
        } //end of Initialize
Beispiel #23
0
        public override void Initialize()
        {
            ////Build Graph here....
            //_graphNodes = new List<GraphNode>();
            //_parentToChildrenMap = new Dictionary<GraphNode, List<GraphNode>>();
            //_rites = new List<RITE>();
            //_schedules = new List<Schedule>();
            //_characteristics = new List<RITCharacteristic>();

            ////Add Contract Declarations
            //Declarations = new Declarations();

            ////Create RITECharacteristics
            //RITCharacteristic RITChar18 = new RITCharacteristic(19419518, ExposureType.Building, 100000);
            //RITCharacteristic RITChar19 = new RITCharacteristic(19419519, ExposureType.Contents, 10000);
            //RITCharacteristic RITChar20 = new RITCharacteristic(19419520, ExposureType.Building, 100000);
            //RITCharacteristic RITChar21 = new RITCharacteristic(19419521, ExposureType.Contents, 10000);
            //_characteristics.Add(RITChar18);
            //_characteristics.Add(RITChar19);
            //_characteristics.Add(RITChar20);
            //_characteristics.Add(RITChar21);

            ////Create RITEs
            //RITE rite57 = new RITE(11324657, 1);
            //rite57.AddCharacteristic(RITChar18);
            //rite57.AddCharacteristic(RITChar19);
            //RITE rite58 = new RITE(11324658, 1);
            //rite58.AddCharacteristic(RITChar20);
            //rite58.AddCharacteristic(RITChar21);
            //_rites.Add(rite57);
            //_rites.Add(rite58);

            ////Create Schedules
            //Schedule S2729_EQ = new Schedule("S2729.EQ");
            //S2729_EQ.AddRITE(rite57);
            //S2729_EQ.AddRITE(rite58);
            //_schedules.Add(S2729_EQ);

            //Schedule S2729_EQ_59491 = new Schedule("S2729.EQ.59491");
            //S2729_EQ_59491.AddRITE(rite57);
            //_schedules.Add(S2729_EQ_59491);

            //Schedule S2729_EQ_59492 = new Schedule("S2729.EQ.59492");
            //S2729_EQ_59492.AddRITE(rite58);
            //_schedules.Add(S2729_EQ_59492);

            //Create Schedules
            ScheduleOfRITEs S2729_EQ       = expdata.Schedules.ToList()[0];
            ScheduleOfRITEs S2729_EQ_59491 = expdata.Schedules.ToList()[1];
            ScheduleOfRITEs S2729_EQ_59492 = expdata.Schedules.ToList()[2];

            //Create Subjects
            PrimarySubject Node41Sub = new PrimarySubject(S2729_EQ_59491, Building, EQ);
            PrimarySubject Node42Sub = new PrimarySubject(S2729_EQ_59491, Contents, EQ);

            PrimarySubject Node31Sub = new PrimarySubject(S2729_EQ_59491, Loss, EQ);
            PrimarySubject Node32Sub = new PrimarySubject(S2729_EQ_59492, Loss, WS);

            PrimarySubject Node21Sub = new PrimarySubject(S2729_EQ, Loss, EQWS);

            //Create Nodes and Add to Node List
            //loccvg terms
            //TermNode Node41 = new TermNode(Node41Sub, false, false, 8000000, 10000000); //loccvg
            TermNode Node41 = new TermNode(Node41Sub); //loccvg

            graphNodes.Add(Node41);
            TermNode Node42 = new TermNode(Node42Sub);  //loccvg

            graphNodes.Add(Node42);

            //loc terms
            TermNode Node31 = new TermNode(Node31Sub); //loc

            graphNodes.Add(Node31);
            TermNode Node32 = new TermNode(Node32Sub); //loc

            graphNodes.Add(Node32);

            //policy term
            TermNode Node21 = new TermNode(Node21Sub);  //policy term, no limit term, so limit = 0?

            graphNodes.Add(Node21);

            //policy cover
            CoverNode Node11 = new CoverNode(Node21Sub, "L102_3222");  //policy layer

            graphNodes.Add(Node11);

            //Build Parent to Child Mapping
            List <GraphNode> Node11Children = new List <GraphNode>()
            {
                Node21
            };

            parentToChildrenMap.Add(Node11, Node11Children);

            List <GraphNode> Node21Children = new List <GraphNode>()
            {
                Node31, Node32
            };

            parentToChildrenMap.Add(Node21, Node21Children);

            List <GraphNode> Node31Children = new List <GraphNode>()
            {
                Node41, Node42
            };

            parentToChildrenMap.Add(Node31, Node31Children);

            TopNodes = new List <GraphNode>()
            {
                Node11
            };
            GraphReady = true;
        } //end of Initialize
Beispiel #24
0
        public override void Initialize()
        {
            ////Build Graph here....
            //_graphNodes = new List<GraphNode>();
            //_parentToChildrenMap = new Dictionary<GraphNode, List<GraphNode>>();
            //_rites = new List<RITE>();
            //_schedules = new List<Schedule>();
            //_characteristics = new List<RITCharacteristic>();
            //_atomicCoverageRITEs = new HashSet<AtomicRITE>();

            ////Add Contract Declarations
            //Declarations = new Declarations();

            ////Create RITECharacteristics
            ////Rite 11334
            //RITCharacteristic RITChar53 = new RITCharacteristic(3253, ExposureType.Building, 1000000);
            //RITCharacteristic RITChar54 = new RITCharacteristic(3254, ExposureType.Contents, 500000);
            //RITCharacteristic RITChar55 = new RITCharacteristic(3255, ExposureType.BI, 100000);

            ////Rite 11332
            //RITCharacteristic RITChar56 = new RITCharacteristic(3256, ExposureType.Building, 2000000);
            //RITCharacteristic RITChar57 = new RITCharacteristic(3257, ExposureType.Contents, 1000000);
            //RITCharacteristic RITChar58 = new RITCharacteristic(3258, ExposureType.BI, 500000);

            ////Rite 11333
            //RITCharacteristic RITChar59 = new RITCharacteristic(3259, ExposureType.Building, 500000);
            //RITCharacteristic RITChar60 = new RITCharacteristic(3260, ExposureType.Contents, 500000);
            //RITCharacteristic RITChar61 = new RITCharacteristic(3261, ExposureType.BI, 50000);

            //_characteristics.Add(RITChar53);
            //_characteristics.Add(RITChar54);
            //_characteristics.Add(RITChar55);
            //_characteristics.Add(RITChar56);
            //_characteristics.Add(RITChar57);
            //_characteristics.Add(RITChar58);
            //_characteristics.Add(RITChar59);
            //_characteristics.Add(RITChar60);
            //_characteristics.Add(RITChar61);

            ////Create RITEs
            //RITE rite34 = new RITE(11334, 1);
            //rite34.AddCharacteristic(RITChar53);
            //rite34.AddCharacteristic(RITChar54);
            //rite34.AddCharacteristic(RITChar55);

            //RITE rite32 = new RITE(11332, 1);
            //rite32.AddCharacteristic(RITChar56);
            //rite32.AddCharacteristic(RITChar57);
            //rite32.AddCharacteristic(RITChar58);

            //RITE rite33 = new RITE(11333, 1);
            //rite33.AddCharacteristic(RITChar59);
            //rite33.AddCharacteristic(RITChar60);
            //rite33.AddCharacteristic(RITChar61);

            //_rites.Add(rite32);
            //_rites.Add(rite33);
            //_rites.Add(rite34);

            ////Create AtomicRITE
            //// AtomicRITE(string _subperil, ExposureType _expType, RITE _rite, long ID)
            //AtomicRITE aRite3453EQ = new AtomicRITE("EQ", ExposureType.Building, rite34, 11334);
            //AtomicRITE aRite3454EQ = new AtomicRITE("EQ", ExposureType.Contents, rite34, 11334);
            //AtomicRITE aRite3455EQ = new AtomicRITE("EQ", ExposureType.BI, rite34, 11334);

            //AtomicRITE aRite3256EQ = new AtomicRITE("EQ", ExposureType.Building, rite32, 11332);
            //AtomicRITE aRite3257EQ = new AtomicRITE("EQ", ExposureType.Contents, rite32, 11332);
            //AtomicRITE aRite3258EQ = new AtomicRITE("EQ", ExposureType.BI, rite32, 11332);

            //AtomicRITE aRite3359EQ = new AtomicRITE("EQ", ExposureType.Building, rite33, 11333);
            //AtomicRITE aRite3360EQ = new AtomicRITE("EQ", ExposureType.Contents, rite33, 11333);
            //AtomicRITE aRite3361EQ = new AtomicRITE("EQ", ExposureType.BI, rite33, 11333);

            //_atomicCoverageRITEs.Add(aRite3453EQ);
            //_atomicCoverageRITEs.Add(aRite3454EQ);
            //_atomicCoverageRITEs.Add(aRite3455EQ);
            //_atomicCoverageRITEs.Add(aRite3256EQ);
            //_atomicCoverageRITEs.Add(aRite3257EQ);
            //_atomicCoverageRITEs.Add(aRite3258EQ);
            //_atomicCoverageRITEs.Add(aRite3359EQ);
            //_atomicCoverageRITEs.Add(aRite3360EQ);
            //_atomicCoverageRITEs.Add(aRite3361EQ);

            ////Create Schedules
            //Schedule S16_EQ = new Schedule("S16.EQ");
            //S16_EQ.AddRITE(rite32);
            //S16_EQ.AddRITE(rite33);
            //S16_EQ.AddRITE(rite34);
            //_schedules.Add(S16_EQ);

            //Schedule S16_EQ_5229 = new Schedule("S16.EQ.SubPolicy5229");
            //S16_EQ_5229.AddRITE(rite34);
            //S16_EQ_5229.AddRITE(rite32);
            //_schedules.Add(S16_EQ_5229);

            //Schedule S16_EQ_5229_5228 = new Schedule("S16.EQ.SubPolicy5229.SubPolicy5228");
            //S16_EQ_5229_5228.AddRITE(rite34);
            //_schedules.Add(S16_EQ_5229_5228);

            //Schedule S16_EQ_5229_5228_46 = new Schedule("S16.EQ.SubPolicy5229.SubPolicy5228.46");
            //S16_EQ_5229_5228.AddRITE(rite34);
            //_schedules.Add(S16_EQ_5229_5228_46);

            //Schedule S16_EQ_5229_47 = new Schedule("S16.EQ.SubPolicy5229.47");
            //S16_EQ_5229_5228.AddRITE(rite32);
            //_schedules.Add(S16_EQ_5229_47);

            //Schedule S16_EQ_48 = new Schedule("S16.EQ.48");
            //S16_EQ_48.AddRITE(rite33);
            //_schedules.Add(S16_EQ_48);

            //Create Schedules
            ScheduleOfRITEs S16_EQ              = expdata.Schedules.ToList()[0]; //new Schedule("S16.EQ");
            ScheduleOfRITEs S16_EQ_5229         = expdata.Schedules.ToList()[1]; //new Schedule("S16.EQ.SubPolicy5229");
            ScheduleOfRITEs S16_EQ_5229_5228    = expdata.Schedules.ToList()[2]; //new Schedule("S16.EQ.SubPolicy5229.SubPolicy5228");
            ScheduleOfRITEs S16_EQ_5229_5228_46 = expdata.Schedules.ToList()[3]; //new Schedule("S16.EQ.SubPolicy5229.SubPolicy5228.46");
            ScheduleOfRITEs S16_EQ_5229_47      = expdata.Schedules.ToList()[4]; //new Schedule("S16.EQ.SubPolicy5229.47");
            ScheduleOfRITEs S16_EQ_48           = expdata.Schedules.ToList()[5]; //new Schedule("S16.EQ.48");

            //Create Subjects
            PrimarySubject Node53Sub = new PrimarySubject(S16_EQ_5229_5228_46, Building, EQ);
            PrimarySubject Node54Sub = new PrimarySubject(S16_EQ_5229_5228_46, Contents, EQ);
            PrimarySubject Node55Sub = new PrimarySubject(S16_EQ_5229_5228_46, BI, EQ);

            PrimarySubject Node56Sub = new PrimarySubject(S16_EQ_5229_47, Building, EQ);
            PrimarySubject Node57Sub = new PrimarySubject(S16_EQ_5229_47, Contents, EQ);
            PrimarySubject Node58Sub = new PrimarySubject(S16_EQ_5229_47, BI, EQ);

            PrimarySubject Node59Sub = new PrimarySubject(S16_EQ_48, Building, EQ);
            PrimarySubject Node60Sub = new PrimarySubject(S16_EQ_48, Contents, EQ);
            PrimarySubject Node61Sub = new PrimarySubject(S16_EQ_48, BI, EQ);

            PrimarySubject Node46Sub = new PrimarySubject(S16_EQ_5229_5228_46, Loss, EQ);
            PrimarySubject Node47Sub = new PrimarySubject(S16_EQ_5229_47, Loss, EQ);
            PrimarySubject Node48Sub = new PrimarySubject(S16_EQ_48, Loss, EQ);

            PrimarySubject NodeBSub  = new PrimarySubject(S16_EQ, Building, EQ);
            PrimarySubject NodeCSub  = new PrimarySubject(S16_EQ, Contents, EQ);
            int            ii        = 4;
            PrimarySubject NodeBISub = new PrimarySubject(S16_EQ, BI, EQ);

            PrimarySubject Node21Sub = new PrimarySubject(S16_EQ, Loss, EQ);

            //Nodes
            TermNode Node53 = new TermNode(Node53Sub); //loccvg

            graphNodes.Add(Node53);
            TermNode Node54 = new TermNode(Node54Sub); //loccvg

            graphNodes.Add(Node54);
            TermNode Node55 = new TermNode(Node55Sub); //loccvg

            graphNodes.Add(Node55);

            TermNode Node56 = new TermNode(Node56Sub); //loccvg

            graphNodes.Add(Node56);
            TermNode Node57 = new TermNode(Node57Sub); //loccvg

            graphNodes.Add(Node57);
            TermNode Node58 = new TermNode(Node58Sub); //loccvg

            graphNodes.Add(Node58);

            TermNode Node59 = new TermNode(Node59Sub); //loccvg

            graphNodes.Add(Node59);
            TermNode Node60 = new TermNode(Node60Sub); //loccvg

            graphNodes.Add(Node60);
            TermNode Node61 = new TermNode(Node61Sub); //loccvg

            graphNodes.Add(Node61);

            //loc term
            TermNode Node46 = new TermNode(Node46Sub);  //loc

            graphNodes.Add(Node46);
            TermNode Node47 = new TermNode(Node47Sub);  //loc

            graphNodes.Add(Node47);
            TermNode Node48 = new TermNode(Node48Sub);  //loc

            graphNodes.Add(Node48);

            //policy coverage
            TermNode NodeB = new TermNode(NodeBSub);

            graphNodes.Add(NodeB);
            TermNode NodeC = new TermNode(NodeCSub);

            graphNodes.Add(NodeC);
            TermNode NodeBI = new TermNode(NodeBISub);

            graphNodes.Add(NodeBI);

            TermNode Node21 = new TermNode(Node21Sub);

            graphNodes.Add(Node21);

            //policy cover
            CoverNode Node11 = new CoverNode(Node21Sub, "L938_365");

            graphNodes.Add(Node11);

            //Build Parent to Child Mapping
            List <GraphNode> Node11Children = new List <GraphNode>()
            {
                Node21
            };

            parentToChildrenMap.Add(Node11, Node11Children);

            List <GraphNode> Node21Children = new List <GraphNode>()
            {
                Node46, Node47, Node48, NodeB, NodeC, NodeBI
            };

            parentToChildrenMap.Add(Node21, Node21Children);

            //List<GraphNode> Node32Children = new List<GraphNode>() { Node46, Node31, Node47 };
            //_parentToChildrenMap.Add(Node32, Node32Children);

            //List<GraphNode> Node31Children = new List<GraphNode>() { Node46 };
            //_parentToChildrenMap.Add(Node31, Node31Children);

            List <GraphNode> Node46Children = new List <GraphNode>()
            {
                Node53, Node54, Node55
            };

            parentToChildrenMap.Add(Node46, Node46Children);

            List <GraphNode> Node47Children = new List <GraphNode>()
            {
                Node56, Node57, Node58
            };

            parentToChildrenMap.Add(Node47, Node47Children);

            List <GraphNode> Node48Children = new List <GraphNode>()
            {
                Node59, Node60, Node61
            };

            parentToChildrenMap.Add(Node48, Node48Children);

            List <GraphNode> NodeBChildren = new List <GraphNode>()
            {
                Node53, Node56, Node59
            };

            parentToChildrenMap.Add(NodeB, NodeBChildren);

            List <GraphNode> NodeCChildren = new List <GraphNode>()
            {
                Node54, Node57, Node60
            };

            parentToChildrenMap.Add(NodeC, NodeCChildren);

            List <GraphNode> NodeBIChildren = new List <GraphNode>()
            {
                Node55, Node58, Node61
            };

            parentToChildrenMap.Add(NodeBI, NodeBIChildren);

            TopNodes = new List <GraphNode>()
            {
                Node11
            };
            AssignLevelToNode();
            BuildAtomicRITEs();
            GraphReady = true;
        } //end of Initialize
Beispiel #25
0
        public void UpdateGraphForPerRiskArrayForm()
        {
            HashSet <PrimarySubject> DistinctPerRiskSubjects = GetDistinctPerRiskSubjects();
            Dictionary <PrimarySubject, Dictionary <string, int> > PerRiskSubjectDict = new Dictionary <PrimarySubject, Dictionary <string, int> >();

            HashSet <PrimarySubject> ExplodedSubject = new HashSet <PrimarySubject>();

            //Now we have unique list of Per Risk Subject, just explode them
            foreach (PrimarySubject s in DistinctPerRiskSubjects)
            {
                Dictionary <string, int> temp = new Dictionary <string, int>();
                //explode them
                foreach (RITE rite in s.Schedule.ScheduleList)
                {
                    HashSet <RITE> aRite = new HashSet <RITE>();
                    aRite.Add(rite);
                    ScheduleOfRITEs newSchedule = new ScheduleOfRITEs("Exploded." + rite.ToString(), aRite, new HashSet <RITCharacteristic> {
                    });
                    PrimarySubject newSub       = FormNewSubject(s, newSchedule);
                    ExplodedSubjectList.Add(newSub);
                    temp.Add(newSchedule.Name, newSub.ID);
                }
                PerRiskSubjectDict.Add(s, temp);
            }

            foreach (PrimarySubject s in DistinctPerRiskSubjects)
            {
                foreach (PrimarySubject notPerRiskSub in OriginalSubjectsMinusPerRisk)
                {
                    //copy the result
                    if (SubjectTreeMatrix[s.ID, notPerRiskSub.ID] == SubjectCompareOutcome.Parent)
                    {
                        foreach (string rite in PerRiskSubjectDict[s].Keys)
                        {
                            SubjectTreeArray[PerRiskSubjectDict[s][rite]].Add(notPerRiskSub.ID, SubjectCompareOutcome.Parent);
                        }
                    }
                    else if (SubjectTreeMatrix[s.ID, notPerRiskSub.ID] == SubjectCompareOutcome.Child || SubjectTreeMatrix[s.ID, notPerRiskSub.ID] == SubjectCompareOutcome.Overlap)
                    {
                        foreach (string rite in PerRiskSubjectDict[s].Keys)
                        {
                            if (CompareTwoSchedules(s.Schedule, notPerRiskSub.Schedule) == SubjectCompareOutcome.Parent)
                            {
                                SubjectTreeArray[PerRiskSubjectDict[s][rite]].Add(notPerRiskSub.ID, SubjectCompareOutcome.Parent);
                            }
                        }
                    }
                }

                foreach (PrimarySubject other in DistinctPerRiskSubjects)
                {
                    if (s.ID != other.ID && SubjectTreeMatrix[s.ID, other.ID] == SubjectCompareOutcome.Parent)
                    {
                        foreach (string rite in PerRiskSubjectDict[s].Keys)
                        {
                            SubjectTreeArray[PerRiskSubjectDict[s][rite]].Add(PerRiskSubjectDict[other][rite], SubjectCompareOutcome.Parent);
                        }
                    }
                }
            }
        }
Beispiel #26
0
 public ScheduleInput()
 {
     Schedule  = new ScheduleOfRITEs(null);
     IsPerRisk = true;
 }