|
GridSim 5.0 beta | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Object Thread Sim_entity RateControlledScheduler
public class RateControlledScheduler
RateControlledScheduler is an implementation of a rate-jitter controlling regulator. For more details refer to H. Zhang and D.Ferrari's INFOCOM '93 paper Rate-Controlled Static-Priority Queueing.
RateControlledScheduler can be used to control the bandwidth that is assigned to each class of user at a Router. This is a non-work conserving algorithm, which means that the router can remain idle even if there are packets in its queue.
At a RateControlledScheduler each class of users is assigned a certain percentage of bandwidth, and the scheduler makes sure that each class remains constrained within its bandwidth limits at all times.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class Thread |
---|
Thread.State, Thread.UncaughtExceptionHandler |
Field Summary |
---|
Fields inherited from class Thread |
---|
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY |
Constructor Summary | |
---|---|
RateControlledScheduler(String name,
double baudRate,
int numClasses)
Creates a new RateControlled packet scheduler with the specified name and baud rate (in bits/s). |
|
RateControlledScheduler(String name,
double baudRate,
int routerID,
int numClasses)
Creates a new RateControlled packet scheduler with the specified name and baud rate (in bits/s). |
|
RateControlledScheduler(String name,
int numClasses)
Creates a new RateControlled packet scheduler with the specified name. |
Method Summary | |
---|---|
void |
body()
Handles an incoming events coming from a specified Router |
Packet |
deque()
The method deque() has to decide which queue is to be served next -- This method is not used |
boolean |
enque(Packet np)
Puts a packet into the queue -- This method is not used |
double |
getBaudRate()
Returns the baud rate of the egress port that is using this scheduler. |
int |
getNumClass()
Gets the number of classes for prioritizing incoming packets |
double[] |
getRate()
Gets the list of rates for each packet class |
int |
getRouterID()
Gets the router ID that hosts this scheduler. |
int |
getSchedID()
Gets the ID of this scheduler. |
String |
getSchedName()
Gets the name of this scheduler. |
boolean |
isEmpty()
Determines whether the scheduler is currently keeping any packets in its queue(s). |
boolean |
setBaudRate(double rate)
Sets the baud rate that this scheduler will be sending packets at. |
boolean |
setRates(double[] rates)
This method allows you to set different rates for different types of traffic. |
boolean |
setRouterID(int routerID)
Sets the router ID that hosts this scheduler. |
int |
size()
Determines the number of packets that are currently enqueued in this scheduler. |
Methods inherited from class Thread |
---|
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yield |
Methods inherited from class Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public RateControlledScheduler(String name, double baudRate, int numClasses) throws ParameterException
setRates(double[])
method.
name
- Name of this schedulerbaudRate
- baud rate in bits/s of the port that is using
this scheduler.numClasses
- number of classes for prioritizing a packet
ParameterException
- This happens when the name is null or
the baud rate <= 0 or num of classes <= 0public RateControlledScheduler(String name, int numClasses) throws ParameterException
PacketScheduler.setBaudRate(double)
before the simulation starts.
The name can be useful for debugging purposes, but serves
no functional purposes.
Don't forget to set the rate for each packet class by using the
setRates(double[])
method.
name
- Name of this schedulernumClasses
- number of classes for prioritizing a packet
ParameterException
- This happens when the name is null or
the baud rate <= 0 or num of classes <= 0public RateControlledScheduler(String name, double baudRate, int routerID, int numClasses) throws ParameterException
setRates(double[])
method.
name
- Name of this schedulerbaudRate
- baud rate in bits/s of the port that is using
this scheduler.routerID
- the router ID that hosts this packet schedulernumClasses
- number of classes for prioritizing a packet
ParameterException
- This happens when the name is null or
router ID <= 0 or the baud rate <= 0 or
num of classes <= 0Method Detail |
---|
public int getNumClass()
public double[] getRate()
public void body()
body
in class Sim_entity
public boolean setRates(double[] rates)
rates
- a linear array of the rates to be assigned to different
classes of traffic.public boolean isEmpty()
isEmpty
in interface PacketScheduler
public int size()
size
in interface PacketScheduler
public double getBaudRate()
getBaudRate
in interface PacketScheduler
PacketScheduler.setBaudRate(double)
public boolean setBaudRate(double rate)
setBaudRate
in interface PacketScheduler
rate
- the baud rate of this scheduler (in bits/s)public String getSchedName()
getSchedName
in interface PacketScheduler
public int getSchedID()
getSchedID
in interface PacketScheduler
public boolean setRouterID(int routerID)
setRouterID
in interface PacketScheduler
routerID
- the router ID that hosts this scheduler
public int getRouterID()
getRouterID
in interface PacketScheduler
public boolean enque(Packet np)
enque
in interface PacketScheduler
np
- A Packet to be enqued by this scheduler.
public Packet deque()
deque
in interface PacketScheduler
|
GridSim 5.0 beta | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |