|
GridSim v3.1 |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
Objectgridsim.net.PacketScheduler
This class provides a template for schedulers that will be used at routers. Every egress port of a router needs to instantiate a PacketScheduler object which it uses to determine the order in which packets should be sent out.
| Constructor Summary | |
PacketScheduler()
Creates a new packet scheduler with the name "PacketScheduler". |
|
PacketScheduler(double baudRate)
Creates a new packet scheduler with the specified baud rate (bits/s). |
|
PacketScheduler(String name)
Creates a new packet scheduler with the specified name. |
|
PacketScheduler(String name,
double baudRate)
Creates a new packet scheduler with the specified name and baud rate (in bits/s). |
|
| Method Summary | |
abstract Packet |
deque()
Removes a single packet and returns it. |
abstract boolean |
enque(Packet np)
This method enques a packet in this scheduler. |
double |
getBaudRate()
Returns the baud rate of the egress port that is using this scheduler. |
String |
getName()
Returns the name of this scheduler, if one was specified during setup. |
abstract 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. |
abstract int |
size()
Determines the number of packets that are currently enqueued in this scheduler. |
| Methods inherited from class Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public PacketScheduler(String name,
double baudRate)
throws ParameterException
name - Name of this schedulerbaudRate - baud rate in bits/s of the port that is using
this scheduler.
ParameterException - This happens when the name is null or
the baud rate <= 0
public PacketScheduler(double baudRate)
throws ParameterException
baudRate - baud rate in bits/s of the port that is using
this scheduler.
ParameterException - This happens when the baud rate <= 0
public PacketScheduler(String name)
throws ParameterException
setBaudRate(double)
before being the simulation is started.
name - Name of this scheduler
ParameterException - This happens when the name is nullpublic PacketScheduler()
setBaudRate(double)
before being the simulation is started.
| Method Detail |
public double getBaudRate()
setBaudRate(double)public boolean setBaudRate(double rate)
rate - the baud rate of this scheduler (in bits/s)
public abstract boolean enque(Packet np)
np - A Packet to be enqued by this scheduler.
public abstract Packet deque()
public abstract boolean isEmpty()
public abstract int size()
public String getName()
|
GridSim v3.1 |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||