Exemple #1
0
        public static bool AddMachineryInputToStock(Machinery1Stock machStock, double multiplier,
                                                    Machinery1Input machinput, string currentNodeName, bool adjustTotals)
        {
            bool bHasCalculations = false;

            //inheriting classes usually run this class, but adjust their own totals
            if (adjustTotals)
            {
                //multipliers (input.times, out.compositionamount, oc.amount, tp.amount)
                //don't change per hour machinery costs, only total costs
                if (currentNodeName.EndsWith(Input.INPUT_PRICE_TYPES.input.ToString()))
                {
                    //i.e. machinput.cost = machinput.cost * multiplier * input.ocamount
                    //multiplier = input.times * oc.amount * tp.amount
                    ChangeMachineryInputByInputMultipliers(machinput, multiplier);
                }
                else
                {
                    //i.e. machinput.cost = machinput.cost * multiplier (1 in stock analyzers)
                    ChangeMachineryInputByMultiplier(machinput, multiplier);
                }
            }
            machStock.TotalMarketValue               += (machinput.MarketValue);
            machStock.TotalSalvageValue              += (machinput.SalvageValue);
            machStock.TotalFuelAmount                += (machinput.FuelAmount);
            machStock.TotalFuelPrice                 += AgBudgetingRules.GetFuelPrice(machinput);
            machStock.TotalFuelCost                  += (machinput.FuelCost);
            machStock.TotalLubeOilAmount             += (machinput.LubeOilAmount);
            machStock.TotalLubeOilPrice              += (machinput.Constants.PriceOil);
            machStock.TotalLubeOilCost               += (machinput.LubeOilCost);
            machStock.TotalRepairCost                += (machinput.RepairCost);
            machStock.TotalLaborAmount               += (machinput.LaborAmount);
            machStock.TotalLaborPrice                += AgBudgetingRules.GetLaborPrice(machinput);
            machStock.TotalLaborCost                 += (machinput.LaborCost);
            machStock.TotalCapitalRecoveryCost       += (machinput.CapitalRecoveryCost);
            machStock.TotalTaxesHousingInsuranceCost += (machinput.TaxesHousingInsuranceCost);
            machStock.TotalPriceGas                  += (machinput.Constants.PriceGas);
            machStock.TotalPriceDiesel               += (machinput.Constants.PriceDiesel);
            machStock.TotalPriceLP              += (machinput.Constants.PriceLP);
            machStock.TotalPriceElectric        += (machinput.Constants.PriceElectric);
            machStock.TotalPriceNG              += (machinput.Constants.PriceNG);
            machStock.TotalPriceOil             += (machinput.Constants.PriceOil);
            machStock.TotalPriceRegularLabor    += (machinput.Constants.PriceRegularLabor);
            machStock.TotalPriceMachineryLabor  += (machinput.Constants.PriceMachineryLabor);
            machStock.TotalPriceSupervisorLabor += (machinput.Constants.PriceSupervisorLabor);
            machStock.TotalStartingHrs          += (machinput.Constants.StartingHrs);
            machStock.TotalPlannedUseHrs        += (machinput.Constants.PlannedUseHrs);
            machStock.TotalUsefulLifeHrs        += (machinput.Constants.UsefulLifeHrs);
            machStock.TotalHousingPercent       += (machinput.Constants.HousingPercent);
            machStock.TotalTaxPercent           += (machinput.Constants.TaxPercent);
            machStock.TotalInsurePercent        += (machinput.Constants.InsurePercent);
            machStock.TotalSpeed           += (machinput.Constants.FieldSpeedTypical);
            machStock.TotalWidth           += (machinput.Constants.Width);
            machStock.TotalHorsepower      += (machinput.Constants.HP);
            machStock.TotalHPPTOEquiv      += (machinput.Constants.HPPTOEquiv);
            machStock.TotalFieldEffTypical += (machinput.Constants.FieldEffTypical);
            bHasCalculations = true;
            return(bHasCalculations);
        }
        public bool AddMachineryInputToStock(double multiplier, GeneralCapital1Input machinput,
                                             string currentNodeName, bool adjustTotals)
        {
            bool bHasCalculations = false;

            //inheriting classes usually run this class, but adjust their own totals
            if (adjustTotals)
            {
                //multipliers (input.times, input.ocamount, out.compositionamount, oc.amount, tp.amount)
                //are not used with per hourly costs, but are used with total op and aoh costs (fuelcost, capitalrecovery)
                if (currentNodeName.EndsWith(Input.INPUT_PRICE_TYPES.input.ToString()))
                {
                    //i.e. machinput.cost = input.times * input.ocamount
                    ChangeMachineryInputByInputMultipliers(machinput, multiplier);
                }
                else
                {
                    //i.e. budget adjustment = if operation multiplier = op.amount,
                    //if timeperiod multiplier = tp.amount)
                    ChangeMachineryInputByMultiplier(machinput, multiplier);
                }
            }
            this.GeneralCapitalStock.TotalMarketValue               += (machinput.MarketValue);
            this.GeneralCapitalStock.TotalSalvageValue              += (machinput.SalvageValue);
            this.GeneralCapitalStock.TotalFuelAmount                += (machinput.FuelAmount);
            this.GeneralCapitalStock.TotalFuelPrice                 += AgBudgetingRules.GetFuelPrice(machinput);
            this.GeneralCapitalStock.TotalFuelCost                  += (machinput.FuelCost);
            this.GeneralCapitalStock.TotalEnergyUseHr               += (machinput.EnergyUseHr);
            this.GeneralCapitalStock.TotalEnergyEffTypical          += (machinput.EnergyEffTypical);
            this.GeneralCapitalStock.TotalRandMPercent              += (machinput.Capital1Constant.RandMPercent);
            this.GeneralCapitalStock.TotalRepairCost                += (machinput.RepairCost);
            this.GeneralCapitalStock.TotalLaborAmount               += (machinput.LaborAmount);
            this.GeneralCapitalStock.TotalLaborPrice                += AgBudgetingRules.GetLaborPrice(machinput);
            this.GeneralCapitalStock.TotalLaborCost                 += (machinput.LaborCost);
            this.GeneralCapitalStock.TotalCapitalRecoveryCost       += (machinput.CapitalRecoveryCost);
            this.GeneralCapitalStock.TotalTaxesHousingInsuranceCost += (machinput.TaxesHousingInsuranceCost);
            this.GeneralCapitalStock.TotalPriceGas                  += (machinput.Constants.PriceGas);
            this.GeneralCapitalStock.TotalPriceDiesel               += (machinput.Constants.PriceDiesel);
            this.GeneralCapitalStock.TotalPriceLP              += (machinput.Constants.PriceLP);
            this.GeneralCapitalStock.TotalPriceElectric        += (machinput.Constants.PriceElectric);
            this.GeneralCapitalStock.TotalPriceNG              += (machinput.Constants.PriceNG);
            this.GeneralCapitalStock.TotalPriceOil             += (machinput.Constants.PriceOil);
            this.GeneralCapitalStock.TotalPriceRegularLabor    += (machinput.Constants.PriceRegularLabor);
            this.GeneralCapitalStock.TotalPriceMachineryLabor  += (machinput.Constants.PriceMachineryLabor);
            this.GeneralCapitalStock.TotalPriceSupervisorLabor += (machinput.Constants.PriceSupervisorLabor);
            this.GeneralCapitalStock.TotalStartingHrs          += (machinput.Constants.StartingHrs);
            this.GeneralCapitalStock.TotalPlannedUseHrs        += (machinput.Constants.PlannedUseHrs);
            this.GeneralCapitalStock.TotalUsefulLifeHrs        += (machinput.Constants.UsefulLifeHrs);
            this.GeneralCapitalStock.TotalHousingPercent       += (machinput.Constants.HousingPercent);
            this.GeneralCapitalStock.TotalTaxPercent           += (machinput.Constants.TaxPercent);
            this.GeneralCapitalStock.TotalInsurePercent        += (machinput.Constants.InsurePercent);
            bHasCalculations = true;
            return(bHasCalculations);
        }
Exemple #3
0
        public static bool AddMachinery1StockToStock(Machinery1Stock totalsMach1Stock,
                                                     double multiplier, Machinery1Stock currentMach1Stock)
        {
            bool bHasCalculations = false;

            //multipliers (input.times, out.compositionamount, oc.amount, tp.amount)
            //don't change per hour machinery costs, only total costs
            totalsMach1Stock.TotalMarketValue               += (currentMach1Stock.TotalMarketValue);
            totalsMach1Stock.TotalSalvageValue              += (currentMach1Stock.TotalSalvageValue);
            totalsMach1Stock.TotalFuelAmount                += (currentMach1Stock.TotalFuelAmount * multiplier);
            totalsMach1Stock.TotalFuelPrice                 += AgBudgetingRules.GetFuelPrice(currentMach1Stock);
            totalsMach1Stock.TotalFuelCost                  += (currentMach1Stock.TotalFuelCost * multiplier);
            totalsMach1Stock.TotalLubeOilAmount             += (currentMach1Stock.TotalLubeOilAmount * multiplier);
            totalsMach1Stock.TotalLubeOilPrice              += (currentMach1Stock.Constants.PriceOil);
            totalsMach1Stock.TotalLubeOilCost               += (currentMach1Stock.TotalLubeOilCost * multiplier);
            totalsMach1Stock.TotalRepairCost                += (currentMach1Stock.TotalRepairCost * multiplier);
            totalsMach1Stock.TotalLaborAmount               += (currentMach1Stock.TotalLaborAmount * multiplier);
            totalsMach1Stock.TotalLaborPrice                += AgBudgetingRules.GetLaborPrice(currentMach1Stock);
            totalsMach1Stock.TotalLaborCost                 += (currentMach1Stock.TotalLaborCost * multiplier);
            totalsMach1Stock.TotalCapitalRecoveryCost       += (currentMach1Stock.TotalCapitalRecoveryCost * multiplier);
            totalsMach1Stock.TotalTaxesHousingInsuranceCost += (currentMach1Stock.TotalTaxesHousingInsuranceCost * multiplier);
            totalsMach1Stock.TotalPriceGas                  += (currentMach1Stock.Constants.PriceGas);
            totalsMach1Stock.TotalPriceDiesel               += (currentMach1Stock.Constants.PriceDiesel);
            totalsMach1Stock.TotalPriceLP              += (currentMach1Stock.Constants.PriceLP);
            totalsMach1Stock.TotalPriceElectric        += (currentMach1Stock.Constants.PriceElectric);
            totalsMach1Stock.TotalPriceNG              += (currentMach1Stock.Constants.PriceNG);
            totalsMach1Stock.TotalPriceOil             += (currentMach1Stock.Constants.PriceOil);
            totalsMach1Stock.TotalPriceRegularLabor    += (currentMach1Stock.Constants.PriceRegularLabor);
            totalsMach1Stock.TotalPriceMachineryLabor  += (currentMach1Stock.Constants.PriceMachineryLabor);
            totalsMach1Stock.TotalPriceSupervisorLabor += (currentMach1Stock.Constants.PriceSupervisorLabor);
            totalsMach1Stock.TotalStartingHrs          += (currentMach1Stock.Constants.StartingHrs);
            totalsMach1Stock.TotalPlannedUseHrs        += (currentMach1Stock.Constants.PlannedUseHrs);
            totalsMach1Stock.TotalUsefulLifeHrs        += (currentMach1Stock.Constants.UsefulLifeHrs);
            totalsMach1Stock.TotalHousingPercent       += (currentMach1Stock.Constants.HousingPercent);
            totalsMach1Stock.TotalTaxPercent           += (currentMach1Stock.Constants.TaxPercent);
            totalsMach1Stock.TotalInsurePercent        += (currentMach1Stock.Constants.InsurePercent);
            totalsMach1Stock.TotalSpeed           += (currentMach1Stock.Constants.FieldSpeedTypical);
            totalsMach1Stock.TotalWidth           += (currentMach1Stock.Constants.Width);
            totalsMach1Stock.TotalHorsepower      += (currentMach1Stock.Constants.HP);
            totalsMach1Stock.TotalHPPTOEquiv      += (currentMach1Stock.Constants.HPPTOEquiv);
            totalsMach1Stock.TotalFieldEffTypical += (currentMach1Stock.Constants.FieldEffTypical);
            bHasCalculations = true;
            return(bHasCalculations);
        }