Package org.networkcalculus.dnc.curves
Interface Curve
-
- All Known Subinterfaces:
ArrivalCurve
,Curve_Affine
,Curve_PwAffine
,MaxServiceCurve
,ServiceCurve
- All Known Implementing Classes:
ArrivalCurve_Disco_Affine
,ArrivalCurve_Disco_PwAffine
,ArrivalCurve_MPARTC_PwAffine
,Curve_Disco_Affine
,Curve_Disco_PwAffine
,Curve_MPARTC_PwAffine
,MaxServiceCurve_Disco_Affine
,MaxServiceCurve_Disco_PwAffine
,MaxServiceCurve_MPARTC_PwAffine
,ServiceCurve_Disco_Affine
,ServiceCurve_Disco_PwAffine
,ServiceCurve_MPARTC_PwAffine
public interface Curve
Interface for wide-sense increasing, plain curves.
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static class
Curve.CurveOperation
-
Method Summary
Modifier and Type Method Description static ArrivalCurve
add(ArrivalCurve arrival_curve_1, ArrivalCurve arrival_curve_2)
static ArrivalCurve
add(ArrivalCurve arrival_curve_1, Num dy)
static Curve
add(Curve curve1, Curve curve2)
Returns a curve that is the sum of this curve and the given curve.static Curve
add(Curve curve, Num dy)
Returns a copy of this curve shifted vertically bydy
.static MaxServiceCurve
add(MaxServiceCurve max_service_curve_1, MaxServiceCurve max_service_curve_2)
static MaxServiceCurve
add(MaxServiceCurve max_service_curve_1, Num dy)
static ServiceCurve
add(ServiceCurve c1, ServiceCurve c2)
void
addSegment(int pos, LinearSegment s)
void
addSegment(LinearSegment s)
static void
beautify(Curve c)
static Curve
boundAtXAxis(Curve curve)
Returns a copy of curve bounded at the x-axis.static java.util.ArrayList<Num>
computeInflectionPointsX(Curve c1, Curve c2)
Returns anArrayList
instance of those x-coordinates at which either c1 or c2 or both have an inflection point.static java.util.ArrayList<Num>
computeInflectionPointsY(Curve c1, Curve c2)
Returns anArrayList
instance of those y-coordinates at which either c1 or c2 or both have an inflection point.static Curve
computeResultingCurve(Curve curve1, Curve curve2, Curve.CurveOperation operator)
Common helper for computing a new curve.Curve
copy()
void
copy(Curve curve)
ArrivalCurve
createArrivalCurve()
ArrivalCurve
createArrivalCurve(int segment_count)
ArrivalCurve
createArrivalCurve(java.lang.String arrival_curve_str)
ArrivalCurve
createArrivalCurve(Curve curve)
ArrivalCurve
createArrivalCurve(Curve curve, boolean remove_latency)
Curve
createCurve(java.util.List<LinearSegment> segments)
ServiceCurve
createDelayedInfiniteBurst(double delay)
ServiceCurve
createDelayedInfiniteBurst(Num delay)
MaxServiceCurve
createDelayedInfiniteBurstMSC(double delay)
MaxServiceCurve
createDelayedInfiniteBurstMSC(Num delay)
Curve
createHorizontal(Num y)
ArrivalCurve
createInfiniteArrivals()
MaxServiceCurve
createMaxServiceCurve()
MaxServiceCurve
createMaxServiceCurve(int segment_count)
MaxServiceCurve
createMaxServiceCurve(java.lang.String max_service_curve_str)
MaxServiceCurve
createMaxServiceCurve(Curve curve)
ArrivalCurve
createPeakArrivalRate(double rate)
ArrivalCurve
createPeakArrivalRate(Num rate)
ServiceCurve
createRateLatency(double rate, double latency)
ServiceCurve
createRateLatency(Num rate, Num latency)
MaxServiceCurve
createRateLatencyMSC(double rate, double latency)
MaxServiceCurve
createRateLatencyMSC(Num rate, Num latency)
ServiceCurve
createServiceCurve()
ServiceCurve
createServiceCurve(int segment_count)
ServiceCurve
createServiceCurve(java.lang.String service_curve_str)
ServiceCurve
createServiceCurve(Curve curve)
ArrivalCurve
createTokenBucket(double rate, double burst)
ArrivalCurve
createTokenBucket(Num rate, Num burst)
ArrivalCurve
createZeroArrivals()
Curve
createZeroCurve()
ServiceCurve
createZeroDelayInfiniteBurst()
MaxServiceCurve
createZeroDelayInfiniteBurstMSC()
ServiceCurve
createZeroService()
boolean
equals(java.lang.Object obj)
Num
f(Num x)
Num
f_inv(Num y)
Num
f_inv(Num y, boolean rightmost)
Num
fLimitRight(Num x)
Num
getBurst()
static Curve
getFactory()
Num
getGradientLimitRight(Num x)
Num
getLatency()
static Num
getMaxVerticalDeviation(Curve c1, Curve c2)
Returns the maximum vertical deviation between the given two curves.Curve
getRL_Component(int i)
int
getRL_ComponentCount()
LinearSegment
getSegment(int pos)
Curves are defined by a numbered sequence of linear segments.int
getSegmentCount()
int
getSegmentDefining(Num x)
Curve
getTB_Component(int i)
int
getTB_ComponentCount()
Num
getUltAffineRate()
static LinearSegment
getXAxis()
Create and return a linear segment that lies on the x axis of the Cartesian coordinate system.static Num
getXIntersection(Curve curve1, Curve curve2)
int
hashCode()
boolean
isAlmostConcave()
boolean
isConcave()
boolean
isConcaveIn(Num a, Num b)
boolean
isConvex()
boolean
isConvexIn(Num a, Num b)
boolean
isDelayedInfiniteBurst()
boolean
isDiscontinuity(int pos)
boolean
isRealDiscontinuity(int pos)
boolean
isUnrealDiscontinuity(int pos)
boolean
isWideSenseIncreasing()
static ArrivalCurve
max(ArrivalCurve arrival_curve_1, ArrivalCurve arrival_curve_2)
static Curve
max(Curve curve1, Curve curve2)
Returns a curve that is the maximum of this curve and the given curve.static ServiceCurve
max(ServiceCurve c1, ServiceCurve c2)
static ArrivalCurve
min(ArrivalCurve arrival_curve_1, ArrivalCurve arrival_curve_2)
static Curve
min(Curve curve1, Curve curve2)
Returns a curve that is the minimum of this curve and the given curve.static MaxServiceCurve
min(MaxServiceCurve max_service_curve_1, MaxServiceCurve max_service_curve_2)
static ServiceCurve
min(ServiceCurve c1, ServiceCurve c2)
static Curve
removeLatency(Curve curve)
Returns a copy of this curve with latency removed, i.e.void
removeSegment(int pos)
void
setRateLateny(boolean is_rate_latency)
void
setRL_Components(java.util.List<Curve> rate_latencies)
void
setRL_MetaInfo(boolean has_rl_meta_info)
void
setTB_Components(java.util.List<Curve> token_buckets)
void
setTB_MetaInfo(boolean has_tb_meta_info)
void
setTokenBucket(boolean is_token_bucket)
static Curve
shiftLeftClipping(Curve curve, Num dx)
Returns a copy of this curve that is shifted to the left bydx
, i.e.static Curve
shiftRight(Curve curve, Num dx)
Returns a copy of this curve that is shifted to the right bydx
, i.e.static Curve
sub(Curve curve1, Curve curve2)
Returns a curve that is the difference between this curve and the given curve.static ServiceCurve
sub(ServiceCurve c1, ArrivalCurve c2)
java.lang.String
toString()
-
-
-
Method Detail
-
getFactory
static Curve getFactory()
-
getXAxis
static LinearSegment getXAxis()
Create and return a linear segment that lies on the x axis of the Cartesian coordinate system.- Returns:
-
removeLatency
static Curve removeLatency(Curve curve)
Returns a copy of this curve with latency removed, i.e. shifted left by the latency.- Parameters:
curve
- The curve to shift.- Returns:
- A copy of this curve without latency
-
shiftRight
static Curve shiftRight(Curve curve, Num dx)
Returns a copy of this curve that is shifted to the right bydx
, i.e. g(x) = f(x-dx).- Parameters:
curve
- The curve to shift.dx
- The offset to shift the curve.- Returns:
- The shifted curve.
-
beautify
static void beautify(Curve c)
-
computeInflectionPointsX
static java.util.ArrayList<Num> computeInflectionPointsX(Curve c1, Curve c2)
Returns anArrayList
instance of those x-coordinates at which either c1 or c2 or both have an inflection point. There will be multiple occurences of an x-coordinate, if at least one curve has a discontinuity at that x-coordinate.- Parameters:
c1
- the first curve.c2
- the second curve.- Returns:
- an
ArrayList
ofDouble
objects containing the x-coordinates of the respective inflection point.
-
getMaxVerticalDeviation
static Num getMaxVerticalDeviation(Curve c1, Curve c2)
Returns the maximum vertical deviation between the given two curves.- Parameters:
c1
- the first curve.c2
- the second curve.- Returns:
- the value of the vertical deviation.
-
computeInflectionPointsY
static java.util.ArrayList<Num> computeInflectionPointsY(Curve c1, Curve c2)
Returns anArrayList
instance of those y-coordinates at which either c1 or c2 or both have an inflection point.- Parameters:
c1
- the first curve.c2
- the second curve.- Returns:
- an
ArrayList
ofDouble
objects containing the x-coordinates of the respective inflection point.
-
sub
static Curve sub(Curve curve1, Curve curve2)
Returns a curve that is the difference between this curve and the given curve.- Parameters:
curve1
- input curve 1.curve2
- input curve 2.- Returns:
- the pointwise difference of the given curves, i.e., curve1 - curve2.
-
sub
static ServiceCurve sub(ServiceCurve c1, ArrivalCurve c2)
-
computeResultingCurve
static Curve computeResultingCurve(Curve curve1, Curve curve2, Curve.CurveOperation operator)
Common helper for computing a new curve.- Parameters:
curve1
- Input curve 1.curve2
- Input curve 2.operator
- Operation to be applied to the curves.- Returns:
- The resulting curve.
-
min
static Curve min(Curve curve1, Curve curve2)
Returns a curve that is the minimum of this curve and the given curve.- Parameters:
curve1
- input curve 1.curve2
- input curve 2.- Returns:
- the pointwise minimum of the given curves.
-
min
static MaxServiceCurve min(MaxServiceCurve max_service_curve_1, MaxServiceCurve max_service_curve_2)
-
boundAtXAxis
static Curve boundAtXAxis(Curve curve)
Returns a copy of curve bounded at the x-axis.- Parameters:
curve
- the curve to bound.- Returns:
- the bounded curve.
-
min
static ServiceCurve min(ServiceCurve c1, ServiceCurve c2)
-
min
static ArrivalCurve min(ArrivalCurve arrival_curve_1, ArrivalCurve arrival_curve_2)
-
add
static Curve add(Curve curve1, Curve curve2)
Returns a curve that is the sum of this curve and the given curve.- Parameters:
curve1
- input curve 1.curve2
- input curve 2.- Returns:
- the pointwise sum of the given curves.
-
max
static Curve max(Curve curve1, Curve curve2)
Returns a curve that is the maximum of this curve and the given curve.- Parameters:
curve1
- input curve 1.curve2
- input curve 2.- Returns:
- the pointwise maximum of the given curves.
-
add
static MaxServiceCurve add(MaxServiceCurve max_service_curve_1, MaxServiceCurve max_service_curve_2)
-
add
static MaxServiceCurve add(MaxServiceCurve max_service_curve_1, Num dy)
-
add
static ArrivalCurve add(ArrivalCurve arrival_curve_1, ArrivalCurve arrival_curve_2)
-
add
static ArrivalCurve add(ArrivalCurve arrival_curve_1, Num dy)
-
add
static ServiceCurve add(ServiceCurve c1, ServiceCurve c2)
-
max
static ServiceCurve max(ServiceCurve c1, ServiceCurve c2)
-
max
static ArrivalCurve max(ArrivalCurve arrival_curve_1, ArrivalCurve arrival_curve_2)
-
add
static Curve add(Curve curve, Num dy)
Returns a copy of this curve shifted vertically bydy
.- Parameters:
curve
- The curve to shift.dy
- The offset to shift the curve.- Returns:
- The shifted curve.
-
shiftLeftClipping
static Curve shiftLeftClipping(Curve curve, Num dx)
Returns a copy of this curve that is shifted to the left bydx
, i.e. g(x) = f(x+dx). Note that the new curve is clipped at the y-axis so that in most casesc.shiftLeftClipping(dx).shiftRight(dx) != c
!- Parameters:
curve
- The curve to shift.dx
- The offset to shift the curve.- Returns:
- The shifted curve.
-
createZeroCurve
Curve createZeroCurve()
-
createCurve
Curve createCurve(java.util.List<LinearSegment> segments)
-
getSegment
LinearSegment getSegment(int pos)
Curves are defined by a numbered sequence of linear segments. This method returns the segment at the given position in curve-defining sequence. The first segment is by definition at position 0.- Parameters:
pos
- Position of the segment to return.- Returns:
- The linear segment at position pos.
-
getSegmentCount
int getSegmentCount()
-
getSegmentDefining
int getSegmentDefining(Num x)
-
addSegment
void addSegment(LinearSegment s)
-
isConvex
boolean isConvex()
-
isConcave
boolean isConcave()
-
getLatency
Num getLatency()
-
getBurst
Num getBurst()
-
getUltAffineRate
Num getUltAffineRate()
-
copy
Curve copy()
-
copy
void copy(Curve curve)
-
createServiceCurve
ServiceCurve createServiceCurve()
-
createServiceCurve
ServiceCurve createServiceCurve(int segment_count)
-
createServiceCurve
ServiceCurve createServiceCurve(java.lang.String service_curve_str) throws java.lang.Exception
- Throws:
java.lang.Exception
-
createServiceCurve
ServiceCurve createServiceCurve(Curve curve)
-
createZeroService
ServiceCurve createZeroService()
-
createZeroDelayInfiniteBurst
ServiceCurve createZeroDelayInfiniteBurst()
-
createDelayedInfiniteBurst
ServiceCurve createDelayedInfiniteBurst(double delay)
-
createDelayedInfiniteBurst
ServiceCurve createDelayedInfiniteBurst(Num delay)
-
createRateLatency
ServiceCurve createRateLatency(double rate, double latency)
-
createRateLatency
ServiceCurve createRateLatency(Num rate, Num latency)
-
createArrivalCurve
ArrivalCurve createArrivalCurve()
-
createArrivalCurve
ArrivalCurve createArrivalCurve(int segment_count)
-
createArrivalCurve
ArrivalCurve createArrivalCurve(java.lang.String arrival_curve_str) throws java.lang.Exception
- Throws:
java.lang.Exception
-
createArrivalCurve
ArrivalCurve createArrivalCurve(Curve curve)
-
createArrivalCurve
ArrivalCurve createArrivalCurve(Curve curve, boolean remove_latency)
-
createZeroArrivals
ArrivalCurve createZeroArrivals()
-
createInfiniteArrivals
ArrivalCurve createInfiniteArrivals()
-
createPeakArrivalRate
ArrivalCurve createPeakArrivalRate(double rate)
-
createPeakArrivalRate
ArrivalCurve createPeakArrivalRate(Num rate)
-
createTokenBucket
ArrivalCurve createTokenBucket(double rate, double burst)
-
createTokenBucket
ArrivalCurve createTokenBucket(Num rate, Num burst)
-
createMaxServiceCurve
MaxServiceCurve createMaxServiceCurve()
-
createMaxServiceCurve
MaxServiceCurve createMaxServiceCurve(int segment_count)
-
createMaxServiceCurve
MaxServiceCurve createMaxServiceCurve(java.lang.String max_service_curve_str) throws java.lang.Exception
- Throws:
java.lang.Exception
-
createMaxServiceCurve
MaxServiceCurve createMaxServiceCurve(Curve curve)
-
createZeroDelayInfiniteBurstMSC
MaxServiceCurve createZeroDelayInfiniteBurstMSC()
-
createDelayedInfiniteBurstMSC
MaxServiceCurve createDelayedInfiniteBurstMSC(double delay)
-
createDelayedInfiniteBurstMSC
MaxServiceCurve createDelayedInfiniteBurstMSC(Num delay)
-
createRateLatencyMSC
MaxServiceCurve createRateLatencyMSC(double rate, double latency)
-
createRateLatencyMSC
MaxServiceCurve createRateLatencyMSC(Num rate, Num latency)
-
addSegment
void addSegment(int pos, LinearSegment s)
-
setTB_Components
void setTB_Components(java.util.List<Curve> token_buckets)
-
setRL_MetaInfo
void setRL_MetaInfo(boolean has_rl_meta_info)
-
setRateLateny
void setRateLateny(boolean is_rate_latency)
-
setRL_Components
void setRL_Components(java.util.List<Curve> rate_latencies)
-
isAlmostConcave
boolean isAlmostConcave()
-
getRL_ComponentCount
int getRL_ComponentCount()
-
getTB_ComponentCount
int getTB_ComponentCount()
-
getRL_Component
Curve getRL_Component(int i)
-
getTB_Component
Curve getTB_Component(int i)
-
setTokenBucket
void setTokenBucket(boolean is_token_bucket)
-
removeSegment
void removeSegment(int pos)
-
isDelayedInfiniteBurst
boolean isDelayedInfiniteBurst()
-
isDiscontinuity
boolean isDiscontinuity(int pos)
-
isRealDiscontinuity
boolean isRealDiscontinuity(int pos)
-
isUnrealDiscontinuity
boolean isUnrealDiscontinuity(int pos)
-
setTB_MetaInfo
void setTB_MetaInfo(boolean has_tb_meta_info)
-
isWideSenseIncreasing
boolean isWideSenseIncreasing()
-
equals
boolean equals(java.lang.Object obj)
- Overrides:
equals
in classjava.lang.Object
-
hashCode
int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
toString
java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-