Exemple #1
0
 private void SetStatistic01Attributes(Statistic01 stat, string attNameExtension,
                                       ref XElement calculator)
 {
     //copy this object's properties
     CalculatorHelpers.SetAttributeDoubleF3(calculator,
                                            string.Concat(cTotal, attNameExtension),
                                            stat.Total);
     CalculatorHelpers.SetAttributeDoubleF3(calculator,
                                            string.Concat(cMean, attNameExtension),
                                            stat.Mean);
     CalculatorHelpers.SetAttributeDoubleF3(calculator,
                                            string.Concat(cVariance, attNameExtension),
                                            stat.Variance);
     CalculatorHelpers.SetAttributeDoubleF3(calculator,
                                            string.Concat(cStandardDeviation, attNameExtension),
                                            stat.StandardDeviation);
     CalculatorHelpers.SetAttributeDoubleF3(calculator,
                                            string.Concat(cMedian, attNameExtension),
                                            stat.Median);
     CalculatorHelpers.SetAttributeDoubleF3(calculator,
                                            string.Concat(cObservations, attNameExtension),
                                            stat.Observations);
     CalculatorHelpers.SetAttributeDoubleF3(calculator,
                                            string.Concat(cCI5Percent, attNameExtension),
                                            stat.CI5Percent);
     CalculatorHelpers.SetAttributeDoubleF3(calculator,
                                            string.Concat(cCI95Percent, attNameExtension),
                                            stat.CI95Percent);
 }
        public async Task <bool> RunNPV1CalculatorCalculations()
        {
            bool             bHasCalculations = false;
            CALCULATOR_TYPES eCalculatorType
                = GetCalculatorType(this.NPV1CalculatorParams.CalculatorType);

            this.NPV1CalculatorParams.RunCalculatorType
                = CalculatorHelpers.RUN_CALCULATOR_TYPES.basic;
            this.NPV1CalculatorParams.AnalyzerParms.ObservationsPath
                = this.NPV1CalculatorParams.ExtensionDocToCalcURI.URIDataManager.TempDocPath;
            //note that running descendant calculations inserts a calculator
            //with all of its attributes into the descendant, but the descendant
            //may still need to have a calculation run
            IONPV1StockSubscriber subNPV1Calculator
                = new IONPV1StockSubscriber(this.NPV1CalculatorParams);

            //use NPVCalculators extension to run calculations
            switch (eCalculatorType)
            {
            case CALCULATOR_TYPES.npv:
                bHasCalculations = await subNPV1Calculator.RunCalculator();

                break;

            default:
                break;
            }
            CalculatorHelpers.UpdateCalculatorParams(this.NPV1CalculatorParams, subNPV1Calculator.GCCalculatorParams);
            //set parameters/attributes needed to update db and display this analysis
            SetCalculatorParameters();
            return(bHasCalculations);
        }
 protected virtual IEnumerable <XElement> StreamRoot()
 {
     //loop through the descendants in document order
     while (this.GCCalculatorParams.DocToCalcReader.Read())
     {
         if (this.GCCalculatorParams.DocToCalcReader.NodeType
             == XmlNodeType.Element)
         {
             if (this.GCCalculatorParams.DocToCalcReader.Name
                 == Constants.ROOT_PATH)
             {
                 XElement currentElement
                     = CalculatorHelpers.GetCurrentElementWithAttributes(
                           this.GCCalculatorParams.DocToCalcReader);
                 IEnumerable <XElement> childElements =
                     from childElement in StreamOutcomeGroups()
                     select childElement;
                 if (currentElement != null)
                 {
                     if (childElements != null)
                     {
                         //add the child elements to the currentElement
                         currentElement.Add(childElements);
                     }
                     yield return(currentElement);
                 }
             }
         }
     }
 }
 //set the class properties using the XElement
 public virtual void SetTotalOutputHCStockProperties(XElement currentCalculationsElement)
 {
     this.TotalOutputCost               = CalculatorHelpers.GetAttributeDouble(currentCalculationsElement, TOutputCost);
     this.TotalBenefitAdjustment        = CalculatorHelpers.GetAttributeDouble(currentCalculationsElement, TBenefitAdjustment);
     this.TotalAdjustedBenefit          = CalculatorHelpers.GetAttributeDouble(currentCalculationsElement, TAdjustedBenefit);
     this.TotalOutputEffect1Amount      = CalculatorHelpers.GetAttributeDouble(currentCalculationsElement, TOutputEffect1Amount);
     this.TotalOutputEffect1Price       = CalculatorHelpers.GetAttributeDouble(currentCalculationsElement, TOutputEffect1Price);
     this.TotalOutputEffect1Cost        = CalculatorHelpers.GetAttributeDouble(currentCalculationsElement, TOutputEffect1Cost);
     this.TotalPhysicalHealthRating     = CalculatorHelpers.GetAttributeDouble(currentCalculationsElement, TPhysicalHealthRating);
     this.TotalEmotionalHealthRating    = CalculatorHelpers.GetAttributeDouble(currentCalculationsElement, TEmotionalHealthRating);
     this.TotalSocialHealthRating       = CalculatorHelpers.GetAttributeDouble(currentCalculationsElement, TSocialHealthRating);
     this.TotalEconomicHealthRating     = CalculatorHelpers.GetAttributeDouble(currentCalculationsElement, TEconomicHealthRating);
     this.TotalHealthCareDeliveryRating = CalculatorHelpers.GetAttributeDouble(currentCalculationsElement, THealthCareDeliveryRating);
     this.TotalBeforeQOLRating          = CalculatorHelpers.GetAttributeDouble(currentCalculationsElement, TBeforeQOLRating);
     this.TotalAfterQOLRating           = CalculatorHelpers.GetAttributeDouble(currentCalculationsElement, TAfterQOLRating);
     this.TotalBeforeYears              = CalculatorHelpers.GetAttributeDouble(currentCalculationsElement, TBeforeYears);
     this.TotalAfterYears               = CalculatorHelpers.GetAttributeDouble(currentCalculationsElement, TAfterYears);
     this.TotalAfterYearsProb           = CalculatorHelpers.GetAttributeDouble(currentCalculationsElement, TAfterYearsProb);
     this.TotalTimeTradeoffYears        = CalculatorHelpers.GetAttributeDouble(currentCalculationsElement, TTimeTradeoffYears);
     this.TotalEquityMultiplier         = CalculatorHelpers.GetAttributeDouble(currentCalculationsElement, TEquityMultiplier);
     this.TotalAverageBenefitRating     = CalculatorHelpers.GetAttributeDouble(currentCalculationsElement, TAverageBenefitRating);
     this.TotalQALY     = CalculatorHelpers.GetAttributeDouble(currentCalculationsElement, TQALY);
     this.TotalICERQALY = CalculatorHelpers.GetAttributeDouble(currentCalculationsElement, TICERQALY);
     this.TotalTTOQALY  = CalculatorHelpers.GetAttributeDouble(currentCalculationsElement, TTTOQALY);
 }
Exemple #5
0
        public bool SetSB1C1Calculations(
            SB1CalculatorHelper.CALCULATOR_TYPES calculatorType,
            CalculatorParameters calcParameters, XElement calculator,
            XElement currentElement)
        {
            bool bHasCalculations = false;

            InitSB1C1Properties();
            //deserialize xml to object
            //set the base input properties
            //locals come from input
            this.SB1CInput.SetInputProperties(calcParameters,
                                              calculator, currentElement);
            //set the calculator
            this.SetSB1C1Properties(calculator, currentElement);
            bHasCalculations = RunSB1C1CalculationsAsync(calcParameters).Result;
            //serialize object back to xml and fill in updates list
            if (calcParameters.SubApplicationType == Constants.SUBAPPLICATION_TYPES.inputprices)
            {
                this.SB1CInput.SetInputAttributes(calcParameters,
                                                  currentElement, calcParameters.Updates);
            }
            else
            {
            }
            //this sets and removes some atts
            this.SetSB1C1Attributes(string.Empty, calculator);
            //set the totals into calculator
            this.SB1CInput.SetNewInputAttributes(calcParameters, calculator);
            CalculatorHelpers.SetCalculatorId(
                calculator, currentElement);
            return(bHasCalculations);
        }
Exemple #6
0
 public void SetOptions()
 {
     this.AnalyzerType = GetAnalyzerType();
     this.ME2CalculatorParams.AnalyzerParms.AnalyzerType = this.AnalyzerType.ToString();
     if (this.ME2CalculatorParams.AnalyzerParms.AnalyzerType == string.Empty ||
         this.ME2CalculatorParams.AnalyzerParms.AnalyzerType == Constants.NONE)
     {
         this.ME2CalculatorParams.ErrorMessage
             = Errors.MakeStandardErrorMsg("ANALYSES_CHOOSEONE");
     }
     this.ME2CalculatorParams.AnalyzerParms.AnalyzerGeneralType
         = GetBaseAnalyzerType(this.AnalyzerType);
     this.ME2CalculatorParams.AnalyzerParms.SubFolderType
         = AnalyzerHelper.GetSubFolderType(this.ME2CalculatorParams.LinkedViewElement);
     this.ME2CalculatorParams.AnalyzerParms.ComparisonType
         = AnalyzerHelper.GetComparisonType(this.ME2CalculatorParams.LinkedViewElement);
     this.ME2CalculatorParams.AnalyzerParms.AggregationType
         = AnalyzerHelper.GetAggregationType(this.ME2CalculatorParams.LinkedViewElement);
     //new in v1.4.5 (user can choose whether or not to display full calcs)
     this.ME2CalculatorParams.NeedsFullView
         = AnalyzerHelper.GetDisplayFullViewOption(this.ME2CalculatorParams.LinkedViewElement);
     this.ME2CalculatorParams.AnalyzerParms.FilesToAnalyzeExtensionType
         = CalculatorHelpers.GetAttribute(this.ME2CalculatorParams.LinkedViewElement,
                                          Calculator1.cFilesToAnalyzeExtensionType);
     this.ME2CalculatorParams.StartingDocToCalcNodeName
         = GetNodeNameFromFileExtensionType(this.ME2CalculatorParams.AnalyzerParms.FilesToAnalyzeExtensionType);
     this.ME2CalculatorParams.SubApplicationType
         = CalculatorHelpers.GetSubAppTypeFromNodeName2(
               this.ME2CalculatorParams.StartingDocToCalcNodeName);
 }
Exemple #7
0
 public void SetOutputProperties(XElement currentElement)
 {
     this.SetSharedObjectProperties(currentElement);
     this.SetTotalBenefitsProperties(currentElement);
     this.AnnuityType = TimePeriod.GetAnnuityType(currentElement);
     this.Amount      = CalculatorHelpers.GetAttributeDouble(currentElement,
                                                             OUTPUT_AMOUNT);
     this.Price = CalculatorHelpers.GetAttributeDouble(currentElement,
                                                       OUTPUT_PRICE);
     this.Date = CalculatorHelpers.GetAttributeDate(currentElement,
                                                    OUTPUT_DATE);
     this.Unit = CalculatorHelpers.GetAttribute(currentElement,
                                                OUTPUT_BASE_UNIT);
     this.CompositionAmount = CalculatorHelpers.GetAttributeDouble(currentElement,
                                                                   COMPOSITION_AMOUNT);
     this.CompositionUnit = CalculatorHelpers.GetAttribute(currentElement,
                                                           COMPOSITION_UNIT);
     this.Times = CalculatorHelpers.GetAttributeDouble(currentElement,
                                                       OUTPUT_TIMES);
     this.IncentiveAmount = CalculatorHelpers.GetAttributeDouble(currentElement,
                                                                 DataAppHelpers.General.INCENTIVE_AMOUNT);
     this.IncentiveRate = CalculatorHelpers.GetAttributeDouble(currentElement,
                                                               DataAppHelpers.General.INCENTIVE_RATE);
     this.OutputGroupId = CalculatorHelpers.GetAttributeInt(currentElement,
                                                            DataAppHelpers.Prices.OUTPUT_GROUP_ID);
     this.OutputGroupName = CalculatorHelpers.GetAttribute(currentElement,
                                                           DataAppHelpers.Prices.OUTPUT_GROUP_NAME);
 }
Exemple #8
0
 public void SetTotalME2Stat1Properties(ME2Stat1 ind,
                                        string attNameExtension, XElement calculator)
 {
     //stats always based on indicators
     SetTotalME2IndicatorStockProperties(ind, attNameExtension, calculator);
     //stats
     ind.TME2N = CalculatorHelpers.GetAttributeInt(calculator,
                                                   string.Concat(cTME2N, attNameExtension));
     ind.TotalME2MMean = CalculatorHelpers.GetAttributeDouble(calculator,
                                                              string.Concat(cTotalME2MMean, attNameExtension));
     ind.TotalME2MMedian = CalculatorHelpers.GetAttributeDouble(calculator,
                                                                string.Concat(cTotalME2MMedian, attNameExtension));
     ind.TotalME2MVariance = CalculatorHelpers.GetAttributeDouble(calculator,
                                                                  string.Concat(cTotalME2MVariance, attNameExtension));
     ind.TotalME2MStandDev = CalculatorHelpers.GetAttributeDouble(calculator,
                                                                  string.Concat(cTotalME2MStandDev, attNameExtension));
     ind.TotalME2LMean = CalculatorHelpers.GetAttributeDouble(calculator,
                                                              string.Concat(cTotalME2LMean, attNameExtension));
     ind.TotalME2LMedian = CalculatorHelpers.GetAttributeDouble(calculator,
                                                                string.Concat(cTotalME2LMedian, attNameExtension));
     ind.TotalME2LVariance = CalculatorHelpers.GetAttributeDouble(calculator,
                                                                  string.Concat(cTotalME2LVariance, attNameExtension));
     ind.TotalME2LStandDev = CalculatorHelpers.GetAttributeDouble(calculator,
                                                                  string.Concat(cTotalME2LStandDev, attNameExtension));
     ind.TotalME2UMean = CalculatorHelpers.GetAttributeDouble(calculator,
                                                              string.Concat(cTotalME2UMean, attNameExtension));
     ind.TotalME2UMedian = CalculatorHelpers.GetAttributeDouble(calculator,
                                                                string.Concat(cTotalME2UMedian, attNameExtension));
     ind.TotalME2UVariance = CalculatorHelpers.GetAttributeDouble(calculator,
                                                                  string.Concat(cTotalME2UVariance, attNameExtension));
     ind.TotalME2UStandDev = CalculatorHelpers.GetAttributeDouble(calculator,
                                                                  string.Concat(cTotalME2UStandDev, attNameExtension));
 }
Exemple #9
0
        public virtual void SetCapital1ConstantProperty(string attName,
                                                        string attValue)
        {
            switch (attName)
            {
            case cRandMPercent:
                this.RandMPercent = CalculatorHelpers.ConvertStringToDouble(attValue);
                break;

            case cReplacementCost:
                this.ReplacementCost = CalculatorHelpers.ConvertStringToDouble(attValue);
                break;

            case cTotalReplacementCost:
                this.TotalReplacementCost = CalculatorHelpers.ConvertStringToDouble(attValue);
                break;

            case cReplacementYrsFromBaseDate:
                this.ReplacementYrsFromBaseDate = CalculatorHelpers.ConvertStringToDouble(attValue);
                break;

            default:
                break;
            }
        }
Exemple #10
0
 //set the class properties using the XElement
 public void SetCEGeneralProperties(XElement calculator)
 {
     this.Outputs = CalculatorHelpers.GetAttributeInt(calculator,
                                                      OUTPUTS);
     this.Inputs = CalculatorHelpers.GetAttributeInt(calculator,
                                                     INPUTS);
 }
Exemple #11
0
        public virtual void SetIndicatorQ1sProperties(XElement calculator)
        {
            if (this.IndicatorQ1s == null)
            {
                this.IndicatorQ1s = new List <IndicatorQ1>();
            }
            int i = 1;
            //standard attname used throughout DevTreks
            string sAttNameExtension = string.Empty;
            //don't make unnecessary collection members
            string sHasAttribute = string.Empty;

            for (i = 1; i < this.MaximumNumberOfIndicatorQ1s; i++)
            {
                sAttNameExtension = i.ToString();
                sHasAttribute     = CalculatorHelpers.GetAttribute(calculator,
                                                                   string.Concat(cIQ1NameA, sAttNameExtension));
                if (!string.IsNullOrEmpty(sHasAttribute))
                {
                    IndicatorQ1 indQ = new IndicatorQ1();
                    SetIndicatorQ1Properties(indQ, sAttNameExtension, calculator);
                    this.IndicatorQ1s.Add(indQ);
                }
                sHasAttribute = string.Empty;
            }
        }
 //set the class properties using the XElement
 public virtual void SetHealthBenefit2Properties(XElement currentCalculationsElement)
 {
     if (Demographics == null)
     {
         Demographics = new Demog1();
     }
     Demographics.SetDemog1Properties(currentCalculationsElement);
     //don't set any input properties; each calculator should set what's needed separately
     this.OutputCost               = CalculatorHelpers.GetAttributeDouble(currentCalculationsElement, cOutputCost);
     this.BenefitAdjustment        = CalculatorHelpers.GetAttributeDouble(currentCalculationsElement, cBenefitAdjustment);
     this.AdjustedBenefit          = CalculatorHelpers.GetAttributeDouble(currentCalculationsElement, cAdjustedBenefit);
     this.OutputEffect1Name        = CalculatorHelpers.GetAttribute(currentCalculationsElement, cOutputEffect1Name);
     this.OutputEffect1Unit        = CalculatorHelpers.GetAttribute(currentCalculationsElement, cOutputEffect1Unit);
     this.OutputEffect1Amount      = CalculatorHelpers.GetAttributeDouble(currentCalculationsElement, cOutputEffect1Amount);
     this.OutputEffect1Price       = CalculatorHelpers.GetAttributeDouble(currentCalculationsElement, cOutputEffect1Price);
     this.OutputEffect1Cost        = CalculatorHelpers.GetAttributeDouble(currentCalculationsElement, cOutputEffect1Cost);
     this.AverageBenefitRating     = CalculatorHelpers.GetAttributeDouble(currentCalculationsElement, cAverageBenefitRating);
     this.PhysicalHealthRating     = CalculatorHelpers.GetAttributeInt(currentCalculationsElement, cPhysicalHealthRating);
     this.EmotionalHealthRating    = CalculatorHelpers.GetAttributeInt(currentCalculationsElement, cEmotionalHealthRating);
     this.SocialHealthRating       = CalculatorHelpers.GetAttributeInt(currentCalculationsElement, cSocialHealthRating);
     this.EconomicHealthRating     = CalculatorHelpers.GetAttributeInt(currentCalculationsElement, cEconomicHealthRating);
     this.HealthCareDeliveryRating = CalculatorHelpers.GetAttributeInt(currentCalculationsElement, cHealthCareDeliveryRating);
     this.BeforeQOLRating          = CalculatorHelpers.GetAttributeInt(currentCalculationsElement, cBeforeQOLRating);
     this.AfterQOLRating           = CalculatorHelpers.GetAttributeInt(currentCalculationsElement, cAfterQOLRating);
     this.BeforeYears              = CalculatorHelpers.GetAttributeDouble(currentCalculationsElement, cBeforeYears);
     this.AfterYears               = CalculatorHelpers.GetAttributeDouble(currentCalculationsElement, cAfterYears);
     this.AfterYearsProb           = CalculatorHelpers.GetAttributeDouble(currentCalculationsElement, cAfterYearsProb);
     this.TimeTradeoffYears        = CalculatorHelpers.GetAttributeDouble(currentCalculationsElement, cTimeTradeoffYears);
     this.EquityMultiplier         = CalculatorHelpers.GetAttributeDouble(currentCalculationsElement, cEquityMultiplier);
     this.BenefitAssessment        = CalculatorHelpers.GetAttribute(currentCalculationsElement, cBenefitAssessment);
     this.QALY         = CalculatorHelpers.GetAttributeDouble(currentCalculationsElement, cQALY);
     this.ICERQALY     = CalculatorHelpers.GetAttributeDouble(currentCalculationsElement, cICERQALY);
     this.TTOQALY      = CalculatorHelpers.GetAttributeDouble(currentCalculationsElement, cTTOQALY);
     this.WillDoSurvey = CalculatorHelpers.GetAttributeBool(currentCalculationsElement, cWillDoSurvey);
 }
Exemple #13
0
        //set the class properties using the XElement
        public virtual void SetTimelinessOC1Properties(XElement currentCalculationsElement)
        {
            this.PlannedStartDate   = CalculatorHelpers.GetAttributeDate(currentCalculationsElement, cPlannedStartDate);
            this.ActualStartDate    = CalculatorHelpers.GetAttributeDate(currentCalculationsElement, cActualStartDate);
            this.LaborAvailable     = CalculatorHelpers.GetAttributeDouble(currentCalculationsElement, cLaborAvailable);
            this.WorkdayProbability = CalculatorHelpers.GetAttributeDouble(currentCalculationsElement, cWorkdayProbability);
            this.TimelinessPenalty1 = CalculatorHelpers.GetAttributeDouble(currentCalculationsElement, cTimelinessPenalty1);
            this.TimelinessPenaltyDaysFromStart1 = CalculatorHelpers.GetAttributeDouble(currentCalculationsElement, cTimelinessPenaltyDaysFromStart1);
            this.TimelinessPenalty2 = CalculatorHelpers.GetAttributeDouble(currentCalculationsElement, cTimelinessPenalty2);
            this.TimelinessPenaltyDaysFromStart2 = CalculatorHelpers.GetAttributeDouble(currentCalculationsElement, cTimelinessPenaltyDaysFromStart2);
            this.WorkdaysLimit = CalculatorHelpers.GetAttributeDouble(currentCalculationsElement, cWorkdaysLimit);
            this.Amount        = CalculatorHelpers.GetAttributeDouble(currentCalculationsElement, Constants.AMOUNT);
            this.Unit          = CalculatorHelpers.GetAttribute(currentCalculationsElement, Constants.UNIT);
            this.FieldCapacity = CalculatorHelpers.GetAttributeDouble(currentCalculationsElement, cFieldCapacity);
            this.AreaCovered   = CalculatorHelpers.GetAttributeDouble(currentCalculationsElement, cAreaCovered);
            this.FieldDays     = CalculatorHelpers.GetAttributeDouble(currentCalculationsElement, cFieldDays);

            this.OutputName                   = CalculatorHelpers.GetAttribute(currentCalculationsElement, cOutputName);
            this.OutputUnit                   = CalculatorHelpers.GetAttribute(currentCalculationsElement, cOutputUnit);
            this.OutputPrice                  = CalculatorHelpers.GetAttributeDouble(currentCalculationsElement, cOutputPrice);
            this.OutputYield                  = CalculatorHelpers.GetAttributeDouble(currentCalculationsElement, cOutputYield);
            this.CompositionUnit              = CalculatorHelpers.GetAttribute(currentCalculationsElement, cCompositionUnit);
            this.CompositionAmount            = CalculatorHelpers.GetAttributeDouble(currentCalculationsElement, cCompositionAmount);
            this.OutputTimes                  = CalculatorHelpers.GetAttributeDouble(currentCalculationsElement, cOutputTimes);
            this.ProbableFieldDays            = CalculatorHelpers.GetAttributeDouble(currentCalculationsElement, cProbableFieldDays);
            this.ProbableFinishDate           = CalculatorHelpers.GetAttributeDate(currentCalculationsElement, cProbableFinishDate);
            this.TimelinessPenaltyCost        = CalculatorHelpers.GetAttributeDouble(currentCalculationsElement, cTimelinessPenaltyCost);
            this.TimelinessPenaltyCostPerHour = CalculatorHelpers.GetAttributeDouble(currentCalculationsElement, cTimelinessPenaltyCostPerHour);
            this.TotalR = CalculatorHelpers.GetAttributeDouble(currentCalculationsElement, CostBenefitCalculator.TR);
        }
Exemple #14
0
        public virtual void InitTimelinessOC1Properties()
        {
            //avoid null references to properties
            this.PlannedStartDate   = CalculatorHelpers.GetDateShortNow();
            this.ActualStartDate    = CalculatorHelpers.GetDateShortNow();
            this.LaborAvailable     = 0;
            this.WorkdayProbability = 100;
            this.TimelinessPenalty1 = 0;
            this.TimelinessPenaltyDaysFromStart1 = 0;
            this.TimelinessPenalty2 = 0;
            this.TimelinessPenaltyDaysFromStart2 = 0;
            this.WorkdaysLimit = 0;
            //base props
            this.Amount = 0;
            this.Unit   = string.Empty;
            //base input prop
            this.FieldCapacity = 0;
            //calculated results
            this.AreaCovered = 0;
            this.FieldDays   = 0;

            this.OutputName                   = string.Empty;
            this.OutputUnit                   = string.Empty;
            this.OutputPrice                  = 0;
            this.OutputYield                  = 0;
            this.CompositionAmount            = 1;
            this.CompositionUnit              = "each";
            this.OutputTimes                  = 1;
            this.ProbableFieldDays            = 0;
            this.ProbableFinishDate           = CalculatorHelpers.GetDateShortNow();
            this.TimelinessPenaltyCost        = 0;
            this.TimelinessPenaltyCostPerHour = 0;
            this.TotalR = 0;
        }
Exemple #15
0
        public virtual void SetSubPrice1sProperties(XElement calculator)
        {
            //remember that the calculator inheriting from this class must set id and name
            //this.SetCalculatorProperties(calculator);
            if (this.SubPrice1s == null)
            {
                this.SubPrice1s = new List <SubPrice1>();
            }
            int i = 1;
            //standard attname used throughout DevTreks
            string sAttNameExtension = string.Empty;
            //don't make unnecessary collection members
            string sHasAttribute = string.Empty;

            for (i = 1; i < this.MaximumNumberOfSubPrice1s; i++)
            {
                sAttNameExtension = i.ToString();
                sHasAttribute     = CalculatorHelpers.GetAttribute(calculator,
                                                                   string.Concat(cSubPName, sAttNameExtension));
                if (!string.IsNullOrEmpty(sHasAttribute))
                {
                    SubPrice1 subP1 = new SubPrice1();
                    SetSubPrice1Properties(subP1, sAttNameExtension, calculator);
                    this.SubPrice1s.Add(subP1);
                }
                sHasAttribute = string.Empty;
            }
        }
        public bool SetOpOrCompMachineryStockCalculations(ref XElement currentCalculationsElement,
                                                          ref XElement currentElement)
        {
            bool bHasCalculations = false;

            //set the parent tp for holding collection of opcomps
            if (this.TimePeriod == null)
            {
                this.TimePeriod = new TimePeriod();
            }
            if (this.OpComp == null)
            {
                this.OpComp = new OperationComponent();
            }
            //note that the machinput calculator can not change Operation properties
            //but needs several properties from the Operation (i.e. Id, Amount)
            this.OpComp.SetOperationComponentProperties(this.GCCalculatorParams,
                                                        currentCalculationsElement, currentElement);
            //init machStock props
            this.GeneralCapitalStock.SetCalculatorProperties(currentCalculationsElement);
            //oc.amount was multiplied in the inputs
            double dbMultiplier = 1;

            //the machStock.machstocks dictionary can now be summed to derive totals
            bHasCalculations = SetTotalMachineryStockCalculations(dbMultiplier, currentElement.Name.LocalName);
            //serialize calculator object back to xml
            //(calculator doesn't change opOrComp, so don't serialize it)
            string sAttNameExtension = string.Empty;

            //set new machinery stock totals
            this.GeneralCapitalStock.SetAndRemoveCalculatorAttributes(sAttNameExtension,
                                                                      ref currentCalculationsElement);
            this.GeneralCapitalStock.SetTotalMachinery1StockAttributes(sAttNameExtension,
                                                                       ref currentCalculationsElement);
            this.GeneralCapitalStock.SetTotalMachinery1ConstantAttributes(sAttNameExtension,
                                                                          ref currentCalculationsElement);
            this.GeneralCapitalStock.SetTotalGeneralCapital1StockAttributes(sAttNameExtension,
                                                                            ref currentCalculationsElement);
            //set the totaloc and totalaoh
            AddMachineryStockTotals(this.GeneralCapitalStock, ref currentCalculationsElement);
            //set calculatorid (primary way to display calculation attributes)
            CalculatorHelpers.SetCalculatorId(
                currentCalculationsElement, currentElement);
            //reset machstock totals to zero (for next opOrComp)
            this.GeneralCapitalStock.InitTotalMachinery1StockProperties();
            this.GeneralCapitalStock.InitTotalMachinery1ConstantProperties();
            this.GeneralCapitalStock.InitTotalGeneralCapital1StockProperties();
            //reset machStock.machstocks fileposition index
            //next opOrComp's machstock will be inserted in next index
            this.GCCalculatorParams.AnalyzerParms.FilePositionIndex += 1;
            //add to collection
            if (this.TimePeriod.OperationComponents == null)
            {
                this.TimePeriod.OperationComponents = new List <OperationComponent>();
            }
            this.TimePeriod.OperationComponents.Add(this.OpComp);
            //reset for next collection
            this.OpComp = null;
            return(bHasCalculations);
        }
Exemple #17
0
        private void AddAncestorObjects(XElement currentElement)
        {
            XElement currentCalculationsElement = null;

            currentCalculationsElement
                = CalculatorHelpers.GetCalculator(this.GCCalculatorParams,
                                                  currentElement);
            if (currentElement.Name.LocalName
                .EndsWith(OperationComponent.OPERATION_PRICE_TYPES.operation.ToString()) ||
                currentElement.Name.LocalName
                .EndsWith(OperationComponent.COMPONENT_PRICE_TYPES.component.ToString()))
            {
                //need the oc.amount multiplier at the input level (so set the parentopcomp here)
                this.GCCalculatorParams.ParentOperationComponent
                    = new OperationComponent();
                this.GCCalculatorParams.ParentOperationComponent
                .SetOperationComponentProperties(
                    this.GCCalculatorParams, currentCalculationsElement,
                    currentElement);
                //init the total costs to zero
                this.GCCalculatorParams.ParentOperationComponent.InitTotalCostsProperties();
                //all calculators need it
                if (this.FNStockCalculator != null)
                {
                    this.FNStockCalculator.BIFN1Calculator.GCCalculatorParams.ParentOperationComponent
                        = this.GCCalculatorParams.ParentOperationComponent;
                }
                else if (this.FNSR01StockCalculator != null)
                {
                    this.FNSR01StockCalculator.BIFNSR01Calculator.GCCalculatorParams.ParentOperationComponent
                        = this.GCCalculatorParams.ParentOperationComponent;
                }
            }
        }
Exemple #18
0
        public virtual void SetStatistic02sProperties(XElement calculator)
        {
            if (this.Stat2s == null)
            {
                this.Stat2s = new List <Statistic02>();
            }
            int i = 1;
            //standard attname used throughout DevTreks
            string sAttNameExtension = string.Empty;
            //don't make unnecessary collection members
            string sHasAttribute = string.Empty;

            for (i = 1; i < this.MaximumNumberOfIndicator1s; i++)
            {
                sAttNameExtension = i.ToString();
                sHasAttribute     = CalculatorHelpers.GetAttribute(calculator,
                                                                   string.Concat(cAmount, sAttNameExtension));
                if (!string.IsNullOrEmpty(sHasAttribute))
                {
                    Statistic02 stat = new Statistic02();
                    SetStatistic02Properties(stat, sAttNameExtension, calculator);
                    this.Stat2s.Add(stat);
                }
                sHasAttribute = string.Empty;
            }
        }
 public void AdjustJointOutputCalculations(
     Output output, ref XElement currentCalculationsElement,
     CalculatorParameters calcParameters)
 {
     //transfer changes found in calcParams.ParentOutcome.Outputs[]
     //to this output, prior to discounting
     if (calcParameters.ParentOutcome.Outputs != null)
     {
         int    iOutputId = output.Id;
         Output adjustedOutput
             = calcParameters.ParentOutcome.Outputs
               .FirstOrDefault(i => i.Id == iOutputId &&
                               i.Type == CostBenefitCalculator.TYPE_NEWCALCS);
         if (adjustedOutput != null)
         {
             //replace output
             output.CopyOutput(adjustedOutput);
             //output = new Output(adjustedOutput);
             if (adjustedOutput.XmlDocElement != null)
             {
                 //adjustments can change fuel amounts, AOHAmounts ...
                 output.XmlDocElement
                     = new XElement(adjustedOutput.XmlDocElement);
                 string sId = CalculatorHelpers.GetAttribute(currentCalculationsElement,
                                                             Calculator1.cId);
                 currentCalculationsElement
                     = CalculatorHelpers.GetChildLinkedViewUsingAttribute(
                           adjustedOutput.XmlDocElement, Calculator1.cId, sId);
             }
         }
     }
 }
        public virtual void SetTotalSubPrice3StocksProperties(XElement calculator)
        {
            //remember that the analyzer inheriting from this must .SetAnalyzerProps
            if (this.SubPrice3Stocks == null)
            {
                this.SubPrice3Stocks = new List <SubPrice3Stock>();
            }
            int i = 1;
            //standard attname used throughout DevTreks
            string sAttNameExtension = string.Empty;
            //don't make unnecessary collection members
            string sHasAttribute = string.Empty;

            for (i = 1; i < this.MaximumNumberOfSubPrice3Stocks; i++)
            {
                sAttNameExtension = i.ToString();
                sHasAttribute     = CalculatorHelpers.GetAttribute(calculator,
                                                                   string.Concat(SubPrice3.cSubPName, sAttNameExtension));
                if (!string.IsNullOrEmpty(sHasAttribute))
                {
                    SubPrice3Stock ind1 = new SubPrice3Stock();
                    SetTotalSubPrice3StockProperties(ind1, sAttNameExtension, calculator);
                    this.SubPrice3Stocks.Add(ind1);
                }
                sHasAttribute = string.Empty;
            }
        }
Exemple #21
0
 public static void SetOutputAllAttributes(Output output,
                                           XElement elementNeedingAttributes)
 {
     CalculatorHelpers.SetAttributeInt(elementNeedingAttributes,
                                       Calculator1.cId, output.Id);
     CalculatorHelpers.SetAttribute(elementNeedingAttributes,
                                    Calculator1.cName, output.Name.ToString());
     CalculatorHelpers.SetAttribute(elementNeedingAttributes,
                                    Calculator1.cDescription, output.Description.ToString());
     CalculatorHelpers.SetAttributeDoubleF3(elementNeedingAttributes,
                                            OUTPUT_AMOUNT, output.Amount);
     CalculatorHelpers.SetAttributeDoubleF3(elementNeedingAttributes,
                                            OUTPUT_PRICE, output.Price);
     CalculatorHelpers.SetAttribute(elementNeedingAttributes,
                                    OUTPUT_BASE_UNIT, output.Unit);
     CalculatorHelpers.SetAttributeDateS(elementNeedingAttributes,
                                         OUTPUT_DATE, output.Date);
     CalculatorHelpers.SetAttributeDoubleF3(elementNeedingAttributes,
                                            COMPOSITION_AMOUNT, output.CompositionAmount);
     CalculatorHelpers.SetAttribute(elementNeedingAttributes,
                                    COMPOSITION_UNIT, output.CompositionUnit);
     CalculatorHelpers.SetAttributeDoubleF3(elementNeedingAttributes,
                                            OUTPUT_TIMES, output.Times);
     CalculatorHelpers.SetAttributeDoubleF3(elementNeedingAttributes,
                                            DataAppHelpers.General.INCENTIVE_AMOUNT, output.IncentiveAmount);
     CalculatorHelpers.SetAttributeDoubleF3(elementNeedingAttributes,
                                            DataAppHelpers.General.INCENTIVE_RATE, output.IncentiveRate);
     CalculatorHelpers.SetAttributeInt(elementNeedingAttributes,
                                       DataAppHelpers.Prices.OUTPUT_GROUP_ID, output.OutputGroupId);
     CalculatorHelpers.SetAttribute(elementNeedingAttributes,
                                    DataAppHelpers.Prices.OUTPUT_GROUP_NAME, output.OutputGroupName);
 }
 private void SetTotalSubPrice3StockProperties(SubPrice3Stock ind,
                                               string attNameExtension, XElement calculator)
 {
     ind.TotalInd1Description = CalculatorHelpers.GetAttribute(calculator,
                                                               string.Concat(cTotalInd1Description, attNameExtension));
     ind.TotalInd1RiskType = CalculatorHelpers.GetAttribute(calculator,
                                                            string.Concat(cTotalInd1RiskType, attNameExtension));
     ind.TotalInd1Name = CalculatorHelpers.GetAttribute(calculator,
                                                        string.Concat(cTotalInd1Name, attNameExtension));
     ind.TotalInd1Label = CalculatorHelpers.GetAttribute(calculator,
                                                         string.Concat(cTotalInd1Label, attNameExtension));
     ind.TotalInd1Total = CalculatorHelpers.GetAttributeDouble(calculator,
                                                               string.Concat(cTotalInd1Total, attNameExtension));
     ind.TotalInd1BM = CalculatorHelpers.GetAttributeDouble(calculator,
                                                            string.Concat(cTotalInd1BM, attNameExtension));
     ind.TotalInd1BMProg = CalculatorHelpers.GetAttributeDouble(calculator,
                                                                string.Concat(cTotalInd1BMProg, attNameExtension));
     ind.TotalInd1Unit = CalculatorHelpers.GetAttribute(calculator,
                                                        string.Concat(cTotalInd1Unit, attNameExtension));
     //ind.SubP1PTDate = CalculatorHelpers.GetAttributeDate(calculator,
     //   string.Concat(cInd1PTDate, attNameExtension));
     //ind.SubP1YTDDate = CalculatorHelpers.GetAttributeDate(calculator,
     //   string.Concat(cInd1YTDDate, attNameExtension));
     ind.TotalInd1PartTarget = CalculatorHelpers.GetAttributeDouble(calculator,
                                                                    string.Concat(cTotalInd1PartTarget, attNameExtension));
     ind.TotalInd1FullTarget = CalculatorHelpers.GetAttributeDouble(calculator,
                                                                    string.Concat(cTotalInd1FullTarget, attNameExtension));
     ind.TotalInd1PTProg = CalculatorHelpers.GetAttributeDouble(calculator,
                                                                string.Concat(cTotalInd1PTProg, attNameExtension));
     ind.TotalInd1FTProg = CalculatorHelpers.GetAttributeDouble(calculator,
                                                                string.Concat(cTotalInd1FTProg, attNameExtension));
 }
Exemple #23
0
        public virtual void SetTotalME2IndicatorStocksProperties(XElement calculator)
        {
            //remember that the analyzer inheriting from this must .SetAnalyzerProps
            if (this.ME2IndicatorStocks == null)
            {
                this.ME2IndicatorStocks = new List <ME2IndicatorStock>();
            }
            //score, or index = 0, is just another stock that can be aggreg and compared to other scores
            int i = 0;
            //standard attname used throughout DevTreks
            string sAttNameExtension = string.Empty;
            //don't make unnecessary collection members
            string sHasAttribute = string.Empty;

            for (i = 0; i < this.MaximumNumberOfME2IndicatorStocks; i++)
            {
                sAttNameExtension = i.ToString();
                sHasAttribute     = CalculatorHelpers.GetAttribute(calculator,
                                                                   string.Concat(cTME2Name, sAttNameExtension));
                if (!string.IsNullOrEmpty(sHasAttribute))
                {
                    sHasAttribute = CalculatorHelpers.GetAttribute(calculator,
                                                                   string.Concat(cTME2Label, sAttNameExtension));
                    if (!string.IsNullOrEmpty(sHasAttribute))
                    {
                        ME2IndicatorStock ind1 = new ME2IndicatorStock(this.CalcParameters);
                        SetTotalME2IndicatorStockProperties(ind1, sAttNameExtension, calculator);
                        this.ME2IndicatorStocks.Add(ind1);
                    }
                }
                sHasAttribute = string.Empty;
            }
        }
 public virtual void SetTotalSubPrice3StockAttributes(SubPrice3Stock ind,
                                                      string attNameExtension, XElement calculator)
 {
     CalculatorHelpers.SetAttribute(calculator,
                                    string.Concat(cTotalInd1Description, attNameExtension), ind.TotalInd1Description);
     CalculatorHelpers.SetAttribute(calculator,
                                    string.Concat(cTotalInd1RiskType, attNameExtension), ind.TotalInd1RiskType);
     CalculatorHelpers.SetAttribute(calculator,
                                    string.Concat(cTotalInd1Name, attNameExtension), ind.TotalInd1Name);
     CalculatorHelpers.SetAttribute(calculator,
                                    string.Concat(cTotalInd1Label, attNameExtension), ind.TotalInd1Label);
     CalculatorHelpers.SetAttributeDoubleF2(calculator,
                                            string.Concat(cTotalInd1Total, attNameExtension), ind.TotalInd1Total);
     CalculatorHelpers.SetAttributeDoubleF2(calculator,
                                            string.Concat(cTotalInd1BM, attNameExtension), ind.TotalInd1BM);
     CalculatorHelpers.SetAttributeDoubleF2(calculator,
                                            string.Concat(cTotalInd1BMProg, attNameExtension), ind.TotalInd1BMProg);
     CalculatorHelpers.SetAttribute(calculator,
                                    string.Concat(cTotalInd1Unit, attNameExtension), ind.TotalInd1Unit);
     //CalculatorHelpers.SetAttributeDateS(calculator,
     //        string.Concat(cInd1PTDate, attNameExtension), ind.SubP1PTDate);
     //CalculatorHelpers.SetAttributeDateS(calculator,
     //        string.Concat(cInd1YTDDate, attNameExtension), ind.SubP1YTDDate);
     CalculatorHelpers.SetAttributeDoubleF2(calculator,
                                            string.Concat(cTotalInd1PartTarget, attNameExtension), ind.TotalInd1PartTarget);
     CalculatorHelpers.SetAttributeDoubleF2(calculator,
                                            string.Concat(cTotalInd1FullTarget, attNameExtension), ind.TotalInd1FullTarget);
     CalculatorHelpers.SetAttributeDoubleF2(calculator,
                                            string.Concat(cTotalInd1PTProg, attNameExtension), ind.TotalInd1PTProg);
     CalculatorHelpers.SetAttributeDoubleF2(calculator,
                                            string.Concat(cTotalInd1FTProg, attNameExtension), ind.TotalInd1FTProg);
 }
Exemple #25
0
        private bool RunInputOrOutputCalculation(ref XElement currentElement,
                                                 ref XElement linkedViewElement, IDictionary <string, string> updates)
        {
            bool bHasCalculations = false;

            CalculatorHelpers.CALCULATOR_TYPES eCalculatorType
                = CalculatorHelpers.GetCalculatorType(
                      this.GCCalculatorParams.CalculatorType);
            IOCalculator ioCalculator = new IOCalculator();

            switch (eCalculatorType)
            {
            //these two apps are expected to need separate calcs in the future
            case CalculatorHelpers.CALCULATOR_TYPES.input:
                bHasCalculations
                    = ioCalculator.SetInputOutputCalculations(
                          eCalculatorType, this.GCCalculatorParams, ref linkedViewElement,
                          ref currentElement, updates);
                break;

            case CalculatorHelpers.CALCULATOR_TYPES.output:
                bHasCalculations
                    = ioCalculator.SetInputOutputCalculations(
                          eCalculatorType, this.GCCalculatorParams, ref linkedViewElement,
                          ref currentElement, updates);
                break;

            default:
                break;
            }
            return(bHasCalculations);
        }
Exemple #26
0
        private bool RunBudgetInvestmentCalculation(ref XElement currentElement,
                                                    ref XElement currentCalculationsElement)
        {
            bool bHasCalculations = false;

            CalculatorHelpers.CALCULATOR_TYPES eCalculatorType
                = CalculatorHelpers.GetCalculatorType(this.GCCalculatorParams.CalculatorType);
            BICalculator biCalculator = new BICalculator();

            switch (eCalculatorType)
            {
            case CalculatorHelpers.CALCULATOR_TYPES.budget:
                bHasCalculations
                    = biCalculator.SetBudgetAndInvestmentCalculations(
                          eCalculatorType, this.GCCalculatorParams, currentCalculationsElement,
                          currentElement, this.GCCalculatorParams.Updates);
                break;

            case CalculatorHelpers.CALCULATOR_TYPES.investment:
                bHasCalculations
                    = biCalculator.SetBudgetAndInvestmentCalculations(
                          eCalculatorType, this.GCCalculatorParams, currentCalculationsElement,
                          currentElement, this.GCCalculatorParams.Updates);
                break;

            default:
                break;
            }
            return(bHasCalculations);
        }
        public async Task <bool> RunDevPacksCalculations(CalculatorParameters calcParameters)
        {
            bool bHasCalculations = false;

            //these calculators use a mixed calculatorpatterns
            calcParameters.RunCalculatorType
                = CalculatorHelpers.RUN_CALCULATOR_TYPES.analyzeobjects;
            if (calcParameters.ExtensionDocToCalcURI.URIDataManager.SubAppType
                == Constants.SUBAPPLICATION_TYPES.inputprices.ToString() ||
                calcParameters.ExtensionDocToCalcURI.URIDataManager.SubAppType
                == Constants.SUBAPPLICATION_TYPES.outputprices.ToString())
            {
                calcParameters.RunCalculatorType
                    = CalculatorHelpers.RUN_CALCULATOR_TYPES.basic;
            }
            //both calculators and analyzers both calculate a file in this path:
            calcParameters.AnalyzerParms.ObservationsPath
                = calcParameters.ExtensionDocToCalcURI.URIDataManager.TempDocPath;
            //prepare the event subscriber
            DevPacksNPV1Subscriber subDevPacks
                = new DevPacksNPV1Subscriber(calcParameters);

            //run the analyses (raising the publisher's events for each node)
            bHasCalculations = await subDevPacks.RunDevPackCalculator();

            CalculatorHelpers.UpdateCalculatorParams(
                calcParameters, subDevPacks.GCCalculatorParams);
            subDevPacks = null;
            return(bHasCalculations);
        }
Exemple #28
0
 //serialize regular input properties
 public void SetNewInputAttributes(CalculatorParameters calcParameters,
                                   XElement elementNeedingAttributes)
 {
     CalculatorHelpers.SetAttributeDateS(elementNeedingAttributes,
                                         DataAppHelpers.Prices.INPUT_DATE, this.Date);
     CalculatorHelpers.SetAttributeDoubleF3(elementNeedingAttributes,
                                            DataAppHelpers.Prices.OC_AMOUNT, this.OCAmount);
     CalculatorHelpers.SetAttributeDoubleF3(elementNeedingAttributes,
                                            DataAppHelpers.Prices.OC_PRICE, this.OCPrice);
     CalculatorHelpers.SetAttribute(elementNeedingAttributes,
                                    DataAppHelpers.Prices.OC_UNIT, this.OCUnit);
     CalculatorHelpers.SetAttributeDoubleF3(elementNeedingAttributes,
                                            DataAppHelpers.Prices.AOH_AMOUNT, this.AOHAmount);
     CalculatorHelpers.SetAttributeDoubleF3(elementNeedingAttributes,
                                            DataAppHelpers.Prices.AOH_PRICE, this.AOHPrice);
     CalculatorHelpers.SetAttribute(elementNeedingAttributes,
                                    DataAppHelpers.Prices.AOH_UNIT, this.AOHUnit);
     CalculatorHelpers.SetAttributeDoubleF3(elementNeedingAttributes,
                                            DataAppHelpers.Prices.CAP_AMOUNT, this.CAPAmount);
     CalculatorHelpers.SetAttributeDoubleF3(elementNeedingAttributes,
                                            DataAppHelpers.Prices.CAP_PRICE, this.CAPPrice);
     CalculatorHelpers.SetAttribute(elementNeedingAttributes,
                                    DataAppHelpers.Prices.CAP_UNIT, this.CAPUnit);
     CalculatorHelpers.SetAttribute(elementNeedingAttributes,
                                    DataAppHelpers.Economics1.ANNUITY_TYPE, this.AnnuityType.ToString());
     if (this.Local != null)
     {
         //locals only for calculator
         this.Local.SetLocalAttributesForCalculator(calcParameters,
                                                    elementNeedingAttributes);
     }
 }
        private void AddObservation(XElement obsElement, ref CalculatorParameters calcParameters,
                                    ref string attName, ref string attValue)
        {
            string sAttributeValueList = string.Empty;

            //convert the attribute name to the statistical object property names
            //used in further analyses (i.e. output.amount to output.tramount)
            CostBenefitCalculator.ConvertAttributeNameToStatisticName(
                calcParameters.CurrentElementNodeName, ref attName);
            if (!string.IsNullOrEmpty(attName))
            {
                if (obsElement.Attribute(attName)
                    != null)
                {
                    //add to the existing observations
                    string sOldAttValue = CalculatorHelpers.GetAttribute(
                        obsElement, attName);
                    string sTotalAttsValue = string.Concat(sOldAttValue,
                                                           Constants.STRING_DELIMITER, attValue);
                    sAttributeValueList = string.Concat(sTotalAttsValue,
                                                        Constants.FILENAME_DELIMITER, calcParameters.AnalyzerParms.FilePositionIndex.ToString());
                    //double delimited string: 2.52_1;3.25_1
                    attValue = sAttributeValueList;
                }
                else
                {
                    //add to a new observation
                    //always use standard delimited string
                    sAttributeValueList = string.Concat(attValue,
                                                        Constants.FILENAME_DELIMITER, calcParameters.AnalyzerParms.FilePositionIndex.ToString());
                    //double delimited string: 2.52_1;3.25_1
                    attValue = sAttributeValueList;
                }
            }
        }
Exemple #30
0
 //set the class properties using the XElement
 private void SetDemog4Properties(Demog4 demog, string attNameExtension,
                                  XElement currentCalculationsElement)
 {
     //don't set any input properties; each calculator should set what's needed separately
     demog.D4Name        = CalculatorHelpers.GetAttribute(currentCalculationsElement, string.Concat(cD4Name, attNameExtension));
     demog.D4Label       = CalculatorHelpers.GetAttribute(currentCalculationsElement, string.Concat(cD4Label, attNameExtension));
     demog.D4Description = CalculatorHelpers.GetAttribute(currentCalculationsElement, string.Concat(cD4Description, attNameExtension));
     demog.D4NameA       = CalculatorHelpers.GetAttribute(currentCalculationsElement, string.Concat(cD4NameA, attNameExtension));
     demog.D4LabelA      = CalculatorHelpers.GetAttribute(currentCalculationsElement, string.Concat(cD4LabelA, attNameExtension));
     demog.D4AmountA     = CalculatorHelpers.GetAttribute(currentCalculationsElement, string.Concat(cD4AmountA, attNameExtension));
     demog.D4PopA        = CalculatorHelpers.GetAttribute(currentCalculationsElement, string.Concat(cD4PopA, attNameExtension));
     demog.D4UnitA       = CalculatorHelpers.GetAttribute(currentCalculationsElement, string.Concat(cD4UnitA, attNameExtension));
     demog.D4NameB       = CalculatorHelpers.GetAttribute(currentCalculationsElement, string.Concat(cD4NameB, attNameExtension));
     demog.D4LabelB      = CalculatorHelpers.GetAttribute(currentCalculationsElement, string.Concat(cD4LabelB, attNameExtension));
     demog.D4AmountB     = CalculatorHelpers.GetAttribute(currentCalculationsElement, string.Concat(cD4AmountB, attNameExtension));
     demog.D4PopB        = CalculatorHelpers.GetAttribute(currentCalculationsElement, string.Concat(cD4PopB, attNameExtension));
     demog.D4UnitB       = CalculatorHelpers.GetAttribute(currentCalculationsElement, string.Concat(cD4UnitB, attNameExtension));
     demog.D4NameC       = CalculatorHelpers.GetAttribute(currentCalculationsElement, string.Concat(cD4NameC, attNameExtension));
     demog.D4LabelC      = CalculatorHelpers.GetAttribute(currentCalculationsElement, string.Concat(cD4LabelC, attNameExtension));
     demog.D4AmountC     = CalculatorHelpers.GetAttribute(currentCalculationsElement, string.Concat(cD4AmountC, attNameExtension));
     demog.D4PopC        = CalculatorHelpers.GetAttribute(currentCalculationsElement, string.Concat(cD4PopC, attNameExtension));
     demog.D4UnitC       = CalculatorHelpers.GetAttribute(currentCalculationsElement, string.Concat(cD4UnitC, attNameExtension));
     demog.D4NameD       = CalculatorHelpers.GetAttribute(currentCalculationsElement, string.Concat(cD4NameD, attNameExtension));
     demog.D4LabelD      = CalculatorHelpers.GetAttribute(currentCalculationsElement, string.Concat(cD4LabelD, attNameExtension));
     demog.D4AmountD     = CalculatorHelpers.GetAttribute(currentCalculationsElement, string.Concat(cD4AmountD, attNameExtension));
     demog.D4PopD        = CalculatorHelpers.GetAttribute(currentCalculationsElement, string.Concat(cD4PopD, attNameExtension));
     demog.D4UnitD       = CalculatorHelpers.GetAttribute(currentCalculationsElement, string.Concat(cD4UnitD, attNameExtension));
     demog.D4NameE       = CalculatorHelpers.GetAttribute(currentCalculationsElement, string.Concat(cD4NameE, attNameExtension));
     demog.D4LabelE      = CalculatorHelpers.GetAttribute(currentCalculationsElement, string.Concat(cD4LabelE, attNameExtension));
     demog.D4AmountE     = CalculatorHelpers.GetAttribute(currentCalculationsElement, string.Concat(cD4AmountE, attNameExtension));
     demog.D4PopE        = CalculatorHelpers.GetAttribute(currentCalculationsElement, string.Concat(cD4PopE, attNameExtension));
     demog.D4UnitE       = CalculatorHelpers.GetAttribute(currentCalculationsElement, string.Concat(cD4UnitE, attNameExtension));
 }