|
GridSim v4.0 |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
ObjectThread
eduni.simjava.Sim_entity
gridsim.net.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.
| Field Summary |
| Fields inherited from class eduni.simjava.Sim_entity |
|
| 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 eduni.simjava.Sim_entity |
add_generator, add_param, add_port, clone, get_id, get_name, get_port, get_port, get_stat, run, send_on, set_invisible, set_stat, sim_cancel, sim_completed, sim_current, sim_get_next, sim_get_next, sim_hold_for, sim_hold, sim_pause_for, sim_pause_for, sim_pause_until, sim_pause_until, sim_pause, sim_process_for, sim_process_for, sim_process_until, sim_process_until, sim_process, sim_putback, sim_schedule, sim_schedule, sim_schedule, sim_schedule, sim_schedule, sim_schedule, sim_select, sim_trace, sim_wait_for, sim_wait_for, sim_wait_for, sim_wait, sim_waiting, sim_waiting |
| Methods inherited from class Thread |
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getContextClassLoader, getName, getPriority, getThreadGroup, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setName, setPriority, 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 <= 0
public 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 <= 0
public 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 <= 0| Method Detail |
public int getNumClass()
public double[] getRate()
public void body()
body in class Sim_entitypublic 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 PacketSchedulerpublic int size()
size in interface PacketSchedulerpublic double getBaudRate()
getBaudRate in interface PacketSchedulerPacketScheduler.setBaudRate(double)public boolean setBaudRate(double rate)
setBaudRate in interface PacketSchedulerrate - the baud rate of this scheduler (in bits/s)public String getSchedName()
getSchedName in interface PacketSchedulerpublic int getSchedID()
getSchedID in interface PacketSchedulerpublic boolean setRouterID(int routerID)
setRouterID in interface PacketSchedulerrouterID - the router ID that hosts this scheduler
public int getRouterID()
getRouterID in interface PacketSchedulerpublic boolean enque(Packet np)
enque in interface PacketSchedulernp - A Packet to be enqued by this scheduler.
public Packet deque()
deque in interface PacketScheduler
|
GridSim v4.0 |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||