Class Curve_MPARTC_PwAffine
- java.lang.Object
-
- org.networkcalculus.dnc.curves.mpa_rtc.pw_affine.Curve_MPARTC_PwAffine
-
- All Implemented Interfaces:
Curve
,Curve_Affine
,Curve_PwAffine
- Direct Known Subclasses:
ArrivalCurve_MPARTC_PwAffine
,MaxServiceCurve_MPARTC_PwAffine
,ServiceCurve_MPARTC_PwAffine
public class Curve_MPARTC_PwAffine extends java.lang.Object implements Curve_PwAffine
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.networkcalculus.dnc.curves.Curve
Curve.CurveOperation
-
-
Field Summary
Fields Modifier and Type Field Description protected boolean
has_rate_latency_meta_info
protected boolean
has_token_bucket_meta_info
private static Curve_MPARTC_PwAffine
instance
protected boolean
is_delayed_infinite_burst
protected boolean
is_rate_latency
protected boolean
is_token_bucket
protected java.util.List<Curve_MPARTC_PwAffine>
rate_latencies
protected ch.ethz.rtc.kernel.Curve
rtc_curve
protected java.util.List<Curve_MPARTC_PwAffine>
token_buckets
-
Constructor Summary
Constructors Modifier Constructor Description protected
Curve_MPARTC_PwAffine()
Creates aCurve
instance with a single segment on the x-axis.protected
Curve_MPARTC_PwAffine(int segment_count)
Creates aCurve
instance withsegment_count
emptyLinearSegment
instances.protected
Curve_MPARTC_PwAffine(Curve curve)
-
Method Summary
-
-
-
Field Detail
-
instance
private static Curve_MPARTC_PwAffine instance
-
rtc_curve
protected ch.ethz.rtc.kernel.Curve rtc_curve
-
is_delayed_infinite_burst
protected boolean is_delayed_infinite_burst
-
is_rate_latency
protected boolean is_rate_latency
-
is_token_bucket
protected boolean is_token_bucket
-
has_rate_latency_meta_info
protected boolean has_rate_latency_meta_info
-
rate_latencies
protected java.util.List<Curve_MPARTC_PwAffine> rate_latencies
-
has_token_bucket_meta_info
protected boolean has_token_bucket_meta_info
-
token_buckets
protected java.util.List<Curve_MPARTC_PwAffine> token_buckets
-
-
Constructor Detail
-
Curve_MPARTC_PwAffine
protected Curve_MPARTC_PwAffine()
Creates aCurve
instance with a single segment on the x-axis.
-
Curve_MPARTC_PwAffine
protected Curve_MPARTC_PwAffine(Curve curve)
-
Curve_MPARTC_PwAffine
protected Curve_MPARTC_PwAffine(int segment_count)
Creates aCurve
instance withsegment_count
emptyLinearSegment
instances.- Parameters:
segment_count
- the number of segments
-
-
Method Detail
-
getFactory
public static Curve_MPARTC_PwAffine getFactory()
-
createZeroSegmentsCurve
private void createZeroSegmentsCurve(int segment_count)
-
getRtc_curve
public ch.ethz.rtc.kernel.Curve getRtc_curve()
-
initializeCurve
protected void initializeCurve(java.lang.String curve_str) throws java.lang.Exception
- Throws:
java.lang.Exception
-
clearMetaInfo
private void clearMetaInfo()
-
copy
public Curve_MPARTC_PwAffine copy()
Returns a copy of this instance.- Specified by:
copy
in interfaceCurve
- Specified by:
copy
in interfaceCurve_Affine
- Specified by:
copy
in interfaceCurve_PwAffine
- Returns:
- a copy of this instance.
-
copy
public void copy(Curve curve)
- Specified by:
copy
in interfaceCurve
- Specified by:
copy
in interfaceCurve_Affine
- Specified by:
copy
in interfaceCurve_PwAffine
-
getSegment
public LinearSegment_MPARTC_PwAffine getSegment(int pos)
Starting at 0 as the RTC SegmentList extends ArrayList.- Specified by:
getSegment
in interfaceCurve
- Parameters:
pos
- Position of the segment to return.- Returns:
- The linear segment at position pos.
-
getSegmentRTC
private ch.ethz.rtc.kernel.Segment getSegmentRTC(int pos)
-
getSegmentCount
public int getSegmentCount()
Returns the number of segments in this curve.- Specified by:
getSegmentCount
in interfaceCurve
- Returns:
- the number of segments
-
getSegmentDefining
public int getSegmentDefining(Num x)
Attention: We assume that RTC curves are left-continuous as we cannot make this explicit. Therefore, we return the first segment that defines the given x. This behavior coincides with getSegmentLimitRight(x).- Specified by:
getSegmentDefining
in interfaceCurve
-
getSegmentLimitRight
public int getSegmentLimitRight(Num x)
-
initializeWithSegment
protected void initializeWithSegment(ch.ethz.rtc.kernel.Segment rtc_segment)
-
initializeWithSegments
protected void initializeWithSegments(ch.ethz.rtc.kernel.SegmentList rtc_segmentList)
-
addSegment
public void addSegment(LinearSegment s)
- Specified by:
addSegment
in interfaceCurve
-
addSegment
public void addSegment(int pos, LinearSegment s)
Starting at 0 as the RTC SegmentList extends ArrayList.- Specified by:
addSegment
in interfaceCurve
-
removeSegment
public void removeSegment(int pos)
- Specified by:
removeSegment
in interfaceCurve
-
isDiscontinuity
public boolean isDiscontinuity(int pos)
- Specified by:
isDiscontinuity
in interfaceCurve
-
isRealDiscontinuity
public boolean isRealDiscontinuity(int pos)
- Specified by:
isRealDiscontinuity
in interfaceCurve
-
isUnrealDiscontinuity
public boolean isUnrealDiscontinuity(int pos)
- Specified by:
isUnrealDiscontinuity
in interfaceCurve
-
isWideSenseIncreasing
public boolean isWideSenseIncreasing()
- Specified by:
isWideSenseIncreasing
in interfaceCurve
-
isConvexIn
public boolean isConvexIn(Num a, Num b)
- Specified by:
isConvexIn
in interfaceCurve
-
isConcaveIn
public boolean isConcaveIn(Num a, Num b)
Tests whether the curve is concave in [a,b].- Specified by:
isConcaveIn
in interfaceCurve
- 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()
- Specified by:
isAlmostConcave
in interfaceCurve
-
equals
public boolean equals(java.lang.Object obj)
-
hashCode
public int hashCode()
-
toString
public java.lang.String toString()
-
fLimitRight
public Num fLimitRight(Num x)
- Specified by:
fLimitRight
in interfaceCurve
-
getLatency
public Num getLatency()
- Specified by:
getLatency
in interfaceCurve
-
getGradientLimitRight
public Num getGradientLimitRight(Num x)
- Specified by:
getGradientLimitRight
in interfaceCurve
-
getTB_Burst
public Num getTB_Burst()
-
setTB_MetaInfo
public void setTB_MetaInfo(boolean has_token_bucket_meta_info)
- Specified by:
setTB_MetaInfo
in interfaceCurve
-
getRL_Components
public java.util.List<Curve_Affine> getRL_Components()
- Specified by:
getRL_Components
in interfaceCurve_PwAffine
-
setRL_Components
public void setRL_Components(java.util.List<Curve> rate_latencies)
- Specified by:
setRL_Components
in interfaceCurve
-
getTB_Components
public java.util.List<Curve_Affine> getTB_Components()
- Specified by:
getTB_Components
in interfaceCurve_PwAffine
-
setTB_Components
public void setTB_Components(java.util.List<Curve> token_buckets)
- Specified by:
setTB_Components
in interfaceCurve
-
setRL_MetaInfo
public void setRL_MetaInfo(boolean has_rate_latency_meta_info)
- Specified by:
setRL_MetaInfo
in interfaceCurve
-
getUltAffineRate
public Num getUltAffineRate()
- Specified by:
getUltAffineRate
in interfaceCurve
-
beautify
public void beautify()
-
isDelayedInfiniteBurst
public boolean isDelayedInfiniteBurst()
- Specified by:
isDelayedInfiniteBurst
in interfaceCurve
-
isRateLatency
public boolean isRateLatency()
- Specified by:
isRateLatency
in interfaceCurve_Affine
-
setRateLateny
public void setRateLateny(boolean is_rate_latency)
- Specified by:
setRateLateny
in interfaceCurve
-
getRL_ComponentCount
public int getRL_ComponentCount()
- Specified by:
getRL_ComponentCount
in interfaceCurve
-
getRL_Component
public Curve_MPARTC_PwAffine getRL_Component(int i)
Returns the rate latency the defined the overall curve's segment i.- Specified by:
getRL_Component
in interfaceCurve
-
decomposeIntoRateLatencies
private void decomposeIntoRateLatencies()
-
isTokenBucket
public boolean isTokenBucket()
- Specified by:
isTokenBucket
in interfaceCurve_Affine
-
setTokenBucket
public void setTokenBucket(boolean is_token_bucket)
- Specified by:
setTokenBucket
in interfaceCurve
-
getTB_ComponentCount
public int getTB_ComponentCount()
- Specified by:
getTB_ComponentCount
in interfaceCurve
-
getTB_Component
public Curve_MPARTC_PwAffine getTB_Component(int i)
- Specified by:
getTB_Component
in interfaceCurve
-
decomposeIntoTokenBuckets
private void decomposeIntoTokenBuckets()
-
createCurve
public Curve_MPARTC_PwAffine createCurve(java.util.List<LinearSegment> segments)
- Specified by:
createCurve
in interfaceCurve
-
createZeroCurve
public Curve_MPARTC_PwAffine createZeroCurve()
- Specified by:
createZeroCurve
in interfaceCurve
-
createHorizontal
public Curve_MPARTC_PwAffine createHorizontal(Num y)
Creates a horizontal curve.- Specified by:
createHorizontal
in interfaceCurve
- Parameters:
y
- the y-intercept of the curve- Returns:
- a
Curve
instance
-
createServiceCurve
public ServiceCurve_MPARTC_PwAffine createServiceCurve()
- Specified by:
createServiceCurve
in interfaceCurve
-
createServiceCurve
public ServiceCurve_MPARTC_PwAffine createServiceCurve(int segment_count)
- Specified by:
createServiceCurve
in interfaceCurve
-
createServiceCurve
public ServiceCurve_MPARTC_PwAffine createServiceCurve(java.lang.String service_curve_str) throws java.lang.Exception
- Specified by:
createServiceCurve
in interfaceCurve
- Throws:
java.lang.Exception
-
createServiceCurve
public ServiceCurve_MPARTC_PwAffine createServiceCurve(Curve curve)
- Specified by:
createServiceCurve
in interfaceCurve
-
createZeroService
public ServiceCurve_MPARTC_PwAffine createZeroService()
- Specified by:
createZeroService
in interfaceCurve
-
createZeroDelayInfiniteBurst
public ServiceCurve_MPARTC_PwAffine createZeroDelayInfiniteBurst()
Creates an infinite burst curve with zero delay.- Specified by:
createZeroDelayInfiniteBurst
in interfaceCurve
- Returns:
- a
ServiceCurve
instance
-
createDelayedInfiniteBurst
public ServiceCurve_MPARTC_PwAffine createDelayedInfiniteBurst(double delay)
- Specified by:
createDelayedInfiniteBurst
in interfaceCurve
-
createDelayedInfiniteBurst
public ServiceCurve_MPARTC_PwAffine createDelayedInfiniteBurst(Num delay)
- Specified by:
createDelayedInfiniteBurst
in interfaceCurve
-
createRateLatency
public ServiceCurve_MPARTC_PwAffine createRateLatency(double rate, double latency)
- Specified by:
createRateLatency
in interfaceCurve
-
createRateLatency
public ServiceCurve_MPARTC_PwAffine createRateLatency(Num rate, Num latency)
- Specified by:
createRateLatency
in interfaceCurve
-
createArrivalCurve
public ArrivalCurve_MPARTC_PwAffine createArrivalCurve()
- Specified by:
createArrivalCurve
in interfaceCurve
-
createArrivalCurve
public ArrivalCurve_MPARTC_PwAffine createArrivalCurve(int segment_count)
- Specified by:
createArrivalCurve
in interfaceCurve
-
createArrivalCurve
public ArrivalCurve_MPARTC_PwAffine createArrivalCurve(java.lang.String arrival_curve_str) throws java.lang.Exception
- Specified by:
createArrivalCurve
in interfaceCurve
- Throws:
java.lang.Exception
-
createArrivalCurve
public ArrivalCurve_MPARTC_PwAffine createArrivalCurve(Curve curve)
- Specified by:
createArrivalCurve
in interfaceCurve
-
createArrivalCurve
public ArrivalCurve_MPARTC_PwAffine createArrivalCurve(Curve curve, boolean remove_latency)
- Specified by:
createArrivalCurve
in interfaceCurve
-
createZeroArrivals
public ArrivalCurve_MPARTC_PwAffine createZeroArrivals()
- Specified by:
createZeroArrivals
in interfaceCurve
-
createInfiniteArrivals
public ArrivalCurve_MPARTC_PwAffine createInfiniteArrivals()
- Specified by:
createInfiniteArrivals
in interfaceCurve
-
createPeakArrivalRate
public ArrivalCurve_MPARTC_PwAffine createPeakArrivalRate(double rate)
- Specified by:
createPeakArrivalRate
in interfaceCurve
-
createPeakArrivalRate
public ArrivalCurve_MPARTC_PwAffine createPeakArrivalRate(Num rate)
- Specified by:
createPeakArrivalRate
in interfaceCurve
-
createTokenBucket
public ArrivalCurve_MPARTC_PwAffine createTokenBucket(double rate, double burst)
- Specified by:
createTokenBucket
in interfaceCurve
-
createTokenBucket
public ArrivalCurve_MPARTC_PwAffine createTokenBucket(Num rate, Num burst)
- Specified by:
createTokenBucket
in interfaceCurve
-
createMaxServiceCurve
public MaxServiceCurve_MPARTC_PwAffine createMaxServiceCurve()
- Specified by:
createMaxServiceCurve
in interfaceCurve
-
createMaxServiceCurve
public MaxServiceCurve_MPARTC_PwAffine createMaxServiceCurve(int segment_count)
- Specified by:
createMaxServiceCurve
in interfaceCurve
-
createMaxServiceCurve
public MaxServiceCurve_MPARTC_PwAffine createMaxServiceCurve(java.lang.String max_service_curve_str) throws java.lang.Exception
- Specified by:
createMaxServiceCurve
in interfaceCurve
- Throws:
java.lang.Exception
-
createMaxServiceCurve
public MaxServiceCurve_MPARTC_PwAffine createMaxServiceCurve(Curve curve)
- Specified by:
createMaxServiceCurve
in interfaceCurve
-
createInfiniteMaxService
public MaxServiceCurve_MPARTC_PwAffine createInfiniteMaxService()
-
createZeroDelayInfiniteBurstMSC
public MaxServiceCurve_MPARTC_PwAffine createZeroDelayInfiniteBurstMSC()
- Specified by:
createZeroDelayInfiniteBurstMSC
in interfaceCurve
-
createDelayedInfiniteBurstMSC
public MaxServiceCurve_MPARTC_PwAffine createDelayedInfiniteBurstMSC(double delay)
- Specified by:
createDelayedInfiniteBurstMSC
in interfaceCurve
-
createDelayedInfiniteBurstMSC
public MaxServiceCurve_MPARTC_PwAffine createDelayedInfiniteBurstMSC(Num delay)
- Specified by:
createDelayedInfiniteBurstMSC
in interfaceCurve
-
createRateLatencyMSC
public MaxServiceCurve_MPARTC_PwAffine createRateLatencyMSC(double rate, double latency)
- Specified by:
createRateLatencyMSC
in interfaceCurve
-
createRateLatencyMSC
public MaxServiceCurve_MPARTC_PwAffine createRateLatencyMSC(Num rate, Num latency)
- Specified by:
createRateLatencyMSC
in interfaceCurve
-
makeHorizontal
private void makeHorizontal(Curve_MPARTC_PwAffine c_rtc, double y)
-
makeDelayedInfiniteBurst
private void makeDelayedInfiniteBurst(Curve_MPARTC_PwAffine c_rtc, double delay)
-
makePeakRate
private void makePeakRate(Curve_MPARTC_PwAffine c_rtc, double rate)
-
makeRateLatency
private void makeRateLatency(Curve_MPARTC_PwAffine c_rtc, double rate, double latency)
-
makeTokenBucket
private void makeTokenBucket(Curve_MPARTC_PwAffine c_rtc, double rate, double burst)
-
-