Exemplo n.º 1
0
        ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

        /// <summary> Generates wind speed estimates at referenced map node using each met and each Continuum model (i.e. each radius of investigation). </summary>
        public void DoMapCalcs(ref MapNode thisMapNode, Continuum thisInst)
        {
            MetCollection  metList     = thisInst.metList;
            int            numMetsUsed = metsUsed.Length;
            int            numRadii    = thisInst.radiiList.ThisCount;
            NodeCollection nodeList    = new NodeCollection();

            Met[] theseMets = metList.GetMets(metList.GetMetsUsed(), null);

            // For each met and each radius of investigation (i.e. each Continuum model), generate wind speed estimate at map node.
            for (int j = 0; j < numMetsUsed; j++)
            {
                for (int r = 0; r < numRadii; r++)
                {
                    int     thisRadius = thisInst.radiiList.investItem[r].radius;
                    WS_Ests newWS_Est  = new WS_Ests();
                    newWS_Est.predictorMetName = theseMets[j].name;
                    newWS_Est.radius           = thisRadius;
                    AddWS_Estimate(ref thisMapNode, ref newWS_Est);
                    int WS_Est_ind = thisMapNode.WS_Estimates.Length - 1;

                    Nodes targetNode = nodeList.GetMapAsNode(thisMapNode);
                    Nodes startNode  = nodeList.GetMetNode(theseMets[j]);

                    thisMapNode.WS_Estimates[WS_Est_ind].pathOfNodes = nodeList.FindPathOfNodes(startNode, targetNode, model[r], thisInst);
                    thisMapNode.WS_Estimates[WS_Est_ind].radius      = model[r].radius;
                    DoWS_EstAlongNodes(thisInst, ref thisMapNode, WS_Est_ind);
                }
            }
        }
Exemplo n.º 2
0
        /// <summary> Adds a wind speed estimate to the list of WS_Ests. </summary>
        public void AddWS_Estimate(ref MapNode thisMapNode, ref WS_Ests newWS_Est)
        {
            int newCount = 0;

            if (thisMapNode.WS_Estimates != null)
            {
                newCount = thisMapNode.WS_Estimates.Length;
            }
            else
            {
                newCount = 0;
            }

            if (newCount > 0)
            {
                Array.Resize(ref thisMapNode.WS_Estimates, newCount + 1);
                thisMapNode.WS_Estimates[newCount] = newWS_Est;
            }
            else
            {
                thisMapNode.WS_Estimates    = new WS_Ests[1];
                thisMapNode.WS_Estimates[0] = newWS_Est;
            }
        }