示例#1
0
 /// <summary>
 ///		Initialize a cYearList by specifying the number of years.  Winter types
 ///		are generated randomly with a bias toward the type specified by the
 ///		'WinterBias' parameter.  If YearRnd is null, the winters are generated as
 ///		soon as the YearRnd property is set.
 /// </summary>
 /// <param name="NYears">
 ///		The number of years to place in the list.  An ArgumentException is raised
 ///		if NYears is less than or equal to zero.
 /// </param>
 /// <param name="WinterBias">
 ///		The bias of the randomly generated winter types.  Options include Very Severe,
 ///		Severe, Normal, Mild, and Very Mild.
 /// </param>
 public cYearList(int NYears, cUniformRandom YearRnd, enumWinterType WinterBias)
 {
     // make sure nYears > 0
     if (NYears <= 0)
     {
         ThrowNYearsException();
     }
     // store random number generator
     _yearRnd = YearRnd;
     // create the list
     Values = new List <cYear>();
     // create the object
     if (_yearRnd != null)
     {
         GenerateYearsRandom(WinterBias, NYears);
     }
     else
     {
         GenerateYearsOnRandomSet = true;
         GenerateYearsWinterType  = WinterBias;
         GenerateYearsNYears      = NYears;
     }
     // initialize to first year
     mvarCurrentYearNum = 0;
 }
示例#2
0
        /// <summary>
        ///  YM :
        ///		This function is used to determine the reproduction week.
        ///		It is a probability function distribution value
        ///     assuming a Gaussian distribuion, where the Mean and the Variance were given by the user.
        /// </summary>
        /// <returns> The value of the reproduction week.</returns>
        public override int ComputeReproductionWeekGaussian2()
        {
            Double FoxReproductionWeekMeanDouble     = Convert.ToDouble((this.Background as cFoxBackground).FoxReproductionWeekMean2);
            Double FoxReproductionWeekVarianceDouble = Convert.ToDouble((this.Background as cFoxBackground).FoxReproductionWeekVariance2);

            int FoxReproductionWeekInt = (int)FoxReproductionWeekMeanDouble;

            if (FoxReproductionWeekMeanDouble > 0)
            {
                // if the variance > 0, calculate the reproduction week, otherwise, the reproduction week is fixed
                if (FoxReproductionWeekVarianceDouble > 0)
                {
                    cRandomBase     rnd = new cUniformRandom();
                    cGaussianRandom RandomGaussianValue = new cGaussianRandom(FoxReproductionWeekMeanDouble, FoxReproductionWeekVarianceDouble, rnd);
                    do
                    {
                        FoxReproductionWeekInt = (int)RandomGaussianValue.Value;
                    } while (FoxReproductionWeekInt < 0 || FoxReproductionWeekInt > 52);
                }
            }

            return(FoxReproductionWeekInt);

            //System.Diagnostics.Debug.WriteLine("cFox.cs: FoxReproductionWeekInt");
        }
示例#3
0
 // *********************** Constructor *******************************************
 /// <summary>
 ///		Initialize a disease list.
 /// </summary>
 /// <param name="ScrambleRandom">A random number generator to use if the list is to be scrambled</param>
 public cDiseaseList(cUniformRandom ScrambleRandom)
 {
     // create the list of values
     Values = new cIndexedHashTable(ScrambleRandom);
     //System.Diagnostics.Debug.WriteLine("");
     //System.Diagnostics.Debug.WriteLine("cDiseaseList: cDiseaseList");
 }
示例#4
0
 // ******************** Constructors *******************************************
 /// <summary>
 ///		The default constructor.
 /// </summary>
 public cIndexedHashTable(cUniformRandom ScrambleRnd)
 {
     // build an array list of keys.  This is how we keep things in numeric order
     KeysByIndex = new List <string>();
     Values      = new Hashtable();
     // a counter for generating unique key values if user adds an item without
     // specifying a key value.
     AddNum             = 0;
     mvarScrambleRandom = ScrambleRnd;
 }
        /// <summary>
        ///		Initialize the background, passing a list of years and a seed for all
        ///		random number generators in the model.  This is an internal constructor
        ///		and may only be used by classes within the Rabies_Model_Core namespace.
        /// </summary>
        /// <param name="Rnd">The random number generator to be used by the background</param>
        /// <param name="Name">
        ///		The name to assign to this background.  An ArgumentException is raised if
        ///		Name is zero length.
        ///	</param>
        /// <param name="KeepAllAnimals">
        ///		A flag indicating whether a record of all animals should be kept during
        ///		a run.
        ///	</param>
        /// <param name="YList">
        ///		The list of years.  An ArgumentException exception is raised if YList is empty.
        ///	</param>
        ///	<param name="DList">
        ///		A list of diseases that will affect the animals in this background.
        ///	</param>
        public cBackground(cUniformRandom Rnd, string Name, bool KeepAllAnimals, cYearList YList, cDiseaseList DList)
        {
            if (Rnd == null)
            {
                throw new ArgumentNullException("Rnd");
            }
            if (YList == null)
            {
                throw new ArgumentNullException("YList");
            }
            if (DList == null)
            {
                throw new ArgumentNullException("DList");
            }

            // make sure that Name is not zero length
            if (string.IsNullOrEmpty(Name))
            {
                throw new ArgumentException("Name must not be zero length.", "Name");
            }
            // make sure the Years list contains at least one year
            if (YList.Count == 0)
            {
                throw new ArgumentException("Year list must contain at least one year.",
                                            "Years");
            }
            // create the random number generator
            RandomNum          = Rnd;
            RandomNum.MinValue = 0;
            RandomNum.MaxValue = 100;
            // copy the name
            this.Name = Name;
            // create a super cell list
            SuperCells = new cSuperCellList();
            // create a master cell list
            Cells = new cMasterCellList(this, RandomNum);
            // generate winter and animal lists
            Years         = YList;
            Years.YearRnd = RandomNum;
            // create the master list of animals
            Animals = new cMasterAnimalList(1, KeepAllAnimals, RandomNum);
            // create the list of diseases
            Diseases = DList;
            // create the strategy list
            Strategies      = new cStrategyList();
            StrategyCounter = 0;
            // set have run weekly events to false
            mvarHaveRunWeeklyEvents = false;
            // scramble list is false by default
            ScrambleList = false;
            // abort on disease disappearance is true by default
            AbortOnDiseaseDisappearance = true;
            // prevent incest flag - set to false by default
            PreventIncest = false;
        }
示例#6
0
 /// <summary>
 ///		Create an empty cYear list.  This constructor is Internal and can only be
 ///		called by objects that are within the Rabies_Model_Core namespace.
 /// </summary>
 internal cYearList(cUniformRandom YearRnd)
 {
     if (YearRnd == null)
     {
         throw new ArgumentNullException("YearRnd");
     }
     // create the list
     Values = new List <cYear>();
     // initialize to "first" year
     mvarCurrentYearNum = 0;
 }
 /// <summary>
 ///		Create a read-only rabies model datasource combining a passed cells datasource
 ///		and a passed animals datasource.
 /// </summary>
 /// <param name="Rnd">The random number generator to be used by the generated background</param>
 /// <param name="Cells">
 ///		The cells datasource.  An ArgumentNullException exception is raised if Cells
 ///		is null.
 ///	</param>
 /// <param name="Animals">
 ///		The animals datasource.  An ArgumentNullException exception is raised if Animals
 ///		is null.
 ///	</param>
 public cModelDataSource(cUniformRandom Rnd, cCellsDataSource Cells, cAnimalsDataSource Animals)
 {
     // set the values
     mvarCells   = Cells;
     mvarAnimals = Animals;
     mvarRnd     = Rnd;
     // make sure that they are valid
     CheckCells();
     CheckAnimals();
     CheckRandom();
 }
 // ************************** Constructors *************************************
 /// <summary>
 ///		Initialize the master cell list.
 /// </summary>
 /// <param name="Background">
 ///		The background object that owns this master cell list.  An ArgumentNullEception
 ///		exception is raised if Background is null.
 /// </param>
 /// <param name="ScrambleRandom">A random number generator to use if the list is to be scrambled</param>
 public cMasterCellList(cBackground Background, cUniformRandom ScrambleRandom)
     : base(ScrambleRandom)
 {
     // make sure background is valid
     if (Background == null)
     {
         throw new ArgumentNullException("Background",
                                         "Background must reference a valid background object.");
     }
     // set the background
     mvarBackground = Background;
 }
 // ******************* Constructors *********************************************
 /// <summary>
 ///		Initialize a Master animal list.
 /// </summary>
 /// <param name="Background">
 ///		The background object that owns this master list.  An ArgumentNullEception
 ///		exception is raised if Background is null.
 ///	</param>
 /// <param name="StartingID">
 ///		The numeric value of the first animal ID generated when the model is run.
 ///	</param>
 ///	<param name="KeepAllAnimals">
 ///		A flag indicating whether animals should remain in the database after they
 ///		die.
 ///	</param>
 /// <param name="ScrambleRandom">A random number generator to use if the list is to be scrambled</param>
 public cMasterAnimalList(int StartingID, bool KeepAllAnimals, cUniformRandom ScrambleRandom)
     : base(ScrambleRandom)
 {
     mvarIDManager        = new cIDManager(StartingID);
     mvarIDManager.Prefix = "";
     mvarIDManager.Suffix = "";
     mvarKeepAllAnimals   = KeepAllAnimals;
     if (mvarKeepAllAnimals)
     {
         mvarAllAnimals = new cAnimalList(ScrambleRandom);
     }
     Babies = new cAnimalList(null);
 }
示例#10
0
 /// <summary>
 ///		Initialize a cYearList by passing a list of winter types.  One year is
 ///		added to the list for each value in the cWinterTypeList.  An ArgumentException
 ///		exception is raised if the passed list of winter types is empty.
 /// </summary>
 /// <param name="WTList">The list of winter types.</param>
 public cYearList(cWinterTypeList WTList, cUniformRandom YearRnd)
 {
     if (WTList == null)
     {
         throw new ArgumentNullException("WTList");
     }
     // create the list
     Values = new List <cYear>();
     // add the years.  Exception will be raised in this method if WTList is empty
     AddYearsFromList(WTList);
     // initialize to first year
     mvarCurrentYearNum = 0;
 }
 /// <summary>
 ///		Create a read-only rabies model datasource from a passed cells datasource,
 ///		a passed wintertype list and a single animal.
 /// </summary>
 /// <param name="Rnd">The random number generator to be used by the generated background</param>
 /// <param name="Cells">
 ///		The cells datasource.  An ArgumentNullException exception is raised if Cells
 ///		is null.
 ///	</param>
 /// <param name="Winters">
 ///		The list of winter types.  An ArgumentNullException exception is raised if
 ///		Winters is null.  An ArgumentException exception is raised if Winter is an
 ///		empty list.
 ///	</param>
 ///	<param name="MaleMarkers">
 ///	    The markers for the seed male animal
 /// </param>
 /// <param name="FemaleMarkers">
 ///     The markers for the seed female animal
 /// </param>
 public cModelDataSource(cUniformRandom Rnd, cCellsDataSource Cells, cWinterTypeList Winters,
                         string MaleMarkers, string FemaleMarkers)
 {
     // set the values
     mvarCells   = Cells;
     mvarWinters = Winters;
     mvarRnd     = Rnd;
     // make sure that they a valid
     CheckCells();
     CheckWinterTypes();
     CheckRandom();
     // get markers
     mvarMaleMarkers   = MaleMarkers;
     mvarFemaleMarkers = FemaleMarkers;
 }
        /// <summary>
        /// Constructors
        /// </summary>
        /// <param name="SpreadProbability">The probability of spread</param>
        /// <param name="Rnd">The random number generator used to calculate spread probabilities</param>
        /// <param name="ChanceOfDeath">The % chance that an infection from this disease is fatal</param>
        /// <param name="RecoveredBecomeImmune">A flag indicating that recovered animal become immune</param>
        /// <param name="RecoveredNotInfectious">A flag the indicates that aninmals that recover from this disease will not become infectious</param>
        /// <param name="TrialSettings">The trial settings dataset</param>
        public cBatchRabies(double SpreadProbability, cUniformRandom Rnd, int ChanceOfDeath, bool RecoveredBecomeImmune, bool RecoveredNotInfectious, DataSet TrialSettings)
            : base(SpreadProbability, Rnd, ChanceOfDeath, RecoveredBecomeImmune, RecoveredNotInfectious)
        {
            // get datatables containing Incubation and Infectious Periods
            DataTable dtIncubation = TrialSettings.Tables["DiseaseInformationIncubationPeriodNormalized"];
            DataTable dtInfectious = TrialSettings.Tables["DiseaseInformationInfectiousPeriodNormalized"];

            // read Incubation and Infectious period arrays
            for (int i = 0; i <= 49; i++)
            {
                DataRow dr = dtIncubation.Rows[i];
                Incubation[i] = Convert.ToDouble(dr["Value"]);
                dr            = dtInfectious.Rows[i];
                Infection[i]  = Convert.ToDouble(dr["Value"]);
            }
        }
 /// <summary>
 ///		Create a read-only rabies model datasource from a passed cells datasource with
 ///		NYears years with the passed winter bias.
 /// </summary>
 /// <param name="Rnd">The random number generator to be used by the generated background</param>
 /// <param name="Cells">
 ///		The cells datasource.  An ArgumentNullException exception is raised if Cells
 ///		is null.
 ///	</param>
 /// <param name="NYears">
 ///		The number of years to create.  An ArgumentOutOfRangeException exception is
 ///		raised if NYears is less than one.
 ///	</param>
 /// <param name="WinterBias">The winter type bias for those years.</param>
 ///	<param name="MaleMarkers">
 ///	    The markers for the seed male animal
 /// </param>
 /// <param name="FemaleMarkers">
 ///     The markers for the seed female animal
 /// </param>
 public cModelDataSource(cUniformRandom Rnd, cCellsDataSource Cells, int NYears, enumWinterType WinterBias,
                         string MaleMarkers, string FemaleMarkers)
 {
     // set the values
     mvarCells      = Cells;
     mvarYears      = NYears;
     mvarWinterBias = WinterBias;
     mvarRnd        = Rnd;
     // make sure that they are valid
     CheckCells();
     CheckNYears();
     CheckRandom();
     // get markers
     mvarMaleMarkers   = MaleMarkers;
     mvarFemaleMarkers = FemaleMarkers;
 }
 /// <summary>
 ///		Initialize the background specifying the initial number of years and their
 ///		winter bias.
 /// </summary>
 /// <param name="Rnd">The random number generator to be used by the background</param>
 /// <param name="Name">
 ///		The name to assign to this background.  An ArgumentException is raised if
 ///		Name is zero length.
 ///	</param>
 /// <param name="KeepAllAnimals">
 ///		A flag indicating whether a record of all animals should be kept during
 ///		a run.
 ///	</param>
 /// <param name="NYears">
 ///		The initial number of years. An ArgumentException is raised in NYears is
 ///		less than or equal to zero.
 ///	</param>
 /// <param name="WinterBias">The winter bias of the initial years.</param>
 public cBackground(cUniformRandom Rnd, string Name, bool KeepAllAnimals, int NYears, enumWinterType WinterBias)
 {
     if (Rnd == null)
     {
         throw new ArgumentNullException("Rnd");
     }
     // reference the random number generator
     RandomNum          = Rnd;
     RandomNum.MinValue = 0;
     RandomNum.MaxValue = 100;
     // make sure that Name is not zero length
     if (string.IsNullOrEmpty(Name))
     {
         throw new ArgumentException("Name must not be zero length.", "Name");
     }
     // make sure NYears > 0
     if (NYears <= 0)
     {
         throw new ArgumentException("NYears must be greater than 0.", "NYears");
     }
     // copy the name
     this.Name = Name;
     // create a super cell list
     SuperCells = new cSuperCellList();
     // create a master cell list
     Cells = new cMasterCellList(this, RandomNum);
     // create list of years
     Years = new cYearList(NYears, RandomNum, WinterBias);
     // create the master list of animals
     Animals = new cMasterAnimalList(1, KeepAllAnimals, RandomNum);
     // create the list of diseases
     Diseases = new cDiseaseList(RandomNum);
     // create the strategy list
     Strategies      = new cStrategyList();
     StrategyCounter = 0;
     // set have run weekly events to false
     mvarHaveRunWeeklyEvents = false;
     // scramble list is false by default
     ScrambleList = false;
     // abort on disease disappearance is true by default
     AbortOnDiseaseDisappearance = true;
     // prevent incest flag - set to false by default
     PreventIncest = false;
 }
    {       /// <summary>
        ///		Initialize a Disease.
        /// </summary>
        /// <param name="Name">
        ///		The name of the disease.  An ArgumentException exception is raised if Name has
        ///		zero length.
        /// </param>
        /// <param name="IncubationPeriod">
        ///		The average incubation period of the disease.  An ArgumentOutOfRangeException
        ///		exception is raised if IncubationPeriod is less than zero.
        /// </param>
        /// <param name="IncubationVariance">
        ///		The variance in the incubation period.  An ArgumentOutOfRangeException
        ///		exception is raised if IncubationVariance is less than zero.
        ///	</param>
        /// <param name="InfectiousPeriod">
        ///		The average infectious period of the disease.  An ArgumentOutOfRangeException
        ///		exception is raised if InfectiousPeriod is less than one.
        /// </param>
        /// <param name="InfectiousVariance">
        ///		The variance in the infectious period.  An ArgumentOutOfRangeException
        ///		exception is raised if InfectiousVariance is less than zero.
        ///	</param>
        /// <param name="ContactRate">
        ///		The contact rate for the infected animal.  That is, the weekly chance of spreading
        ///		the disease to each animal in the infected animals activity radius.  The value is
        ///		expressed as a percent.  An ArgumentOutOfRangeException exception is raised if
        ///		CellContaceRate is not in the range of 0 to 100.
        ///	</param>
        /// <param name="ChanceOfDeath">
        ///		The probability that the animal will die once the disease has run its
        ///		course.  An	ArgumentOutOfRangeException	exception is raised if ChanceOfDeath
        ///		is not in the range of 0 to 100.
        /// </param>
        /// <param name="BecomesImmune">
        ///		If set to true, any animal that recovers from this disease will become immune for
        ///		life.
        /// </param>
        /// <param name="RecoveredNotInfectious">
        ///     If set to true, recovered animals will not become infectious
        /// </param>
        /// <param name="Rnd">The random number generator used by this disease
        /// </param>

        public cDisease(string Name, int IncubationPeriod, double IncubationVariance,
                        int InfectiousPeriod, double InfectiousVariance,
                        double ContactRate, double ChanceOfDeath, bool BecomesImmune,
                        bool RecoveredNotInfectious, cUniformRandom Rnd)
        {
            // name must not be zero length
            if (Name.Length == 0)
            {
                throw new ArgumentException("Name must not be 0 length.", "Name");
            }
            // Incubation period must not be negative
            if (IncubationPeriod < 0)
            {
                throw new ArgumentOutOfRangeException("IncubationPeriod",
                                                      "Incubation period must be >= 0");
            }
            if (InfectiousPeriod < 1)
            {
                throw new ArgumentOutOfRangeException("InfectiousPeriod",
                                                      "The infectious period must have a value of at leat one");
            }
            // contact rates must be between 0 and 1.
            if (ContactRate < 0 || ContactRate > 100)
            {
                throw new ArgumentOutOfRangeException("ContactRate",
                                                      "The contact rate must be between 0 and 100.");
            }
            // chance of death must be between 0 and 100
            if (ChanceOfDeath < 0 || ChanceOfDeath > 100)
            {
                throw new ArgumentOutOfRangeException("ChanceOfDeath",
                                                      "Chance of death must be between 0 and 100.");
            }
            // set the values
            mvarName                   = Name;
            mvarIncubationPeriod       = new cGaussianRandom((double)IncubationPeriod, IncubationVariance, Rnd);
            mvarInfectiousPeriod       = new cGaussianRandom((double)InfectiousPeriod, InfectiousVariance, Rnd);
            mvarContactRate            = ContactRate;
            mvarChanceOfDeath          = ChanceOfDeath / 100;
            mvarRandom                 = Rnd;
            mvarBecomesImmune          = BecomesImmune;
            mvarRecoveredNotInfectious = RecoveredNotInfectious;
        }
        /// <summary>
        /// EER: a second contructor added to accomodate ARM Excel template settings file
        /// </summary>
        /// <param name="SpreadProbability">The probability of spread</param>
        /// <param name="Rnd">The random number generator used to calculate spread probabilities</param>
        /// <param name="ChanceOfDeath">The % chance that an infection from this disease is fatal</param>
        /// <param name="RecoveredBecomeImmune">A flag indicating that recovered animal become immune</param>
        /// <param name="RecoveredNotInfectious">A flag the indicates that aninmals that recover from this disease will not become infectious</param>
        /// <param name="TrialSettings">The trial settings dataset</param>
        /// <param name="runningARM">A boolean flag to indicate that settings data come from ARM Excel template</param>
        public cBatchRabies(double SpreadProbability, cUniformRandom Rnd, int ChanceOfDeath, bool RecoveredBecomeImmune, bool RecoveredNotInfectious, DataSet TrialSettings, bool runningARM)
            : base(SpreadProbability, Rnd, ChanceOfDeath, RecoveredBecomeImmune, RecoveredNotInfectious)
        {
            //System.Diagnostics.Debug.WriteLine("cBatchRabies: cBatchRabies");

            // get datatable containing Incubation and Infectious Periods
            DataTable dtEpi = TrialSettings.Tables[3];

            /*double testIncub = Convert.ToDouble(dtEpi.Rows[8][6].ToString());
             * double testInf = Convert.ToDouble(dtEpi.Rows[8][7].ToString());
             * System.Diagnostics.Debug.WriteLine("    testIncub = " + testIncub);
             * System.Diagnostics.Debug.WriteLine("    testInf = " + testInf);*/

            // read Incubation and Infectious period arrays
            for (int i = 0; i <= 49; i++)
            {
                Incubation[i] = Convert.ToDouble(dtEpi.Rows[i + 8][6]);
                Infection[i]  = Convert.ToDouble(dtEpi.Rows[i + 8][7]);
                //System.Diagnostics.Debug.WriteLine("    cBatchRabies: cBatchRabies: Incubation[i] = " + Incubation[i] + "; Infection[i] = " + Infection[i]);
            }
        }
示例#17
0
 /// <summary>
 ///     Construct a new background object of the approriate type
 /// </summary>
 /// <param name="Rnd">The random number generator for the background</param>
 /// <param name="BackgroundName">The name of the background</param>
 /// <param name="KeepAllAnimals">A boolean value that indicates whether or not the background should retain a list of all animals</param>
 /// <param name="Winters">A list of winter types</param>
 /// <returns>A new background object ofthe approriate type</returns>
 protected override cBackground GetNewBackground(cUniformRandom Rnd, string BackgroundName, bool KeepAllAnimals,
                                                 cWinterTypeList Winters)
 {
     return(new cRaccoonBackground(Rnd, BackgroundName, KeepAllAnimals, Winters));
 }
示例#18
0
 /// <summary>
 ///     Construct a new background object of the approriate type
 /// </summary>
 /// <param name="Rnd">The random number generator for the background</param>
 /// <param name="BackgroundName">The name of the background</param>
 /// <param name="KeepAllAnimals">A boolean value that indicates whether or not the background should retain a list of all animals</param>
 /// <param name="NYears">The number of years</param>
 /// <param name="WinterBias">The winter type bias for the years</param>
 /// <returns>A new background object ofthe approriate type</returns>
 protected override cBackground GetNewBackground(cUniformRandom Rnd, string BackgroundName, bool KeepAllAnimals,
                                                 int NYears, enumWinterType WinterBias)
 {
     return(new cRaccoonBackground(Rnd, BackgroundName, KeepAllAnimals, NYears, WinterBias));
 }
示例#19
0
 /// <summary>
 ///		Create a read-only rabies model datasource from a passed cells datasource with
 ///		NYears years with the passed winter bias.
 /// </summary>
 /// <param name="Rnd">The random number generator used by the generated background</param>
 /// <param name="TheCells">The cells datasource.</param>
 /// <param name="NYears">The number of years to create.</param>
 /// <param name="WinterBias">The winter type bias for those years.</param>
 public cRaccoonModelDataSource(cUniformRandom Rnd, cCellsDataSource TheCells, int NYears, enumWinterType WinterBias)
     : base(Rnd, TheCells, NYears, WinterBias)
 {
 }
 /// <summary>
 ///		Initialize the background, passing a list of years and a seed for all
 ///		random number generators in the model.  This is an internal constructor
 ///		and may only be used by classes within the Rabies_Model_Core namespace.
 /// </summary>
 /// <param name="Rnd">The random number generator to be used by the background</param>
 /// <param name="Name">
 ///		The name to assign to this background.  An ArgumentException is raised if
 ///		Name is zero length.
 ///	</param>
 /// <param name="KeepAllAnimals">
 ///		A flag indicating whether a record of all animals should be kept during
 ///		a run.
 ///	</param>
 /// <param name="YList">
 ///		The list of years.  An ArgumentException exception is raised if YList is empty.
 ///	</param>
 ///	<param name="DList">
 ///		A list of diseases that will affect the animals in this background.
 ///	</param>
 public cFoxBackground(cUniformRandom Rnd, string Name, bool KeepAllAnimals, cYearList YList, cDiseaseList DList)
     : base(Rnd, Name, KeepAllAnimals, YList, DList)
 {
     InitValues();
 }
 /// <summary>
 ///		Create a read-only rabies model datasource from a passed cells datasource with
 ///		NYears years with the passed winter bias.
 /// </summary>
 /// <param name="Rnd">The random number generator used by the generated background</param>
 /// <param name="TheCells">The cells datasource.</param>
 /// <param name="NYears">The number of years to create.</param>
 /// <param name="WinterBias">The winter type bias for those years.</param>
 ///	<param name="MaleMarkers">
 ///	    The markers for the seed male animal
 /// </param>
 /// <param name="FemaleMarkers">
 ///     The markers for the seed female animal
 /// </param>
 public cFoxModelDataSource(cUniformRandom Rnd, cCellsDataSource TheCells, int NYears, enumWinterType WinterBias,
                            string MaleMarkers, string FemaleMarkers)
     : base(Rnd, TheCells, NYears, WinterBias, MaleMarkers, FemaleMarkers)
 {
 }
 /// <summary>
 ///		Create a read-only rabies model datasource from a passed cells datasource,
 ///		a passed wintertype list and a single animal.
 /// </summary>
 /// <param name="Rnd">The random number generator used by the generated background</param>
 /// <param name="TheCells">The cells datasource.</param>
 /// <param name="TheWinters">The list of winter types.</param>
 ///	<param name="MaleMarkers">
 ///	    The markers for the seed male animal
 /// </param>
 /// <param name="FemaleMarkers">
 ///     The markers for the seed female animal
 /// </param>
 public cFoxModelDataSource(cUniformRandom Rnd, cCellsDataSource TheCells, cWinterTypeList TheWinters,
                            string MaleMarkers, string FemaleMarkers)
     : base(Rnd, TheCells, TheWinters, MaleMarkers, FemaleMarkers)
 {
 }
示例#23
0
 // ********************** Constructors *******************************************
 /// <summary>
 ///		Initialize a cYearList by specifying the number of years.  Winter types
 ///		are generated randomly with a "normal" bias.
 /// </summary>
 /// <param name="NYears">
 ///     The number of years to place in the list.  An ArgumentException is raised
 ///     if NYears is less than or equal to zero.
 /// </param>
 /// <param name="YearRnd">
 ///     A random number generator for creating random years
 /// </param>
 public cYearList(int NYears, cUniformRandom YearRnd)
     : this(NYears, YearRnd, enumWinterType.Normal)
 {
 }
示例#24
0
 /// <summary>
 ///		Create a read-only rabies model datasource combining a passed cells datasource
 ///		and a passed animals datasource.
 /// </summary>
 /// <param name="Rnd">The random number generator used by the generated background</param>
 /// <param name="TheCells">The cells datasource.</param>
 /// <param name="TheAnimals">The animals datasource.</param>
 public cRaccoonModelDataSource(cUniformRandom Rnd, cCellsDataSource TheCells, cAnimalsDataSource TheAnimals)
     : base(Rnd, TheCells, TheAnimals)
 {
 }
示例#25
0
 /// <summary>
 ///		Create a read-only rabies model datasource from a passed cells datasource,
 ///		a passed wintertype list and a single animal.
 /// </summary>
 /// <param name="Rnd">The random number generator used by the generated background</param>
 /// <param name="TheCells">The cells datasource.</param>
 /// <param name="TheWinters">The list of winter types.</param>
 public cRaccoonModelDataSource(cUniformRandom Rnd, cCellsDataSource TheCells, cWinterTypeList TheWinters)
     : base(Rnd, TheCells, TheWinters)
 {
 }
 /// <summary>
 ///		Initialize the background.  Defaults to an initial 10 year time period
 ///		with a normal winter bias.
 /// </summary>
 /// <param name="Rnd">The random number generator to be used by the background</param>
 /// <param name="Name">
 ///		The name to assign to this background.  An ArgumentException is raised if
 ///		Name is zero length.
 ///	</param>
 /// <param name="KeepAllAnimals">
 ///		A flag indicating whether a record of all animals should be kept during
 ///		a run.
 ///	</param>
 public cFoxBackground(cUniformRandom Rnd, string Name, bool KeepAllAnimals)
     : base(Rnd, Name, KeepAllAnimals)
 {
     InitValues();
 }
示例#27
0
 /// <summary>
 ///     Construct a new background object of the approriate type
 /// </summary>
 /// <param name="Rnd">The random number generator for the background</param>
 /// <param name="BackgroundName">The name of the background</param>
 /// <param name="KeepAllAnimals">A boolean value that indicates whether or not the background should retain a list of all animals</param>
 /// <param name="AnimalYears">A list of years</param>
 /// <param name="Diseases">A list of diseases in the background</param>
 /// <returns>A new background object ofthe approriate type</returns>
 protected override cBackground GetNewBackground(cUniformRandom Rnd, string BackgroundName, bool KeepAllAnimals,
                                                 cYearList AnimalYears, cDiseaseList Diseases)
 {
     return(new cRaccoonBackground(Rnd, BackgroundName, KeepAllAnimals, AnimalYears, Diseases));
 }
 /// <summary>
 ///		Initialize the background specifying the initial number of years and their
 ///		winter bias.
 /// </summary>
 /// <param name="Rnd">The random number generator to be used by the background</param>
 /// <param name="Name">
 ///		The name to assign to this background.  An ArgumentException is raised if
 ///		Name is zero length.
 ///	</param>
 /// <param name="KeepAllAnimals">
 ///		A flag indicating whether a record of all animals should be kept during
 ///		a run.
 ///	</param>
 /// <param name="NYears">
 ///		The initial number of years. An ArgumentException is raised in NYears is
 ///		less than or equal to zero.
 ///	</param>
 /// <param name="WinterBias">The winter bias of the initial years.</param>
 public cFoxBackground(cUniformRandom Rnd, string Name, bool KeepAllAnimals, int NYears, enumWinterType WinterBias)
     : base(Rnd, Name, KeepAllAnimals, NYears, WinterBias)
 {
     InitValues();
 }
 /// <summary>
 ///		Initialize the background specifying numbers of years and their winter
 ///		types in a winter type list.
 /// </summary>
 /// <param name="Rnd">The random number generator to be used by the background</param>
 /// <param name="Name">
 ///		The name to assign to this background.  An ArgumentException is raised if
 ///		Name is zero length.
 ///	</param>
 /// <param name="KeepAllAnimals">
 ///		A flag indicating whether a record of all animals should be kept during
 ///		a run.
 ///	</param>
 /// <param name="WTList">
 ///		The list of winter types.  An ArgumentException exception is raised if
 ///		WTList is empty.
 ///	</param>
 public cFoxBackground(cUniformRandom Rnd, string Name, bool KeepAllAnimals, cWinterTypeList WTList)
     : base(Rnd, Name, KeepAllAnimals, WTList)
 {
     InitValues();
 }
示例#30
0
 // *********************** Constructor *******************************************
 /// <summary>
 ///		Initialize an animal list.
 /// </summary>
 public cAnimalList(cUniformRandom ScrambleRandom)
 {
     // create the list of values
     Values = new cIndexedHashTable(ScrambleRandom);
 }