Class Curve_Disco_Affine

  • All Implemented Interfaces:
    Curve, Curve_Affine
    Direct Known Subclasses:
    ArrivalCurve_Disco_Affine, MaxServiceCurve_Disco_Affine, ServiceCurve_Disco_Affine

    public class Curve_Disco_Affine
    extends java.lang.Object
    implements Curve_Affine
    Class representing a piecewise linear affine curve, defined on [0,inf), by at most two segments.
    The curve is stored as an array of LinearSegment objects. Each of these objects defines a linear piece of the curve from one inflection point up to, but not including, the next. It is possible to define discontinuities by defining two subsequent LinearSegment instances which start at the same inflection point. In this case, the second segment needs to have leftopen set to true to indicate that the inflection point is excluded from the second segment.
    All arithmetic operations on a curve return a new instance of class Curve.
    • Field Detail

      • is_delayed_infinite_burst

        protected boolean is_delayed_infinite_burst
      • is_rate_latency

        protected boolean is_rate_latency
      • has_rate_latency_meta_info

        protected boolean has_rate_latency_meta_info
      • is_token_bucket

        protected boolean is_token_bucket
      • has_token_bucket_meta_info

        protected boolean has_token_bucket_meta_info
    • Constructor Detail

      • Curve_Disco_Affine

        protected Curve_Disco_Affine()
        Creates a Curve_Disco_Affine instance with 1 segment of type LinearSegment.
      • Curve_Disco_Affine

        protected Curve_Disco_Affine​(Curve curve)
        Creates a copy of the passed Curve_Disco_Affine instance curve.
      • Curve_Disco_Affine

        protected Curve_Disco_Affine​(int segment_count)
        Creates a Curve_Disco_Affine instance with segment_count number of LinearSegment.
        Parameters:
        segment_count - Number of segments in the curve. In case of affine curve, at max the number of segments can be two.
    • Method Detail

      • getFactory

        public static Curve_Disco_Affine getFactory()
        Returns an instance of Curve_Disco_Affine with one segment of LinearSegment.
        Returns:
        An instance of Curve_Disco_Affine
      • isRateLatency

        public boolean isRateLatency()
        Verifies weather the curve is a rate latency curve or not and decomposes the curve into rate latency components if it is a rate latency curve.
        Specified by:
        isRateLatency in interface Curve_Affine
        Returns:
        is_rate_latency Returns weather the give curve is rate latency curve or not.
      • isTokenBucket

        public boolean isTokenBucket()
        Verifies weather the curve is a token bucket or not Decomposes the curve into token bucket components if it is a token bucket curve.
        Specified by:
        isTokenBucket in interface Curve_Affine
        Returns:
        is_token_bucket
      • hasRateLatencyMetaInfo

        public boolean hasRateLatencyMetaInfo()
        Returns weather the curve already has rate latency meta info or not.
        Returns:
        <>codehas_rate_latency_meta_info<>code Returns weather or not the give curve has rate latency meta info.
      • setRL_MetaInfo

        public void setRL_MetaInfo​(boolean has_rate_latency_meta_info)
        Sets the has_rate_latency_meta_info to the passed arguments.
        Specified by:
        setRL_MetaInfo in interface Curve
        Parameters:
        has_rate_latency_meta_info - A boolean which tells weather the curve has rate latency meta info or not.
      • getRL_Components

        public java.util.List<Curve_Affine> getRL_Components()
        Returns the rate latency components of calling curve instance.
        Returns:
        tmp List of type CurveAffine
      • setRL_Components

        public void setRL_Components​(java.util.List<Curve> rate_latencies)
        Updates the rate_latencies of the calling object with the passed rate_latencies.
        Specified by:
        setRL_Components in interface Curve
        Parameters:
        rate_latencies - List of Curves each of which represent a rate latency component.
      • hasTokenBucketMetaInfo

        public boolean hasTokenBucketMetaInfo()
        Returns weather the curve already has token bucket meta info or not.
        Returns:
        has_token_bucket_meta_info Weather or not the give curve has token bucket meta info.
      • setTB_MetaInfo

        public void setTB_MetaInfo​(boolean has_token_bucket_meta_info)
        Update the has_token_bucket_meta_info of the calling object to the passed argument.
        Specified by:
        setTB_MetaInfo in interface Curve
        Parameters:
        has_token_bucket_meta_info -
      • getTB_Components

        public java.util.List<Curve_Affine> getTB_Components()
        Returns the token bucket components of the curve.
        Returns:
        tmp A list of Tocken bucket components Note: In this can it should be only one
      • setTB_Components

        public void setTB_Components​(java.util.List<Curve> token_buckets)
        Updates the token_buckets of the calling object with the passed token_buckets components.
        Specified by:
        setTB_Components in interface Curve
        Parameters:
        token_buckets - List of Curves, each of them representing a token bucket component. Note: In this case, at max there can be only one token bucket component.
      • createNewCurve

        private void createNewCurve​(int segment_count)
        Creates an affine curve with maximum of two segments.
        Parameters:
        segment_count - Number of segments to be created.
      • initializeCurve

        protected void initializeCurve​(java.lang.String curve_str)
                                throws java.lang.Exception
        Throws:
        java.lang.Exception
      • forceThroughOrigin

        protected void forceThroughOrigin()
        Add a segment at 0,0 with grad 0 if its not present already If affine curve case, the first segment is always at 0,0 and with grad 0.
      • clearMetaInfo

        private void clearMetaInfo()
        Resets the rate latency and token bucket meta info.
      • getSegment

        public LinearSegment_Disco getSegment​(int pos)
        Returns the segment at position pos (starting at 0).
        Specified by:
        getSegment in interface Curve
        Parameters:
        pos - The position of segment in the curve to be fetched. Note: In this case, the position can be either 0 or 1.
        Returns:
      • getSegmentCount

        public int getSegmentCount()
        Returns the number of segments in the curve. At max this can be two.
        Specified by:
        getSegmentCount in interface Curve
        Returns:
        segments.length Total number of segments in the curve
      • getSegmentDefining

        public int getSegmentDefining​(Num x)
        Returns the number of the segment that defines the function value at x-coordinate x. The number of the segment is usually the same as the one returned by getSegmentLimitRight(x), except for if a segment starts at x and is left-open. In this case the function returns the previous segment, rather than the current segment, as the previous segment defines x.
        Specified by:
        getSegmentDefining in interface Curve
        Parameters:
        x - The x-coordinate
        Returns:
        i or -1 The index of the segment into the array.
      • getSegmentLimitRight

        public int getSegmentLimitRight​(Num x)
        Returns the number of the segment that defines the value of the function when computing the limit to the right of the function at x-coordinate x. The number of the segment is usually the same as the one returned by getSegmentDefining(x), except for if a segment starts at x and is left-open. In this case the function returns the current segment, rather than the previous segment.
        Parameters:
        x - The x-coordinate
        Returns:
        i or -1 The index of the segment into the array.
      • setSegment

        public void setSegment​(int pos,
                               LinearSegment s)
        Insets the segment at position pos.
        Parameters:
        pos - The position at which the segment s has to be inserted.
        s - The linear segment to be inserted
      • setSegments

        protected void setSegments​(LinearSegment[] segments)
        Setting the this.segments to the passes segments Note: Since this is an affine curve, the segments count of passed segment cannot exceed two.
        Parameters:
        segments - Segments to be set to this.segments
      • addSegment

        public void addSegment​(LinearSegment s)
        Adds a LinearSegment to the end of the curve.
        Note: It is the user's responsibility to add segments in the order of increasing x-coordinates.
        Specified by:
        addSegment in interface Curve
        Parameters:
        s - the segment to be added.
      • addSegment

        public void addSegment​(int pos,
                               LinearSegment s)
        Adds a LinearSegment at the location pos of the curve.
        Note1: Segments after pos will be pushed back by one position.
        Note2: It is the user's responsibility to add segments in the order of increasing x-coordinates.
        Specified by:
        addSegment in interface Curve
        Parameters:
        pos - the index into the segment array to add the new segment.
        s - the segment to be added.
      • removeSegment

        public void removeSegment​(int pos)
        Removes the segment at position pos.
        Specified by:
        removeSegment in interface Curve
        Parameters:
        pos - The index of the segment to be removed.
      • isDiscontinuity

        public boolean isDiscontinuity​(int pos)
        Returns whether the inflection point is a (real or unreal) discontinuity.
        Specified by:
        isDiscontinuity in interface Curve
        Parameters:
        pos - the index of the IP
        Returns:
        true if the IP is a discontinuity, false if not.
      • isRealDiscontinuity

        public boolean isRealDiscontinuity​(int pos)
        Returns whether the inflection point is a real discontinuity, i.e. the y0 of the leftopen segment differs from the previous one.
        Specified by:
        isRealDiscontinuity in interface Curve
        Parameters:
        pos - the index of the IP
        Returns:
        true if the IP is a real discontinuity, false if not.
      • isUnrealDiscontinuity

        public boolean isUnrealDiscontinuity​(int pos)
        Returns whether the inflection point is an unreal discontinuity, i.e. the y0 of the leftopen segment is coincident with the y0 of the previous segment and therefore the unreal discontinuity may safely be removed.
        Specified by:
        isUnrealDiscontinuity in interface Curve
        Parameters:
        pos - the index of the IP
        Returns:
        true if the IP is an unreal discontinuity, false if not.
      • isWideSenseIncreasing

        public boolean isWideSenseIncreasing()
        Tests whether the curve is wide-sense increasing.
        Specified by:
        isWideSenseIncreasing in interface Curve
        Returns:
        True/False whether the curve is wide-sense increasing.
      • isConvex

        public boolean isConvex()
        Test whether the curve us convex.
        Specified by:
        isConvex in interface Curve
        Returns:
        Returns whether the curve is Convex or not
      • isConvexIn

        public boolean isConvexIn​(Num a,
                                  Num b)
        Tests whether the curve is convex in [a,b].
        Specified by:
        isConvexIn in interface Curve
        Parameters:
        a - the lower bound of the test interval.
        b - the upper bound of the test interval.
        Returns:
        whether the curve is convex.
      • isConcave

        public boolean isConcave()
        Tests whether the curve is concave.
        Specified by:
        isConcave in interface Curve
        Returns:
        whether the curve is concave.
      • isConcaveIn

        public boolean isConcaveIn​(Num a,
                                   Num b)
        Tests whether the curve is concave in [a,b].
        Specified by:
        isConcaveIn in interface Curve
        Parameters:
        a - the lower bound of the test interval.
        b - the upper bound of the test interval.
        Returns:
        whether the curve is concave.
      • isAlmostConcave

        public boolean isAlmostConcave()
        Tests whether the curve is almost concave, i.e. it is concave once its function value is larger than 0.
        Specified by:
        isAlmostConcave in interface Curve
        Returns:
        whether the curve is almost concave.
      • equals

        public boolean equals​(java.lang.Object obj)
        To check whether this object instance is equal to the passing instance.
        Specified by:
        equals in interface Curve
        Overrides:
        equals in class java.lang.Object
        Parameters:
        obj - Some object.
        Returns:
        True if the passed object is similar to calling object
      • hashCode

        public int hashCode()
        To generate the hash code of a curve based on its segments.
        Specified by:
        hashCode in interface Curve
        Overrides:
        hashCode in class java.lang.Object
        Returns:
        Hash value of this curve.
      • toString

        public java.lang.String toString()
        Returns a string representation of this curve.
        Specified by:
        toString in interface Curve
        Overrides:
        toString in class java.lang.Object
        Returns:
        The curve represented as a string. Eg: {(0,0),0;(0,1),1}
      • f

        public Num f​(Num x)
        Returns the function value at x-coordinate x, if x>=0, and NaN if not.
        Specified by:
        f in interface Curve
        Parameters:
        x - The x-coordinate
        Returns:
        The function value.
      • fLimitRight

        public Num fLimitRight​(Num x)
        Returns the limit to the right of the function value at x-coordinate x, if x>=0, and NaN if not.
        Specified by:
        fLimitRight in interface Curve
        Parameters:
        x - The x-coordinate
        Returns:
        The function value.
      • f_inv

        public Num f_inv​(Num y)
        Returns the smallest x value at which the function value is equal to y.
        Specified by:
        f_inv in interface Curve
        Parameters:
        y - The y-coordinate
        Returns:
        The smallest x value
      • f_inv

        public Num f_inv​(Num y,
                         boolean rightmost)
        Returns the x value at which the function value is equal to y. If rightmost is true, returns the rightmost x-coordinate, otherwise the leftmost coordinate.
        Specified by:
        f_inv in interface Curve
        Parameters:
        y - The y-coordinate.
        rightmost - Return the rightmost x coordinate instead of the leftmost one (default).
        Returns:
        The smallest x value.
      • getSegmentFirstAtValue

        private int getSegmentFirstAtValue​(Num y)
        Returns the first segment at which the function reaches the value y. It returns -1 if the curve never reaches this value.
        Parameters:
        y - The y-coordinate
        Returns:
        The segment number.
      • getLatency

        public Num getLatency()
        Returns the x-coordinate of the inflection point after which the function values are greater than zero.
        Specified by:
        getLatency in interface Curve
        Returns:
        The latency of this curve.
      • getBurst

        public Num getBurst()
        Returns the burst of the curve.
        Specified by:
        getBurst in interface Curve
        Returns:
        The burstiness
      • getGradientLimitRight

        public Num getGradientLimitRight​(Num x)
        Returns the gradient to the right of the function value at x-coordinate x, if x>=0, and NaN if not.
        Specified by:
        getGradientLimitRight in interface Curve
        Parameters:
        x - The x-coordinate
        Returns:
        The function value.
      • getUltAffineRate

        public Num getUltAffineRate()
        Returns the gradient of the last segment.
        Specified by:
        getUltAffineRate in interface Curve
        Returns:
        The rate of the ultimately affine part.
      • isDelayedInfiniteBurst

        public boolean isDelayedInfiniteBurst()
        Returns whether or not the curve is delayed infinite burst
        Specified by:
        isDelayedInfiniteBurst in interface Curve
        Returns:
        is_delayed_infinite_burst Returns True if the curve is delayed infinite burst otherwise false.
      • getRL_Property

        public boolean getRL_Property()
        Decomposes the curve into rate latency components and returns if its a rate latency curve.
        Returns:
        is_rate_latency Returns true if the curve has one rate latency component otherwise false.
      • setRateLateny

        public void setRateLateny​(boolean is_rate_latency)
        Setter method for the flag is_rate_latency.
        Specified by:
        setRateLateny in interface Curve
        Parameters:
        is_rate_latency - Boolean to be set.
      • getRL_ComponentCount

        public int getRL_ComponentCount()
        Returns the number of rate latency curves the curve can be decomposed into.
        Specified by:
        getRL_ComponentCount in interface Curve
        Returns:
        The number of rate latency curves.
      • getRL_Component

        public Curve_Disco_Affine getRL_Component​(int i)
        Returns the ithe rate latency curve that this curve can be decomposed into.
        Specified by:
        getRL_Component in interface Curve
        Parameters:
        i - The number of the rate latency curve.
        Returns:
        The rate latency curve
      • decomposeIntoRateLatencies

        private void decomposeIntoRateLatencies()
        Decomposes this curve into a list of rate latency curves and stores this list in the curve's rate_latencies field.
      • setTokenBucket

        public void setTokenBucket​(boolean is_token_bucket)
        Setter method for is_token_bucket flag.
        Specified by:
        setTokenBucket in interface Curve
        Parameters:
        is_token_bucket - Boolean representing weather or not its token bucket.
      • getTB_ComponentCount

        public int getTB_ComponentCount()
        Returns the number of token buckets the curve can be decomposed into. Note: In this case, it can be maximum 1
        Specified by:
        getTB_ComponentCount in interface Curve
        Returns:
        The number of token buckets
      • getTB_Component

        public Curve_Disco_Affine getTB_Component​(int i)
        Returns the ithe token bucket curve that this curve can be decomposed into.
        Specified by:
        getTB_Component in interface Curve
        Parameters:
        i - The number of the token bucket
        Returns:
        The token bucket
      • decomposeIntoTokenBuckets

        private void decomposeIntoTokenBuckets()
        Decomposes this curve into a list of token bucket curves and stores this list in the curve's token_buckets field.
      • createZeroCurve

        public Curve_Disco_Affine createZeroCurve()
        This creates an instance of Curve_Disco_Affine with 1 segment.
        Specified by:
        createZeroCurve in interface Curve
        Returns:
        An instance of Curve_Disco_Affine
      • createHorizontal

        public Curve_Disco_Affine createHorizontal​(Num y)
        This creates an instance of Curve_Disco_Affine with rate 0 and burst equal to y. ie a horizontal curve
        Specified by:
        createHorizontal in interface Curve
        Parameters:
        y - The burst value
        Returns:
        c_dnc An instance of Curve_Disco_Affine
      • createServiceCurve

        public ServiceCurve_Disco_Affine createServiceCurve()
        This creates an instance of affine service curve with number of segments equal to 1
        Specified by:
        createServiceCurve in interface Curve
        Returns:
        An instance of ServiceCurve_Disco_Affine.
      • createServiceCurve

        public ServiceCurve_Disco_Affine createServiceCurve​(int segment_count)
        This creates an instance of affine service curve with number of segments equal to passed segment_count.
        Specified by:
        createServiceCurve in interface Curve
        Parameters:
        segment_count - The number of segments to be created.
        Returns:
        An instance of ServiceCurve_Disco_Affine.
      • createServiceCurve

        public ServiceCurve_Disco_Affine createServiceCurve​(java.lang.String service_curve_str)
                                                     throws java.lang.Exception
        This creates an instance of affine service curve from the string representation of the curve.
        Specified by:
        createServiceCurve in interface Curve
        Parameters:
        service_curve_str - The string representation of curve.
        Returns:
        An instance of ServiceCurve_Disco_Affine.
        Throws:
        java.lang.Exception
      • createServiceCurve

        public ServiceCurve_Disco_Affine createServiceCurve​(Curve curve)
        This creates an instance of affine service curve same as the passed curve instance.
        Specified by:
        createServiceCurve in interface Curve
        Parameters:
        curve - An instance of Curve.
        Returns:
        An instance of ServiceCurve_Disco_Affine.
      • createDelayedInfiniteBurst

        public ServiceCurve_Disco_Affine createDelayedInfiniteBurst​(double delay)
        Wrapper to create affine service curve with delay and infinite burst when delay is passed as double.
        Specified by:
        createDelayedInfiniteBurst in interface Curve
        Parameters:
        delay - The delay in the rate
        Returns:
        An instance of ServiceCurve_Disco_Affine.
      • createDelayedInfiniteBurst

        public ServiceCurve_Disco_Affine createDelayedInfiniteBurst​(Num delay)
        This creates affine service curve with delay and infinite burst.
        Specified by:
        createDelayedInfiniteBurst in interface Curve
        Parameters:
        delay - The delay in the rate.
        Returns:
        sc_dnc An instance of ServiceCurve_Disco_Affine.
      • createRateLatency

        public ServiceCurve_Disco_Affine createRateLatency​(double rate,
                                                           double latency)
        Wrapper to create rate latency for the ServiceCurve_Disco_Affine with rate and latency passed as double.
        Specified by:
        createRateLatency in interface Curve
        Parameters:
        rate - The rate of the curve.
        latency - The latency of the curve.
        Returns:
        An instance of ServiceCurve_Disco_Affine.
      • createRateLatency

        public ServiceCurve_Disco_Affine createRateLatency​(Num rate,
                                                           Num latency)
        Wrapper to create rate latency for the ServiceCurve_Disco_Affine.
        Specified by:
        createRateLatency in interface Curve
        Parameters:
        rate - The rate of the curve.
        latency - The latency of the curve.
        Returns:
        sc_dnc An instance of ServiceCurve_Disco_Affine.
      • createArrivalCurve

        public ArrivalCurve_Disco_Affine createArrivalCurve()
        To create affine arrival curve with number of segments equal to one.
        Specified by:
        createArrivalCurve in interface Curve
        Returns:
        An instance of ArrivalCurve_Disco_Affine.
      • createArrivalCurve

        public ArrivalCurve_Disco_Affine createArrivalCurve​(int segment_count)
        This creates an affine arrival curve with segments equal to the passed segment_count
        Specified by:
        createArrivalCurve in interface Curve
        Parameters:
        segment_count - The number of segments to be created for the affine arrival curve
        Returns:
        An instance of ArrivalCurve_Disco_Affine
      • createArrivalCurve

        public ArrivalCurve_Disco_Affine createArrivalCurve​(java.lang.String arrival_curve_str)
                                                     throws java.lang.Exception
        This creates an affine arrival curve from the passed string representation of curve.
        Specified by:
        createArrivalCurve in interface Curve
        Parameters:
        arrival_curve_str - A string representation of the curve.
        Returns:
        An instance of ArrivalCurve_Disco_Affine.
        Throws:
        java.lang.Exception
      • createArrivalCurve

        public ArrivalCurve_Disco_Affine createArrivalCurve​(Curve curve)
        This creates an affine arrival curve from the passed curve.
        Specified by:
        createArrivalCurve in interface Curve
        Parameters:
        curve - An instance of the type Curve.
        Returns:
        An instance of ArrivalCurve_Disco_Affine.
      • createPeakArrivalRate

        public ArrivalCurve_Disco_Affine createPeakArrivalRate​(double rate)
        Wrapper to create affine arrival curve with 0 burst and 0 latency.
        Specified by:
        createPeakArrivalRate in interface Curve
        Parameters:
        rate - The rate of the curve to be created.
        Returns:
        An instance of ArrivalCurve_Disco_Affine.
      • createPeakArrivalRate

        public ArrivalCurve_Disco_Affine createPeakArrivalRate​(Num rate)
        To create a affine arrival curve with 0 burst and 0 latency.
        Specified by:
        createPeakArrivalRate in interface Curve
        Parameters:
        rate - The rate of the curve to be created.
        Returns:
        ac_dnc An instance of ArrivalCurve_Disco_Affine.
      • createTokenBucket

        public ArrivalCurve_Disco_Affine createTokenBucket​(double rate,
                                                           double burst)
        To create a token bucket affine arrival curve.
        Specified by:
        createTokenBucket in interface Curve
        Parameters:
        rate - The rate of the affine curve.
        burst - The burst of the affine curve.
        Returns:
        ac_dnc An instance of ArrivalCurve_Disco_Affine with token bucket.
      • createTokenBucket

        public ArrivalCurve_Disco_Affine createTokenBucket​(Num rate,
                                                           Num burst)
        To create a token bucket affine arrival curve.
        Specified by:
        createTokenBucket in interface Curve
        Parameters:
        rate - The rate of the affine curve.
        burst - The burst of the affine curve.
        Returns:
        ac_dnc An instance of ArrivalCurve_Disco_Affine with token bucket.
      • createMaxServiceCurve

        public MaxServiceCurve_Disco_Affine createMaxServiceCurve​(int segment_count)
        Wrapper to create Max service curve DNC with segments equal to segment_count.
        Specified by:
        createMaxServiceCurve in interface Curve
        Parameters:
        segment_count - The number of segments to be created for this curve instance. Note: In this case, it cannot be more than two.
        Returns:
      • createMaxServiceCurve

        public MaxServiceCurve_Disco_Affine createMaxServiceCurve​(java.lang.String max_service_curve_str)
                                                           throws java.lang.Exception
        Wrapper to create Max service curve DNC from string representation.
        Specified by:
        createMaxServiceCurve in interface Curve
        Parameters:
        max_service_curve_str - The string representation of the curve.
        Returns:
        An instance of MaxServiceCurve_Disco_Affine.
        Throws:
        java.lang.Exception
      • createMaxServiceCurve

        public MaxServiceCurve_Disco_Affine createMaxServiceCurve​(Curve curve)
        Wrapper method to create a Max service curve DNC from an existing curve.
        Specified by:
        createMaxServiceCurve in interface Curve
        Parameters:
        curve -
        Returns:
        An instance of MaxServiceCurve_Disco_Affine.
      • createInfiniteMaxService

        public MaxServiceCurve_Disco_Affine createInfiniteMaxService()
        A wrapper method to create delayed infinite curve for MaxServiceCurve_Disco_Affine.
        Returns:
      • createDelayedInfiniteBurstMSC

        public MaxServiceCurve_Disco_Affine createDelayedInfiniteBurstMSC​(double delay)
        A wrapper method MaxServiceCurve_Disco_Affine curve having infinite burst with delay.
        Specified by:
        createDelayedInfiniteBurstMSC in interface Curve
        Parameters:
        delay - The latency of the affine curve.
        Returns:
        An instance of MaxServiceCurve_Disco_Affine.
      • createDelayedInfiniteBurstMSC

        public MaxServiceCurve_Disco_Affine createDelayedInfiniteBurstMSC​(Num delay)
        Create a MaxServiceCurve_Disco_Affine curve having infinite burst after a given delay.
        Specified by:
        createDelayedInfiniteBurstMSC in interface Curve
        Parameters:
        delay - The latency of the affine curve.
        Returns:
        msc_dnc An instance of MaxServiceCurve_Disco_Affine.
      • createRateLatencyMSC

        public MaxServiceCurve_Disco_Affine createRateLatencyMSC​(double rate,
                                                                 double latency)
        A wrapper to create a service curve with rate latency with rate and latency represented in double.
        Specified by:
        createRateLatencyMSC in interface Curve
        Parameters:
        rate - The rate of the curve.
        latency - The rate latency component of the curve.
        Returns:
        msc_dnc An instance of MaxServiceCurve_Disco_Affine.
      • createRateLatencyMSC

        public MaxServiceCurve_Disco_Affine createRateLatencyMSC​(Num rate,
                                                                 Num latency)
        Create a service curve with a rate and a latency.
        Specified by:
        createRateLatencyMSC in interface Curve
        Parameters:
        rate - The rate of the curve.
        latency - The rate latency component of the curve.
        Returns:
        msc_dnc An instance of MaxServiceCurve_Disco_Affine.
      • makeHorizontal

        private void makeHorizontal​(Curve_Disco_Affine c_dnc,
                                    Num y)
        Create a curve with rate 0 and burst y, i.e. a horizontal curve.
        Parameters:
        c_dnc - An instance of Curve_Disco_Affine to which segments have to be created.
        y - The burst component if any.
      • makeDelayedInfiniteBurst

        private void makeDelayedInfiniteBurst​(Curve_Disco_Affine c_dnc,
                                              Num delay)
        Create a curve with infinite burst.
        Parameters:
        c_dnc - An instance of Curve_Disco_Affine to which segments have to be created.
        delay - The latency of the affine curve.
      • makePeakRate

        private void makePeakRate​(Curve_Disco_Affine c_dnc,
                                  Num rate)
        To create a curve which had no burst and latency. Note: This is a special case of affine curve which is both rate latency and token bucket curve with burst (token bucket component) and latency (rate latency component) set to 0.
        Parameters:
        c_dnc - An instance of Curve_Disco_Affine to which segments have to be created.
        rate - Rate of the linear segment.
      • makeRateLatency

        private void makeRateLatency​(Curve_Disco_Affine c_dnc,
                                     Num rate,
                                     Num latency)
        Create a rate latency curve based on the passed rate and latency.
        Parameters:
        c_dnc - The curve to which the rate latency has to be created.
        rate - The rate of the affine curve.
        latency - Latency of the affine curve.
      • makeTokenBucket

        private void makeTokenBucket​(Curve_Disco_Affine c_dnc,
                                     Num rate,
                                     Num burst)
        Create a token bucket affine curve based on the passed rate and burst.
        Parameters:
        c_dnc - The curve to which the token bucket has to be created.
        rate - The rate of the affine curve.
        burst - Burst of the affine curve.