Exemplo n.º 1
0
        /// <summary>
        /// Models the finances in the simulation
        /// </summary>
        private void GetCashFlow()
        {
            ActivityFolder cashflow = new ActivityFolder(this)
            {
                Name = "CashFlow"
            };

            cashflow.Add(Source.GetMonthlyExpenses(cashflow));
            cashflow.Add(Source.GetAnnualExpenses(cashflow));
            cashflow.Add(Source.GetInterestRates(cashflow));

            Add(cashflow);
        }
Exemplo n.º 2
0
        /// <summary>
        /// Add a RuminantActivityFeed for each item in the AnimalFoodStore
        /// </summary>
        private ActivityFolder GetFeed(ActivityFolder herd)
        {
            AnimalFoodStore store = SearchTree <AnimalFoodStore>((ZoneCLEM)Parent);

            if (store.Children.Count == 0)
            {
                return(null);
            }

            ActivityFolder feed = new ActivityFolder(herd)
            {
                Name = "Feed ruminants"
            };

            foreach (Node child in store.Children)
            {
                feed.Add(new RuminantActivityFeed(feed)
                {
                    Name         = "Feed " + child.Name,
                    FeedTypeName = "AnimalFoodStore." + child.Name
                });
            }

            return(feed);
        }
Exemplo n.º 3
0
        public ActivitiesHolder(ZoneCLEM parent) : base(parent)
        {
            Name = "Activities";

            // Model the finance activities
            GetCashFlow();

            // Model the crop growth activities
            ActivityFolder crops = new ActivityFolder(this)
            {
                Name = "Manage crops"
            };

            crops.Add(Source.GetManageCrops(crops));
            Add(crops);

            // Model the forage growth activities
            ActivityFolder forages = new ActivityFolder(this)
            {
                Name = "Manage forages"
            };

            forages.Add(Source.GetManageForages(forages));
            if (forages.Children.Count > 0)
            {
                forages.Add(Source.GetNativePasture(forages));
            }
            Add(forages);

            // Model the ruminant activities
            GetHerd();

            // Model the pasture management
            Add(Source.GetManagePasture(this));

            // Attach summary/report
            Add(new SummariseRuminantHerd(this));
            Add(new ReportRuminantHerd(this));
        }
Exemplo n.º 4
0
        /// <summary>
        /// Models the management of the ruminant herd in the simulation
        /// </summary>
        private void GetHerd()
        {
            ActivityFolder herd = new ActivityFolder(this)
            {
                Name = "Manage herd"
            };

            herd.Add(Source.GetManageBreeds(herd));
            herd.Add(GetFeed(herd));
            herd.Add(new RuminantActivityGrazeAll(herd));
            herd.Add(new RuminantActivityGrow(herd));
            herd.Add(new RuminantActivityBreed(herd));
            herd.Add(new RuminantActivityBuySell(herd));
            herd.Add(new RuminantActivityMuster(herd));

            Add(herd);
        }