|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcore_lib.BWidthUnit
public class BWidthUnit
The BWidthUnit class helps manage bandwidth at the user level. It consists of a queue of type integer. The number of entries in that queue represents the number of occupied connections, saturating at GLOBALS.BAND_MAX. The queue entry value indicates at which cycle that connection can be freed.
Field Summary | |
---|---|
private Globals |
GLOBALS
Parameters of the Network in which this BWidthUnit resides. |
private java.util.Queue<java.lang.Integer> |
queue
Cycle number at which each connection can be freed. |
Constructor Summary | |
---|---|
BWidthUnit(Globals GLOBALS)
Construct a BWidthUnit object. |
Method Summary | |
---|---|
boolean |
available(int cycle)
Query to see if this BWidthUnit has available bandwidth. |
void |
consume(int cycle)
Consume a connection for the next GLOBALS.BAND+PER cycles |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private Globals GLOBALS
private java.util.Queue<java.lang.Integer> queue
Constructor Detail |
---|
public BWidthUnit(Globals GLOBALS)
GLOBALS
- The Network parameterization objectMethod Detail |
---|
public boolean available(int cycle)
cycle
- The cycle at which this query is being made
public void consume(int cycle)
cycle
- The cycle at which this connection begins.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |