예제 #1
0
        private List <GraphNode> GetTermNodes(PrimaryContractExtractor contract, List <PrimarySubject> graphSubs)
        {
            List <GraphNode> termNodes = new List <GraphNode>();

            foreach (PrimarySubject sub in graphSubs)
            {
                TermNode node = new TermNode(sub);

                DeductibleCollection Deds;
                if (contract.GetDeductiblesForSubject(sub, out Deds))
                {
                    node.Deductibles = Deds;
                }

                LimitCollection Lims;
                if (contract.GetLimitsForSubject(sub, out Lims))
                {
                    node.Limits = Lims;
                }

                termNodes.Add(node);
            }

            return(termNodes);
        }
예제 #2
0
        private AutoGraphStyle GetGraphStyle(ContractExtractor contract)
        {
            if (contract.IsTreaty)
            {
                return(AutoGraphStyle.Node);
            }
            else
            {
                PrimaryContractExtractor primaryContract = contract as PrimaryContractExtractor;

                List <PrimarySubject> primarysubjects = primaryContract.GetAllTermSubjects();

                foreach (PrimarySubject priSub in primarysubjects)
                {
                    DeductibleCollection dedCol;
                    if (primaryContract.GetDeductiblesForSubject(priSub, out dedCol))
                    {
                        foreach (Deductible ded in dedCol)
                        {
                            if (ded.DedInterType == DedInteractionType.SingleLargest)
                            {
                                return(AutoGraphStyle.Node);
                            }

                            if (ded.DedType == TermValueType.PercentAffected || ded.DedType == TermValueType.PercentLoss)
                            {
                                return(AutoGraphStyle.Node);
                            }
                        }
                    }
                }

                return(AutoGraphStyle.Matrix);
            }
        }