Esempio n. 1
0
        public void Run()
        {
            //Get GULoss for Residule subjects for the lowest cover level
            float[] GULossVector = Event.LossVector;

            int NumOfResidules = graph.GetCoverResiduleInfo().NumOfResidules;

            int[] ResiduleIndicies = graph.GetCoverResiduleInfo().GetGULossIndicies();
            int   uniqueIndex;

            float[] ResiduleSubjectLoss = graphstate.GetLowestCoverLevelResiduleState().GetSubjectLoss();

            for (int i = 0; i < NumOfResidules; i++)
            {
                uniqueIndex            = ResiduleIndicies[i];
                ResiduleSubjectLoss[i] = GULossVector[uniqueIndex];
            }

            //Get Recoverable for Arite subjects for the lowest cover level
            float[] AriteSubjectLoss = graphstate.GetLowestCoverLevelAriteState().GetSubjectLoss();
            int     NumOfArites      = graph.GetCoverAriteInfo().NumOfARITEs;

            int[] RecoverLevelIndex = graph.GetCoverAriteInfo().GetRecoverableLevelIndex();
            int[] RecoverIndices    = graph.GetCoverAriteInfo().GetRecoverableIndicies();
            int[] AriteGULosses     = new int[NumOfArites];

            for (int i = 0; i < NumOfArites; i++)
            {
                AriteSubjectLoss[i] = graphstate.GetARITELevelState(RecoverLevelIndex[i]).GetRecoverable()[RecoverIndices[i]];
                AriteGULosses[i]    = graph.GetAtomicRITEInfo(RecoverLevelIndex[i]).GetGULossIndicies()[RecoverIndices[i]];
            }
        }
        }  //DoTermLevels

        public void DoLowestCoverLevel(float[] FactorVector)
        {
            int level = graph.LowestCoverLevel;
            LowestCoverLevelInfo lowestCoverLevelInfo = graph.GetLowestCoverLevelInfo();

            int[]   aRiteFactorsIndex        = lowestCoverLevelInfo.LeafCoveraRiteFactorsIndex;
            int[]   residulaRiteFactorsIndex = lowestCoverLevelInfo.LeafCoverResidualFactorsIndex;
            float[] aRiteFactors             = graphstate.GetLowestCoverLevelAriteState().GetFactors();
            float[] residualFactors          = graphstate.GetLowestCoverLevelResiduleState().GetFactors();

            int aRiteNum = aRiteFactorsIndex.Count();
            int rRiteNum = residulaRiteFactorsIndex.Count();

            for (int i = 0; i < aRiteNum; i++)
            {
                int uniqueIndex = aRiteFactorsIndex[i];
                if (uniqueIndex == -1)
                {
                    aRiteFactors[i] = 1;
                }
                else
                {
                    aRiteFactors[i] = FactorVector[uniqueIndex];
                }
            }

            for (int i = 0; i < rRiteNum; i++)
            {
                int uniqueIndex = residulaRiteFactorsIndex[i];
                if (uniqueIndex == -1)
                {
                    residualFactors[i] = 1;
                }
                else
                {
                    residualFactors[i] = FactorVector[uniqueIndex];
                }
            }
        }
Esempio n. 3
0
        public void Run()
        {
            TotalCoverState           = graphState.GetTotalCoverState();
            TotalPayoutState          = TotalCoverState.GetPayout();
            TotalAllocatedPayoutState = TotalCoverState.GetAllocatedPayout();

            int lowestCoverLevel = Graph.LowestCoverLevel;
            int NumOfCoverLevels = Graph.NumOfCoverLevels;
            int TopCoverLevel    = lowestCoverLevel + NumOfCoverLevels;

            //1. top covers, simply copy (no allocation)
            ChildrenCoverLevelAggInfo = Graph.GetCoverNodeAggInfo(TopCoverLevel);
            ParentCoverLevelAggInfo   = Graph.GetCoverNodeAggInfo(TopCoverLevel);
            CopyTopCoverLevelPayout();

            //2. leafTopCovers
            LeafTopCoverList = Graph.GetCoverNodeAggInfo(lowestCoverLevel + 1).GetLeafTopCoverList();
            CopyLeafTopCoverPayout();

            //3. Allocate Cover Graph Payout
            for (int i = TopCoverLevel; i > lowestCoverLevel + 1; i--)
            {
                ChildrenCoverLevelAllocationState = graphState.GetCoverLevelAllocationRatioState(i - 1);
                ChildrenCoverLevelAggInfo         = Graph.GetCoverNodeAggInfo(i - 1);
                ParentCoverLevelAggInfo           = Graph.GetCoverNodeAggInfo(i);
                AllocateToOneCoverLevel();
            }

            //4. Allocate Leaf Cover to lowest cover level, Atomic Rites and residual
            LowestCoverLevelAriteAllocationRatio    = graphState.GetLowestCoverLevelAriteAllocationRatio();
            LowestCoverLevelResidualAllocationRatio = graphState.GetLowestCoverLevelResidualAllocationRatio();
            ResiduleInfo            = Graph.GetCoverResiduleInfo();
            AriteInfo               = Graph.GetCoverAriteInfo();
            ResiduleState           = graphState.GetLowestCoverLevelResiduleState();
            AriteState              = graphState.GetLowestCoverLevelAriteState();
            ParentCoverLevelAggInfo = Graph.GetCoverNodeAggInfo(lowestCoverLevel + 1);  //leaf cover level
            AllocateToLowestCoverLevel();
        }