/// <summary>
        /// Create a new stategy based on passed settings
        /// </summary>
        /// <param name="ModelBackground">The background</param>
        /// <param name="StrategyCells">The cells affected by the strategy</param>
        /// <param name="ActualLevel">The level of the strategy</param>
        /// <param name="Year">The year the strategy is applied</param>
        /// <param name="Week">The week the strategy is applied</param>
        /// <returns>A newly created cull strategy</returns>
        protected override cStrategy CreateStrategy(cBackground ModelBackground, cCellList StrategyCells, int ActualLevel,
                                                    int Year, int Week)
        {
            // extract the current fertility control effective period from the dataset
            int EffectivePeriod;

            try
            {
                if (mvarTrialSettings.Tables.Contains("FertilityControlInformation"))
                {
                    //YM:
                    //DataRow drFertility = mvarTrialSettings.Tables["FertilityControlInformation"].Rows[0];
                    //EffectivePeriod = Convert.ToInt32(drFertility["EffectivePeriod"]);
                    DataRow drFertility = mvarTrialSettings.Tables[2].Rows[1];
                    EffectivePeriod = Convert.ToInt32(drFertility[1]);
                }
                else
                {
                    // not found - must be an older dataset
                    EffectivePeriod = 52;
                }
            }
            catch
            {
                // not found - must be an older dataset
                EffectivePeriod = 52;
            }

            // return a cull strategy
            return(new cFertilityStrategy(ModelBackground, StrategyCells, ActualLevel, Year, Week, EffectivePeriod));
        }
示例#2
0
        internal static void Load()
        {
            TomletMain.RegisterMapper(WriteColor, ReadColor);

            FilePath = Path.Combine(Core.FolderPath, "Config.cfg");
            General  = CreateCat <cGeneral>(FilePath, nameof(General));

            bool UseDefault = true;

            if (!string.IsNullOrEmpty(General.Theme) &&
                !General.Theme.Equals("Default") &&
                !General.Theme.Equals("Random"))
            {
                try
                {
                    // To-Do: Sanatize themeName
                    General.Theme = General.Theme
                                    .Replace("\\", "")
                                    .Replace("/", "");

                    ThemePath = Path.Combine(Core.ThemesFolderPath, General.Theme);
                    if (Directory.Exists(ThemePath))
                    {
                        UseDefault = false;
                    }
                    else
                    {
                        throw new DirectoryNotFoundException(ThemePath);
                    }
                }
                catch (Exception ex) { MelonLogger.Error($"Failed to find Start Screen Theme: {ex}"); }
            }

            if (General.Theme.Equals("Random"))
            {
                ThemePath  = UIUtils.RandomFolder(Core.ThemesFolderPath);
                UseDefault = false;
            }

            if (UseDefault)
            {
                General.Theme = "Default";
                ThemePath     = Path.Combine(Core.ThemesFolderPath, General.Theme);
                if (!Directory.Exists(ThemePath))
                {
                    Directory.CreateDirectory(ThemePath);
                }
            }

            MelonLogger.Msg($"Using Start Screen Theme: \"{General.Theme}\"");

            Background   = CreateCat <cBackground>(nameof(Background), true);
            LogoImage    = CreateCat <LogoImageSettings>(nameof(LogoImage), true);
            LoadingImage = CreateCat <LoadingImageSettings>(nameof(LoadingImage), true);
            VersionText  = CreateCat <VersionTextSettings>(nameof(VersionText), true);
            ProgressText = CreateCat <ProgressTextSettings>(nameof(ProgressText), true);
            ProgressBar  = CreateCat <cProgressBar>(nameof(ProgressBar), true);

            MelonPreferences.SaveCategory <cGeneral>(nameof(General), false);
        }
        /// <summary>
        /// Create a new stategy based on passed settings
        /// </summary>
        /// <param name="ModelBackground">The background</param>
        /// <param name="StrategyCells">The cells affected by the strategy</param>
        /// <param name="ActualLevel">The level of the strategy</param>
        /// <param name="Year">The year the strategy is applied</param>
        /// <param name="Week">The week the strategy is applied</param>
        /// <returns>A newly created cull strategy</returns>
        protected override cStrategy CreateStrategy(cBackground ModelBackground, cCellList StrategyCells, int ActualLevel,
                                                    int Year, int Week)
        {
            // extract the current vaccine effective period from the dataset
            //YM:
            //DataRow drDisease = mvarTrialSettings.Tables["DiseaseInformation"].Rows[0];
            //int EffectivePeriod = Convert.ToInt32(drDisease["VaccineEffectivePeriod"]);
            DataRow drDisease       = mvarTrialSettings.Tables[2].Rows[0];
            int     EffectivePeriod = Convert.ToInt32(drDisease[1]);

            // return a vaccine strategy
            return(new cRabiesVaccineStrategy(ModelBackground, StrategyCells, ActualLevel, Year, Week, EffectivePeriod));
        }
示例#4
0
        internal static void Load()
        {
            FilePath = Path.Combine(Core.FolderPath, "Config.cfg");
            TomletMain.RegisterMapper(WriteColor, ReadColor);

            General      = CreateCat <cGeneral>(nameof(General));
            Background   = CreateCat <cBackground>(nameof(Background));
            LogoImage    = CreateCat <cLogoImage>(nameof(LogoImage));
            LoadingImage = CreateCat <cLoadingImage>(nameof(LoadingImage));
            VersionText  = CreateCat <cVersionText>(nameof(VersionText));
            ProgressText = CreateCat <cProgressText>(nameof(ProgressText));
            ProgressBar  = CreateCat <cProgressBar>(nameof(ProgressBar));
        }
示例#5
0
 /// <summary>
 ///		Create a new specific animal type
 /// </summary>
 /// <param name="Animal">The animal attributes used to define the animal.</param>
 /// <param name="BG">The background in which the animal will live.</param>
 /// <returns>The new animal as a cAnimal type.</returns>
 protected override cAnimal GetNewAnimal(cAnimalAttributes NewAnimal, cBackground BG)
 {
     // make sure parameters are not null
     if (NewAnimal == null)
     {
         ThrowAnimalsException();
     }
     if (BG == null)
     {
         ThrowBackgroundException();
     }
     // return a new raccoon
     return(new cRaccoon(NewAnimal, BG));
 }
示例#6
0
            /// <summary>
            /// Create the strategy being read
            /// </summary>
            /// <param name="ModelBackground">The background</param>
            /// <param name="StrategyCells">The cells the strategy applies to</param>
            /// <param name="ActualLevel">The level for the strategy</param>
            /// <param name="Year">The year of the strategy</param>
            /// <param name="Week">The week of the strategy</param>
            /// <returns>A newly created combned stategy</returns>
                    protected override cStrategy CreateStrategy(cBackground ModelBackground, cCellList StrategyCells, int ActualLevel, int Year, int Week)
               {
                        // extract the current fertility control effective period from the dataset
                        int VaccineEffectivePeriod   = 0;
                        int FertilityEffectivePeriod = 0;
                        // extract the current vaccine effective period from the dataset
                        var drDisease          = mvarTrialSettings.Tables["DiseaseInformation"].Rows[0];
                        VaccineEffectivePeriod = Convert.ToInt32(drDisease["VaccineEffectivePeriod"]);
                            try {
                            var drFertility = mvarTrialSettings.Tables["FertilityControlInformation"].Rows[0];
                                FertilityEffectivePeriod = Convert.ToInt32(drFertility["EffectivePeriod"]);
                                 
            }
                            catch {
                            // not found - must be an older dataset
                            FertilityEffectivePeriod = 52;
                             
            }
                        // return a fertility strategy
                            return(new cRabiesCombinedStrategy(ModelBackground, StrategyCells, ActualLevel, Year, Week, VaccineEffectivePeriod, FertilityEffectivePeriod));

                   }
        /// <summary>
        ///		Get the next record in the fox data source.  An InvalidOperationException
        ///		exception is raised if the datasource has not been connected.
        /// </summary>
        /// <param name="Attributes">
        ///		The attributes to add or update.  An ArgumentNullException exception is raised
        ///		if Attributes is null.
        ///	</param>
        /// <param name="Background">
        ///		The background object in which this animal will live.  An ArgumentNullException
        ///		exception is raised if Background is null.
        /// </param>
        /// <returns>False if the last record has already been read.</returns>
        protected override bool GetNextAnimalRecord(cAnimalAttributes Attributes,
                                                    cBackground Background)
        {
            if (mvarConnection == null)
            {
                ThrowConnectionException();
            }
            if (Attributes == null)
            {
                ThrowAnimalAttributesException();
            }
            if (Background == null)
            {
                ThrowBackgroundException();
            }
            // return false if we have reached the end of the record set
            if (ReadPosition == mvarDataSet.Tables["Animals"].Rows.Count)
            {
                return(false);
            }
            // copy the data to the Attributes object
            DataTable dt = mvarDataSet.Tables["Animals"];
            // get the datarow at the current read position
            DataRow dr = dt.Rows[ReadPosition];

            // get the basic animal data
            Attributes.ID            = Convert.ToString(dr["ID"]);
            Attributes.ParentID      = Convert.ToString(dr["Parent_ID"]);
            Attributes.Gender        = (enumGender)Convert.ToInt32(dr["Gender"]);
            Attributes.IsAlive       = Convert.ToBoolean(dr["IsAlive"]);
            Attributes.IsIndependent = Convert.ToBoolean(dr["IsIndependent"]);
            Attributes.YearDied      = Convert.ToInt32(dr["YearDied"]);
            Attributes.WeekDied      = Convert.ToInt32(dr["WeekDied"]);
            Attributes.Age           = Convert.ToInt32(dr["Age"]);
            if (dt.Columns.Contains("ListIndex"))
            {
                Attributes.ListIndex = Convert.ToInt32(dr["ListIndex"]);
            }
            try
            {
                Attributes.CannotGiveBirth = Convert.ToInt32(dr["CannotGiveBirth"]);
            }
            catch
            {
                Attributes.CannotGiveBirth = 0;
            }
            // now get cells, disease, offspring and vaccine info
            DataRow[] drChildren;
            // get the cells info
            drChildren = dr.GetChildRows(mvarDataSet.Relations["CellsRelation"]);
            foreach (DataRow drChild in drChildren)
            {
                cCellTime CT = new cCellTime();
                CT.CellID = Convert.ToString(drChild["Cell_ID"]);
                CT.Year   = Convert.ToInt32(drChild["Year"]);
                CT.Week   = Convert.ToInt32(drChild["Week"]);
                Attributes.Cells.Add(CT);
            }
            // get the offspring info
            drChildren = dr.GetChildRows(mvarDataSet.Relations["OffspringRelation"]);
            foreach (DataRow drChild in drChildren)
            {
                Attributes.Offspring.Add(Convert.ToString(drChild["Offspring_ID"]));
            }
            // get the disease info
            drChildren = dr.GetChildRows(mvarDataSet.Relations["DiseaseRelation"]);
            foreach (DataRow drChild in drChildren)
            {
                string DiseaseName       = Convert.ToString(drChild["Disease_Name"]);
                int    Year              = Convert.ToInt32(drChild["Year"]);
                int    Week              = Convert.ToInt32(drChild["Week"]);
                int    IncubationPeriod  = Convert.ToInt32(drChild["IncubationPeriod"]);
                int    InfectiousPeriod  = Convert.ToInt32(drChild["InfectiousPeriod"]);
                string InfectingAnimalID = Convert.ToString(drChild["InfectingAnimalID"]);
                string NaturalImmunity   = Convert.ToString(drChild["Natural_Immunity"]);
                Attributes.Infections.Add(new cInfection(Background, DiseaseName, Year,
                                                         Week, IncubationPeriod, InfectiousPeriod, InfectingAnimalID));
            }
            // get vaccine info
            drChildren = dr.GetChildRows(mvarDataSet.Relations["VaccinesRelation"]);
            foreach (DataRow drChild in drChildren)
            {
                string DiseaseName     = Convert.ToString(drChild["Disease_Name"]);
                int    Year            = Convert.ToInt32(drChild["Year"]);
                int    Week            = Convert.ToInt32(drChild["Week"]);
                int    EffectivePeriod = Convert.ToInt32(drChild["Effective_Period"]);
                Attributes.Vaccines.Add(new cVaccine(DiseaseName, Year, Week,
                                                     EffectivePeriod));
            }
            // return true, indicating that a value was read
            return(true);
        }
示例#8
0
 /// <summary>
 ///		Construct a fox from a cAnimalAttributes object.  This constructor is
 ///		used when loading fox data from a datasource.
 /// </summary>
 /// <param name="Attributes">
 ///		The cAnimalAttributes object containing the attributes for the fox.  An
 ///		ArgumentNullException exception is raised if Attributes is null.
 /// </param>
 /// <param name="Background">
 ///		The background object in which the fox lives.  An ArgumentNullException
 ///		exception is raised if Background is null.
 /// </param>
 public cFox(cAnimalAttributes Attributes, cBackground Background) :
     base(Attributes, Background)
 {
 }
示例#9
0
        /// <summary>
        /// Read vaccination strategies from the Excel template settings file
        /// </summary>
        /// <param name="ModelBackground"></param>
        public void GetStrategiesExcelTemplate(cBackground ModelBackground)
        {
            //System.Diagnostics.Debug.WriteLine("");
            //System.Diagnostics.Debug.WriteLine("cStrategyReader.cs: GetStrategiesExcelTemplate() ...does nothing");

            int i           = 0;
            int j           = 0;
            int Level       = 0;
            int ActualLevel = 0;
            int Year        = 0;
            int Week        = 0;

            // get required data tables and datarow

            /*DataTable dtStrategyTimes = mvarTrialSettings.Tables[mvarStrategyName + "_StrategyTimes"];
             * DataTable dtStrategies = mvarTrialSettings.Tables[mvarStrategyName + "_Strategies"];
             * DataTable dtCellIDs = mvarTrialSettings.Tables[mvarStrategyName + "_CellIDs"];
             * List<string> StrategyCellIDs = new List<string>();
             * string StrategyFieldName = null;
             * DataRow dr = null;*/
            // get the strategy cell ids - these are stored in the same order as the strategy values

            // EER: check each cell for data

            /*foreach (DataRow drCell in dtCellIDs.Rows)
             * {
             *  StrategyCellIDs.Add(drCell["CellID"].ToString());
             * }*/

            // loop through the number of defined strategies (the count of records in the StrategyTimes table)

            /*int numbdefs = dtStrategyTimes.Rows.Count;
             * System.Diagnostics.Debug.WriteLine("    number of defined strategies = " + numbdefs);
             * for (i = 0; i <= dtStrategyTimes.Rows.Count - 1; i++)
             * {
             *  System.Diagnostics.Debug.WriteLine(" here01");
             *  // get the year and week for this strategy
             *  dr = dtStrategyTimes.Rows[i];
             *  Year = Convert.ToInt32(dr["Year"]);
             *  Week = Convert.ToInt32(dr["Week"]);
             *  // field name in Strategies table for this strategy
             *  StrategyFieldName = "S" + i;
             *  // create a list of cells affected by this strategy
             *  cCellList StrategyCells = new cCellList(null);
             *  ActualLevel = 0;
             *  for (j = 0; j <= StrategyCellIDs.Count - 1; j++)
             *  {
             *      System.Diagnostics.Debug.WriteLine(" here02");
             *      dr = dtStrategies.Rows[j];
             *      // get the level for each cell
             *      Level = Convert.ToInt32(dr[StrategyFieldName]);
             *      if (Level > ActualLevel) ActualLevel = Level;
             *      // add a cell to the list if the level value for that cell is greater than 0
             *      if (Level > 0) StrategyCells.Add(ModelBackground.Cells[StrategyCellIDs[j]]);
             *  }
             *  // now create a strategy object
             *  cStrategy NewStrategy = CreateStrategy(ModelBackground, StrategyCells, ActualLevel, Year, Week);
             *  // add this strategy to the list of strategies
             *  ModelBackground.Strategies.Add(NewStrategy);
             * }*/
        }
示例#10
0
 /// <summary>
 /// Abstract methos for creating an actual strategy.  Overridden by sub-classes to create specific strategy types
 /// </summary>
 /// <param name="ModelBackground">The background</param>
 /// <param name="StrategyCells">The cells the strategy applies to</param>
 /// <param name="ActualLevel">The level for the strategy</param>
 /// <param name="Year">The year of the strategy</param>
 /// <param name="Week">The week of the strategy</param>
 /// <returns>A newly created combned stategy</returns>
 protected abstract cStrategy CreateStrategy(cBackground ModelBackground, cCellList StrategyCells, int ActualLevel, int Year, int Week);
示例#11
0
        /// <summary>
        /// Read vaccination strategies from the Trial Settings dataset
        /// </summary>
        /// <param name="ModelBackground"></param>
        public void GetStrategies(cBackground ModelBackground)
        {
            //System.Diagnostics.Debug.WriteLine("");
            //System.Diagnostics.Debug.WriteLine("Runs with no strategies???? cStrategyReader.cs: GetStrategies()");

            int i           = 0;
            int j           = 0;
            int Level       = 0;
            int ActualLevel = 0;
            int Year        = 0;
            int Week        = 0;
            // get required data tables and datarow
            DataTable     dtStrategyTimes   = mvarTrialSettings.Tables[mvarStrategyName + "_StrategyTimes"];
            DataTable     dtStrategies      = mvarTrialSettings.Tables[mvarStrategyName + "_Strategies"];
            DataTable     dtCellIDs         = mvarTrialSettings.Tables[mvarStrategyName + "_CellIDs"];
            List <string> StrategyCellIDs   = new List <string>();
            string        StrategyFieldName = null;
            DataRow       dr = null;

            // get the strategy cell ids - these are stored in the same order as the strategy values
            foreach (DataRow drCell in dtCellIDs.Rows)
            {
                //System.Diagnostics.Debug.WriteLine(" No data in drCell");
                StrategyCellIDs.Add(drCell["CellID"].ToString());
            }
            // loop through the number of defined strategies (the count of records in the StrategyTimes table)
            int numbdefs = dtStrategyTimes.Rows.Count;

            //System.Diagnostics.Debug.WriteLine("    number of defined strategies = " + numbdefs);
            for (i = 0; i <= dtStrategyTimes.Rows.Count - 1; i++)
            {
                //System.Diagnostics.Debug.WriteLine(" here01");
                // get the year and week for this strategy
                dr   = dtStrategyTimes.Rows[i];
                Year = Convert.ToInt32(dr["Year"]);
                Week = Convert.ToInt32(dr["Week"]);
                // field name in Strategies table for this strategy
                StrategyFieldName = "S" + i;
                // create a list of cells affected by this strategy
                cCellList StrategyCells = new cCellList(null);
                ActualLevel = 0;
                for (j = 0; j <= StrategyCellIDs.Count - 1; j++)
                {
                    //System.Diagnostics.Debug.WriteLine(" here02");
                    dr = dtStrategies.Rows[j];
                    // get the level for each cell
                    Level = Convert.ToInt32(dr[StrategyFieldName]);
                    if (Level > ActualLevel)
                    {
                        ActualLevel = Level;
                    }
                    // add a cell to the list if the level value for that cell is greater than 0
                    if (Level > 0)
                    {
                        StrategyCells.Add(ModelBackground.Cells[StrategyCellIDs[j]]);
                    }
                }
                // now create a strategy object
                cStrategy NewStrategy = CreateStrategy(ModelBackground, StrategyCells, ActualLevel, Year, Week);
                // add this strategy to the list of strategies
                ModelBackground.Strategies.Add(NewStrategy);
            }
        }
示例#12
0
        /// <summary>
        /// YM:
        /// Read control strategies from the CSV settings file
        /// </summary>
        /// <param name="ModelBackground"></param>The background
        /// <param name="StrategiesCtrlPath"></param> the path to the strategies control file
        public void GetStrategiesCsvTemplate(string StrategiesCtrlPath, cBackground ModelBackground)
        {
            int  i           = 0;
            int  j           = 0;
            int  Level       = 0;
            int  ActualLevel = 0;
            int  Year        = 0;
            int  Week        = 0;
            char Delimiter   = ';';
            // Get csv data
            DataTable dtStrategiesCtrl = new DataTable();
            DataRow   Rowdt;

            using (StreamReader StrategiesCtrlData = new StreamReader(StrategiesCtrlPath))
            {
                string   StrategiesCtrlLine = StrategiesCtrlData.ReadLine();
                string[] Header             = StrategiesCtrlLine.Split(Delimiter);
                foreach (string dc in Header)
                {
                    dtStrategiesCtrl.Columns.Add(new DataColumn(dc));
                }

                while (!StrategiesCtrlData.EndOfStream)
                {
                    StrategiesCtrlLine = StrategiesCtrlData.ReadLine();
                    string[] Rows = StrategiesCtrlLine.Split(Delimiter);
                    if (Rows.Length == dtStrategiesCtrl.Columns.Count)
                    {
                        Rowdt           = dtStrategiesCtrl.NewRow();
                        Rowdt.ItemArray = Rows;
                        dtStrategiesCtrl.Rows.Add(Rowdt);
                    }
                }
                StrategiesCtrlData.Close();
            }

            // Use the RowFilter method to find all rows matching the strategy type.
            dtStrategiesCtrl.DefaultView.RowFilter = "Type='" + mvarStrategyName + "'";
            DataTable dtStrategiesCtrlFilterType = (dtStrategiesCtrl.DefaultView).ToTable();

            dtStrategiesCtrl.Clear();

            List <string> StrategiesNameList = new List <string>();

            foreach (DataRow row in dtStrategiesCtrlFilterType.Rows)
            {
                StrategiesNameList.Add(row["StrategyName"].ToString());
            }
            int StrategiesNameCount = StrategiesNameList.Distinct().Count();
            IEnumerable <string> StrategiesNameListDistinct = StrategiesNameList.Distinct();

            // loop through the number of defined strategies
            foreach (string StrategyNameStr in StrategiesNameListDistinct)
            {
                // filter strategies by name
                dtStrategiesCtrlFilterType.DefaultView.RowFilter = "StrategyName='" + StrategyNameStr + "'";
                DataTable dtStrategiesCtrlFilterStrgName = (dtStrategiesCtrlFilterType.DefaultView).ToTable();

                // get required data tables and datarow
                List <string> StrategyCellIDs = new List <string>();
                DataRow       dr;
                // get the strategy cell ids
                for (i = 0; i <= dtStrategiesCtrlFilterStrgName.Rows.Count - 1; i++)
                {
                    StrategyCellIDs.Add(dtStrategiesCtrlFilterStrgName.Rows[i]["HexCellID"].ToString());
                }

                // create a list of cells affected by this strategy
                cCellList StrategyCells = new cCellList(null);
                StrategyCells.Name = "StrategiesCells";
                cStrategy NewStrategy = null;
                for (j = 0; j <= StrategyCellIDs.Count - 1; j++)
                {
                    //System.Diagnostics.Debug.WriteLine(" here02");
                    dr = dtStrategiesCtrlFilterStrgName.Rows[j];
                    //get the year and the week for this strategy
                    Year = Convert.ToInt32(dr["Year"]);
                    Week = Convert.ToInt32(dr["Week"]);
                    // get the level for each cell
                    Level = Convert.ToInt32(dr["Level"]);
                    if (Level > ActualLevel)
                    {
                        ActualLevel = Level;
                    }
                    // add a cell to the list if the level value for that cell is greater than 0
                    if (Level > 0)
                    {
                        ActualLevel = Level;
                        StrategyCells.Add(ModelBackground.Cells[StrategyCellIDs[j]]);
                    }
                }
                // now create a strategy object
                NewStrategy = CreateStrategy(ModelBackground, StrategyCells, ActualLevel, Year, Week);
                // add this strategy to the list of strategies
                ModelBackground.Strategies.Add(NewStrategy);
            }
            dtStrategiesCtrlFilterType.Clear();
        }
 /// <summary>
 ///		Construct a raccoon from a cAnimalAttributes object.  This constructor is
 ///		used when loading raccoon data from a datasource.
 /// </summary>
 /// <param name="Attributes">
 ///		The cAnimalAttributes object containing the attributes for the raccoon.  An
 ///		ArgumentNullException exception is raised if Attributes is null.
 /// </param>
 /// <param name="Background">
 ///		The background object in which the raccoon lives.  An ArgumentNullException
 ///		exception is raised if Background is null.
 /// </param>
 public cRaccoon(cAnimalAttributes Attributes, cBackground Background) :
     base(Attributes, Background)
 {
 }
示例#14
0
 /// <summary>
 /// Constructor.  Create a strategy for applying a combined vaccination and fertility control strategy
 /// </summary>
 /// <param name="BG">The background</param>
 /// <param name="Cells">The list of cells affected by the strategy</param>
 /// <param name="Level">The level of the strategy</param>
 /// <param name="Year">The year the strategy is applied</param>
 /// <param name="Week">The week the strategy is applied</param>
 /// <param name="VaccineEffectivePeriod">The effective period of the vaccine</param>
 /// <param name="FertilityEffectivePeriod">The effective period of the fertility control</param>
 public cRabiesCombinedStrategy(cBackground BG, cCellList Cells, int Level, int Year, int Week,
                                int VaccineEffectivePeriod, int FertilityEffectivePeriod)
     : base(BG, Cells, Level, Year, Week, "Rabies", VaccineEffectivePeriod, FertilityEffectivePeriod)
 {
 }
 /// <summary>
 /// Create a new stategy based on passed settings
 /// </summary>
 /// <param name="ModelBackground">The background</param>
 /// <param name="StrategyCells">The cells affected by the strategy</param>
 /// <param name="ActualLevel">The level of the strategy</param>
 /// <param name="Year">The year the strategy is applied</param>
 /// <param name="Week">The week the strategy is applied</param>
 /// <returns>A newly created cull strategy</returns>
 protected override cStrategy CreateStrategy(cBackground ModelBackground, cCellList StrategyCells, int ActualLevel,
                                             int Year, int Week)
 {
     // return a cull strategy
     return(new cCullStrategy(ModelBackground, StrategyCells, ActualLevel, Year, Week));
 }
示例#16
0
 // ********************* Constructors *******************************************
 /// <summary>
 ///		Construct a fox by specifying its ID, Starting Cell and Background.
 ///		This constructor is used to create the initial foxes in the background.
 ///		All	foxes created by this constructor come into existance at year = 0,
 ///		week = 1.  Although the foxes created here will start out as juveniles,
 ///		they will have no parents.
 /// </summary>
 /// <param name="ID">
 ///		The ID of the fox.  An ArgumentException exception is raised if the ID has
 ///		zero length.
 ///	</param>
 /// <param name="CellID">
 ///		The ID of the cell initially occupied by this fox.  An ArgumentException
 ///		exception is raised if the cell is not part of the background object to
 ///		which this fox belongs.
 ///	</param>
 /// <param name="Background">
 ///		The background object in which the fox lives.  An ArgumentNullException
 ///		exception is raised if Background is null.
 /// </param>
 /// <param name="Gender">
 ///		The gender of the fox.
 /// </param>
 public cFox(string ID, string CellID, cBackground Background,
             enumGender Gender) : base(ID, CellID, Background, Gender)
 {
 }
示例#17
0
 // ****************** protected members *******************************************
 /// <summary>
 ///		Create a new animal in the passed background.
 /// </summary>
 /// <param name="ID">The ID of the new animal.</param>
 /// <param name="CellID">
 ///		The ID of the cell containing the new animal.
 /// </param>
 /// <param name="Background">
 ///		The background object that the animal will live in.
 ///	</param>
 ///	<param name="Gender">The gender of the new animal.</param>
 /// <returns>A reference to the newly created animal.</returns>
 protected override cAnimal GetNewAnimal(string ID, string CellID,
                                         cBackground Background, enumGender Gender)
 {
     return(new cRaccoon(ID, CellID, Background, Gender));
 }
 /// <summary>
 /// Constructor
 /// </summary>
 /// <param name="BG">The background</param>
 /// <param name="Cells">The cells affected by the strategy</param>
 /// <param name="Level">The level of the strategy</param>
 /// <param name="Year">The year the strategy is applied</param>
 /// <param name="Week">The week the strategy is applied</param>
 /// <param name="EffectivePeriod">The effecive period of the vaccine</param>
 public cRabiesVaccineStrategy(cBackground BG, cCellList Cells, int Level, int Year, int Week, int EffectivePeriod)
     :  base(BG, Cells, Level, Year, Week, "Rabies", EffectivePeriod)
 {
 }