コード例 #1
0
        //Constructor, sets upper limit for number of species.
        public speciesattrs(int n = defines.MAX_SPECIES)
        {
            numAttrs    = 0;
            currentAttr = 0;
            maxAttrs    = n;

            spec_Attrs = new speciesattr[n];
            for (int i = 0; i < n; i++)
            {
                spec_Attrs[i] = new speciesattr();
            }
        }
コード例 #2
0
        //Returns the probability of reproduction of the given species on the land unit.
        //Species is referrenced by species attribute class.
        public float probRepro(speciesattr species_attr)
        {
            uint specAtNum = species_Attrs.NumAttrs;

            try
            {
                return(Establishment_probability_Attributes.get_probability(species_attr.Name, this.Name, PlugIn.ModelCore.TimeSinceStart));
            }
            //for (int i = 0; i < specAtNum; ++i)
            //{
            //    if (species_Attrs[i + 1].Name == species_attr.Name)
            //        return probReproduction[i];
            //}
            catch {
                throw new Exception("LANDUNIT::probRepro(SPECIESATTR*)-> Illegal spec. attr.");
            }
            // return 0.0f;
        }