Exemple #1
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 #2
0
        private double SetTotalCostsForCurrentState()
        {
            double   totalCost      = 0;
            int      i              = 0;
            DateTime lastFinishDate = CalculatorHelpers.GetDateShortNow();

            foreach (var uniqueOpComp in this.CurrentStateOpComps)
            {
                if (uniqueOpComp.TimelinessOpComps != null)
                {
                    foreach (var feasibleOpComp in uniqueOpComp.TimelinessOpComps)
                    {
                        if (i == 0)
                        {
                            //no dates need to be adjusted for first uniqueopcom
                            totalCost = TotalMachineryCost(feasibleOpComp);
                        }
                        else
                        {
                            //if needed, reset timeliness penalty
                            if (lastFinishDate > feasibleOpComp.ActualStartDate)
                            {
                                TimelinessOpComp1.SetTimelinessPenaltyNewActualDate(
                                    feasibleOpComp, lastFinishDate);
                            }
                            else if (feasibleOpComp.PlannedStartDate != feasibleOpComp.ActualStartDate)
                            {
                                //see if the planned start date can be done earlier
                                if (feasibleOpComp.PlannedStartDate > lastFinishDate)
                                {
                                    TimelinessOpComp1.SetTimelinessPenaltyNewActualDate(
                                        feasibleOpComp, feasibleOpComp.PlannedStartDate);
                                }
                                else
                                {
                                    //switch to a date somewhere between existing actual
                                    //and planned
                                    if (lastFinishDate > feasibleOpComp.PlannedStartDate &&
                                        lastFinishDate < feasibleOpComp.ActualStartDate)
                                    {
                                        TimelinessOpComp1.SetTimelinessPenaltyNewActualDate(
                                            feasibleOpComp, lastFinishDate);
                                    }
                                }
                            }
                            totalCost += TotalMachineryCost(feasibleOpComp);
                        }
                        lastFinishDate = feasibleOpComp.ProbableFinishDate;
                    }
                    i++;
                }
            }
            return(totalCost);
        }
 public void Init()
 {
     this.InitSharedObjectProperties();
     this.InitialValue             = 0;
     this.SalvageValue             = 0;
     this.CommonReferencePointDate = CalculatorHelpers.GetDateShortNow();
     this.PreProdPeriods           = 0;
     this.ProdPeriods   = 0;
     this.InitEOPDate   = CalculatorHelpers.GetDateShortNow();
     this.InvestmentEAA = 0;
     //init anything that will cause an exception when called
     this.Local          = new Local();
     this.TimePeriods    = new List <TimePeriod>();
     this.AnnEquivalents = new List <OperationComponent>();
     this.Calculators    = new List <Calculator1>();
 }
Exemple #4
0
 public void Init()
 {
     this.InitSharedObjectProperties();
     //init anything that will cause an exception when called
     this.Outcomes = new List<Outcome>();
     this.OperationComponents = new List<OperationComponent>();
     this.Calculators = new List<Calculator1>();
     this.Name2 = string.Empty;
     this.Amount = 0;
     this.IsDiscounted = false;
     this.IsCommonReference = false;
     this.GrowthPeriods = 0;
     this.GrowthTypeId = 0;
     this.OverheadFactor = 0;
     this.IncentiveAmount = 0;
     this.IncentiveRate = 0;
     this.LastPeriodDate = CalculatorHelpers.GetDateShortNow();
     this.AnnuityType = ANNUITY_TYPES.none;
 }
 public void InitTotalME2IndicatorStockProperties(ME2IndicatorStock ind)
 {
     ind.ErrorMessage       = string.Empty;
     ind.TME2Description    = string.Empty;
     ind.TME2Name           = string.Empty;
     ind.TME2Label          = string.Empty;
     ind.TME2Type           = RUC_TYPES.none.ToString();
     ind.TME2RelLabel       = string.Empty;
     ind.TME2TAmount        = 0;
     ind.TME2TUnit          = string.Empty;
     ind.TME2TD1Amount      = 0;
     ind.TME2TD1Unit        = string.Empty;
     ind.TME2TD2Amount      = 0;
     ind.TME2TD2Unit        = string.Empty;
     ind.TME2MathResult     = string.Empty;
     ind.TME2MathSubType    = Constants.NONE;
     ind.TME2TMAmount       = 0;
     ind.TME2TMUnit         = string.Empty;
     ind.TME2TLAmount       = 0;
     ind.TME2TLUnit         = string.Empty;
     ind.TME2TUAmount       = 0;
     ind.TME2TUUnit         = string.Empty;
     ind.TME2MathOperator   = MATH_OPERATOR_TYPES.none.ToString();
     ind.TME2MathExpression = string.Empty;
     ind.TME2N        = 0;
     ind.TME2Date     = CalculatorHelpers.GetDateShortNow();
     ind.TME2MathType = MATH_TYPES.none.ToString();
     ind.TME2BaseIO   = ME2Indicator.BASEIO_TYPES.none.ToString();
     ind.TME21Amount  = 0;
     ind.TME21Unit    = string.Empty;
     ind.TME22Amount  = 0;
     ind.TME22Unit    = string.Empty;
     ind.TME25Amount  = 0;
     ind.TME25Unit    = string.Empty;
     ind.TME23Amount  = 0;
     ind.TME23Unit    = string.Empty;
     ind.TME24Amount  = 0;
     ind.TME24Unit    = string.Empty;
 }