Esempio n. 1
0
        public HARVESTSites(int r, int c)
        {
            int x;

            m_iRows = r;
            m_iCols = c;
            map     = new HARVESTSite[r * c]; //Add by Qia Nov 07 2008
            for (int i = 0; i < r * c; i++)
            {
                map[i] = new HARVESTSite();
            }

            BA_harvest_output      = new double[r * c];
            BA_harvest_output_spec = new double[BoundedPocketStandHarvester.pCoresites.SpecNum][];

            for (int i = 0; i < BoundedPocketStandHarvester.pCoresites.SpecNum; i++)
            {
                BA_harvest_output_spec[i] = new double[r * c];
            }

            if (map == null)
            {
                throw new Exception("No Memory for harvestSite map");
            }
            HARVESTSite site;

            sitetouse = new HARVESTSite();
            //int classsize = sizeof(HARVESTSite);

            for (int i = 1; i <= r; i++)
            {
                for (int j = 1; j <= c; j++)
                {
                    site                         = new HARVESTSite();
                    site.lastHarvest             = 0;
                    site.harvestType             = 0;
                    site.harvestExpirationDecade = 0;
                    site.itsMaxAge               = 0;
                    site.updateFlag              = 1;
                    site.numofsites              = r * c;
                    x      = (i - 1) * m_iCols;
                    x      = x + j - 1;
                    map[x] = site;
                    BA_harvest_output[x] = 0.0;
                }
            }
            for (int i_spec = 0; i_spec < BoundedPocketStandHarvester.pCoresites.SpecNum; i_spec++)
            {
                for (int i = 1; i <= r; i++)
                {
                    for (int j = 1; j <= c; j++)
                    {
                        x = (i - 1) * m_iCols;
                        x = x + j - 1;
                        BA_harvest_output_spec[i_spec][x] = 0.0;
                    }
                }
            }
        }
Esempio n. 2
0
 //same as operator=  in C++ version
 public HARVESTSite CopyFrom(HARVESTSite site)
 {
     itsMaxAge               = site.itsMaxAge;
     updateFlag              = site.updateFlag;
     harvestType             = site.harvestType;
     lastHarvest             = site.lastHarvest;
     harvestExpirationDecade = site.harvestExpirationDecade;
     numofsites              = 1;
     return(this);
 }