コード例 #1
0
        public IVectorEvent GetVectorTypeLosses(long ContractID)
        {
            IVectorEvent output;

            transformer = new GULossTransformer(mappers[ContractID]);

            if (lossType == GULossType.Dictionary)
            {
                output = transformer.DictToVector(drLossDict);
            }
            else if (lossType == GULossType.Vector)
            {
                output = drLossEvent;
            }
            else
            {
                throw new NotSupportedException();
            }

            if (convertToGU)
            {
                ConvertToGU(output.LossVector, mappers[ContractID]);
                //convertToGU = false;
            }

            FilterGULoss(output, ContractID);

            return(output);
        }
コード例 #2
0
        public Dictionary <string, Dictionary <int, Dictionary <long, Tuple <double, uint, List <float> > > > > GetDictTypeLosses(long ContractID)
        {
            Dictionary <string, Dictionary <int, Dictionary <long, Tuple <double, uint, List <float> > > > > output;

            transformer = new GULossTransformer(mappers[ContractID]);

            if (lossType == GULossType.Dictionary)
            {
                output = drLossDict;
            }
            else if (lossType == GULossType.Vector)
            {
                output = transformer.VectorToDict(drLossEvent);
            }
            else
            {
                throw new NotSupportedException();
            }

            if (convertToGU)
            {
                ConvertToGU(output, mappers[ContractID]);
                //convertToGU = false;
            }

            return(output);
        }
コード例 #3
0
        public IVectorEvent GenerateRITELoss(int eventID)
        {
            Dictionary <string, Dictionary <int, Dictionary <long, Tuple <double, uint, List <float> > > > > IntialGULoss;

            if (GUgenerator.GenerateRITELoss(eventID))
            {
                IntialGULoss = GUgenerator.GULosses;
            }
            else
            {
                throw new InvalidOperationException("Cannot get ground-up loss for event: " + eventID);
            }

            GULossTransformer transformer = new GULossTransformer(indexMapper);
            IVectorEvent      VectorGU    = transformer.DictToVector(IntialGULoss);

            return(VectorGU);
        }