Example #1
0
        /// <summary> Adds a WS_CrossPreds to WS_Pred(,) list. </summary>
        public void AddWS_Pred(Model[] model)
        {
            int numRadii = model.Length;
            int numWD    = model[0].downhill_A.Length;

            WS_CrossPreds[,] tempWS_Pred = new WS_CrossPreds[WS_PredCount, numRadii];

            for (int i = 0; i < WS_PredCount; i++)
            {
                for (int j = 0; j < numRadii; j++)
                {
                    tempWS_Pred[i, j] = WS_Pred[i, j];
                }
            }

            WS_Pred = new WS_CrossPreds[WS_PredCount + 1, numRadii];

            for (int i = 0; i <= WS_PredCount - 2; i++)
            {
                for (int j = 0; j < numRadii; j++)
                {
                    WS_Pred[i, j] = tempWS_Pred[i, j];
                }
            }

            if (WS_PredCount == 0)
            {
                for (int i = 0; i < numRadii; i++)
                {
                    WS_Pred[0, i]               = new WS_CrossPreds();
                    WS_Pred[0, i].model         = model[i];
                    WS_Pred[0, i].WS_Ests       = new double[2];
                    WS_Pred[0, i].percErr       = new double[2];
                    WS_Pred[0, i].sectorWS_Ests = new double[2, numWD];
                    WS_Pred[0, i].percErrSector = new double[2, numWD];
                }
            }
            else
            {
                for (int i = 0; i < numRadii; i++)
                {
                    WS_Pred[WS_PredCount - 1, i]               = new WS_CrossPreds();
                    WS_Pred[WS_PredCount - 1, i].model         = model[i];
                    WS_Pred[WS_PredCount - 1, i].WS_Ests       = new double[2];
                    WS_Pred[WS_PredCount - 1, i].percErr       = new double[2];
                    WS_Pred[WS_PredCount - 1, i].sectorWS_Ests = new double[2, numWD];
                    WS_Pred[WS_PredCount - 1, i].percErrSector = new double[2, numWD];
                }
            }
        }
Example #2
0
        /// <summary>  Returns wind speed cross-prediction estimate with specified model. </summary>
        public WS_CrossPreds GetWS_CrossPred(Model model)
        {
            WS_CrossPreds   thisCrossPred = new WS_CrossPreds();
            ModelCollection modelList     = new ModelCollection();

            for (int i = 0; i < WS_PredCount; i++)
            {
                for (int j = 0; j <= WS_Pred.GetUpperBound(1); j++)
                {
                    bool isSameModel = modelList.IsSameModel(model, WS_Pred[i, j].model);

                    if (isSameModel == true)
                    {
                        thisCrossPred = WS_Pred[i, j];
                        break;
                    }
                }
            }

            return(thisCrossPred);
        }