Example #1
0
        private InteractionObject[] GetInterObj(TermNode currNode, Aggregation aggType, List <TermNode> childrenNodes)
        {
            InteractionObject[] InterObj = new InteractionObject[currNode.CurrentLossStateCollection.NumBldgs];
            for (int i = 0; i < currNode.CurrentLossStateCollection.NumBldgs; i++)
            {
                InterObj[i] = new InteractionObject();
            }

            foreach (TermNode childNode in childrenNodes)
            {
                //if (currNode.TermIsPerRisk && currNode.CurrentLossStateCollection.NumBldgs > 1)
                if (aggType == Aggregation.PerBuilding)
                {
                    for (int i = 0; i < currNode.CurrentLossStateCollection.NumBldgs; i++)
                    {
                        InterObj[i].UpdateInterObjState(childNode.CurrentLossStateCollection.collection[i]);
                    }
                }
                else
                {
                    LossState childLossesState = new LossState(childNode.CurrentLossStateCollection.GetTotalSum);
                    InterObj[0].UpdateInterObjState(childLossesState);
                }
            }  //foreach child
            return(InterObj);
        }
Example #2
0
 public LossState(LossState inputLossesState)
 {
     S = inputLossesState.S;
     X = inputLossesState.X;
     R = inputLossesState.R;
     D = inputLossesState.D;
 }
Example #3
0
        public static LossState operator +(LossState loss1, LossState loss2)
        {
            LossState sum = new LossState();

            sum.S = loss1.S + loss2.S;
            sum.X = loss1.X + loss2.X;
            sum.D = loss1.D + loss2.D;
            sum.R = loss1.R + loss2.R;
            return(sum);
        }
Example #4
0
        public LossState CopyToLossState()
        {
            LossState copiedState = new LossState();

            copiedState.D = D;
            copiedState.X = X;
            copiedState.R = R;
            copiedState.S = S;

            return(copiedState);
        }
Example #5
0
 public void UpdateInterObjStateForARITE(LossState inputLossState)
 {
     DedFromChildren       += inputLossState.D;
     ExcessFromChildren    += inputLossState.X;
     LargestDedFromChildren = Math.Max(LargestDedFromChildren, inputLossState.D);
 }