示例#1
0
 /// <summary>
 /// Determines the best good point before the end bound.
 /// </summary>
 protected void UpdatePriorPoint(BoundingValue bound, AggregateState state)
 {
     if (state.HasTerminated && (state.LatePoint == null) && bound.PriorPoint == null)
     {
         bound.PriorPoint     = state.PriorPoint;
         bound.PriorBadPoints = state.PriorBadPoints;
         bound.DerivationType = UseSlopedExtrapolation ? BoundingValueType.SlopedExtrapolation : BoundingValueType.SteppedExtrapolation;
     }
 }
示例#2
0
 /// <summary>
 /// Determines the best good point before the end bound. 
 /// </summary>
 protected void UpdatePriorPoint(BoundingValue bound, AggregateState state)
 {
     if (state.HasTerminated && (state.LatePoint == null) && bound.PriorPoint == null)
     {
         bound.PriorPoint = state.PriorPoint;
         bound.PriorBadPoints = state.PriorBadPoints;
         bound.DerivationType = UseSlopedExtrapolation ? BoundingValueType.SlopedExtrapolation : BoundingValueType.SteppedExtrapolation;
     }
 }
示例#3
0
        /// <summary>
        /// Updates the bounding values for the time slice.
        /// </summary>
        public override void UpdateBoundingValues(TimeSlice bucket, AggregateState state)
        {
            BoundingValue EarlyBound = bucket.EarlyBound;
            BoundingValue LateBound  = bucket.LateBound;

            if (bucket.ExactMatch(state.LatestTimestamp))
            {
                EarlyBound.RawPoint       = state.LatePoint == null ? state.EarlyPoint : state.LatePoint;
                EarlyBound.DerivationType = BoundingValueType.QualityRaw;
            }
            else
            {
                if (EarlyBound.DerivationType != BoundingValueType.QualityRaw)
                {
                    if (EarlyBound.EarlyPoint == null)
                    {
                        if ((state.EarlyPoint != null) && (state.EarlyPoint.SourceTimestamp < bucket.From))
                        {
                            EarlyBound.EarlyPoint = state.EarlyPoint;
                        }
                    }
                    if (EarlyBound.LatePoint == null)
                    {
                        if ((state.LatePoint != null) && (state.LatePoint.SourceTimestamp >= bucket.From))
                        {
                            EarlyBound.CurrentBadPoints = new List <DataValue>();
                            foreach (DataValue dv in state.CurrentBadPoints)
                            {
                                if (dv.SourceTimestamp < EarlyBound.Timestamp)
                                {
                                    EarlyBound.CurrentBadPoints.Add(dv);
                                }
                            }
                            EarlyBound.DerivationType = BoundingValueType.QualityInterpolation;
                        }
                    }
                }
                if (state.HasTerminated && (state.LatePoint == null))
                {
                    EarlyBound.CurrentBadPoints = new List <DataValue>();
                    foreach (DataValue dv in state.CurrentBadPoints)
                    {
                        if (dv.SourceTimestamp < EarlyBound.Timestamp)
                        {
                            EarlyBound.CurrentBadPoints.Add(dv);
                        }
                    }
                    EarlyBound.DerivationType = BoundingValueType.QualityExtrapolation;
                }
            }

            if (bucket.EndMatch(state.LatestTimestamp))
            {
                LateBound.RawPoint       = state.LatePoint == null ? state.EarlyPoint : state.LatePoint;
                LateBound.DerivationType = BoundingValueType.QualityRaw;
            }
            else
            {
                if (LateBound.DerivationType != BoundingValueType.QualityRaw)
                {
                    if ((state.EarlyPoint != null) && (state.EarlyPoint.SourceTimestamp < bucket.To))
                    {
                        LateBound.EarlyPoint = state.EarlyPoint;
                    }
                    if (LateBound.LatePoint == null)
                    {
                        if ((state.LatePoint != null) && (state.LatePoint.SourceTimestamp >= bucket.To))
                        {
                            LateBound.CurrentBadPoints = new List <DataValue>();
                            foreach (DataValue dv in state.CurrentBadPoints)
                            {
                                if (dv.SourceTimestamp < LateBound.Timestamp)
                                {
                                    LateBound.CurrentBadPoints.Add(dv);
                                }
                            }
                            LateBound.DerivationType = BoundingValueType.QualityInterpolation;
                        }
                    }
                }
                if (state.HasTerminated && (state.LatePoint == null))
                {
                    LateBound.CurrentBadPoints = new List <DataValue>();
                    foreach (DataValue dv in state.CurrentBadPoints)
                    {
                        if (dv.SourceTimestamp < LateBound.Timestamp)
                        {
                            LateBound.CurrentBadPoints.Add(dv);
                        }
                    }
                    LateBound.DerivationType = BoundingValueType.QualityExtrapolation;
                }
            }
        }
示例#4
0
        /// <summary>
        /// Updates the bounding values for the time slice.
        /// </summary>
        public override void UpdateBoundingValues(TimeSlice bucket, AggregateState state)
        {
            BoundingValue EarlyBound = bucket.EarlyBound;
            BoundingValue LateBound  = bucket.LateBound;

            if (bucket.ExactMatch(state.LatestTimestamp) && StatusCode.IsGood(state.LatestStatus))
            {
                EarlyBound.RawPoint       = state.LatePoint == null ? state.EarlyPoint : state.LatePoint;
                EarlyBound.DerivationType = BoundingValueType.Raw;
            }
            else
            {
                if (EarlyBound.DerivationType != BoundingValueType.Raw)
                {
                    if (EarlyBound.EarlyPoint == null)
                    {
                        if ((state.EarlyPoint != null) && (state.EarlyPoint.SourceTimestamp < bucket.From))
                        {
                            EarlyBound.EarlyPoint = state.EarlyPoint;
                        }
                    }
                    if (EarlyBound.LatePoint == null)
                    {
                        if ((state.LatePoint != null) && (state.LatePoint.SourceTimestamp >= bucket.From))
                        {
                            EarlyBound.LatePoint = state.LatePoint;
                            if (SteppedVariable)
                            {
                                EarlyBound.CurrentBadPoints = new List <DataValue>();
                                foreach (DataValue dv in state.CurrentBadPoints)
                                {
                                    if (dv.SourceTimestamp < EarlyBound.Timestamp)
                                    {
                                        EarlyBound.CurrentBadPoints.Add(dv);
                                    }
                                }
                            }
                            else
                            {
                                EarlyBound.CurrentBadPoints = state.CurrentBadPoints;
                            }
                            EarlyBound.DerivationType = SteppedVariable ? BoundingValueType.SteppedInterpolation : BoundingValueType.SlopedInterpolation;
                        }
                    }
                }
                if (state.HasTerminated && (state.LatePoint == null))
                {
                    if (SteppedVariable)
                    {
                        EarlyBound.CurrentBadPoints = new List <DataValue>();
                        foreach (DataValue dv in state.CurrentBadPoints)
                        {
                            if (dv.SourceTimestamp < EarlyBound.Timestamp)
                            {
                                EarlyBound.CurrentBadPoints.Add(dv);
                            }
                        }
                    }
                    else
                    {
                        EarlyBound.CurrentBadPoints = state.CurrentBadPoints;
                    }
                }
            }

            if (bucket.EndMatch(state.LatestTimestamp) && StatusCode.IsGood(state.LatestStatus))
            {
                LateBound.RawPoint       = state.LatePoint == null ? state.EarlyPoint : state.LatePoint;
                LateBound.DerivationType = BoundingValueType.Raw;
            }
            else
            {
                if (LateBound.DerivationType != BoundingValueType.Raw)
                {
                    if ((state.EarlyPoint != null) && (state.EarlyPoint.SourceTimestamp < bucket.To))
                    {
                        LateBound.EarlyPoint = state.EarlyPoint;
                    }
                    if (LateBound.LatePoint == null)
                    {
                        if ((state.LatePoint != null) && (state.LatePoint.SourceTimestamp >= bucket.To))
                        {
                            LateBound.LatePoint = state.LatePoint;
                            if (SteppedVariable)
                            {
                                LateBound.CurrentBadPoints = new List <DataValue>();
                                foreach (DataValue dv in state.CurrentBadPoints)
                                {
                                    if (dv.SourceTimestamp < LateBound.Timestamp)
                                    {
                                        LateBound.CurrentBadPoints.Add(dv);
                                    }
                                }
                            }
                            else
                            {
                                LateBound.CurrentBadPoints = state.CurrentBadPoints;
                            }
                            LateBound.DerivationType = SteppedVariable ? BoundingValueType.SteppedInterpolation : BoundingValueType.SlopedInterpolation;
                        }
                    }
                }
                if (state.HasTerminated && (state.LatePoint == null))
                {
                    if (SteppedVariable)
                    {
                        LateBound.CurrentBadPoints = new List <DataValue>();
                        foreach (DataValue dv in state.CurrentBadPoints)
                        {
                            if (dv.SourceTimestamp < LateBound.Timestamp)
                            {
                                LateBound.CurrentBadPoints.Add(dv);
                            }
                        }
                    }
                    else
                    {
                        LateBound.CurrentBadPoints = state.CurrentBadPoints;
                    }
                }
                UpdatePriorPoint(LateBound, state);
            }
        }