|
DRCL JavaSim API | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object
|
+--drcl.DrclObj
|
+--drcl.comp.Component
|
+--drcl.net.traffic.TrafficComponent
|
+--drcl.net.traffic.TrafficSourceComponent
Defines the base class for implementing a traffic source.
The output of a traffic source conforms to the associated traffic model
instance.
Subclasses must override the setNextPacket(FooPacket) method to set the
size of next outputted packet and return its birth time.
In addition, a subclass should override the info(String) to provide the content of
this source component. Buffer operations are taken care of in this class.
TrafficModel, Serialized Form| Inner classes inherited from class drcl.comp.Component |
Component.LockPack |
| Field Summary | |
protected RandomNumberGenerator |
r
The random number generator (RNG) associated with this source component. |
protected long |
seed
The seed of the random number generator. |
| Fields inherited from class drcl.net.traffic.TrafficComponent |
downPort, timerPort |
| Constructor Summary | |
TrafficSourceComponent()
|
|
TrafficSourceComponent(java.lang.String id_)
|
|
| Method Summary | |
void |
_resume()
Resumes generating packets. |
void |
_start()
This method is invoked in a new thread context when Component.run() is called. |
void |
_stop()
Stops generating packets. |
void |
duplicate(java.lang.Object source_)
Duplicates the content of source_, including ID, name, child components and connections among them, to this component. |
int |
getBufferSize()
Returns the (maximum) buffer size of this traffic shaper (byte). |
TrafficShaper |
getShaper()
Returns the installed traffic shaper (if there is any). |
java.lang.String |
info(java.lang.String prefix_)
Prints the content of this source component. |
boolean |
isSendUnshapedTrafficEnabled()
Returns true if outputting of unshaped traffic (through the timer port) is enabled. |
protected void |
process(java.lang.Object data_,
Port inPort_)
The main callback method of a component. |
void |
reset()
Resets the component for being used anew. |
void |
setBufferSize(int size_)
Sets the (maximum) buffer size of this traffic shaper (byte). |
protected abstract double |
setNextPacket(FooPacket pkt_)
Sets up next packet. |
void |
setSendUnshapedTrafficEnabled(boolean enabled_)
Enables/disables outputting of unshaped traffic (through the timer port). |
void |
setShaper(TrafficShaper shaper_)
Adds a traffic shaper to the output of this source. |
| Methods inherited from class drcl.net.traffic.TrafficComponent |
getPacketWrapper, getTrafficModel, info, setPacketWrapper, setTrafficModel |
| Methods inherited from class drcl.DrclObj |
clone |
| Methods inherited from class java.lang.Object |
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
protected RandomNumberGenerator r
protected long seed
| Constructor Detail |
public TrafficSourceComponent()
public TrafficSourceComponent(java.lang.String id_)
| Method Detail |
protected abstract double setNextPacket(FooPacket pkt_)
public void reset()
Componentreset in class Componentpublic void duplicate(java.lang.Object source_)
Componentduplicate in class TrafficComponentpublic java.lang.String info(java.lang.String prefix_)
super.info(prefix_) and print out the parameters
defined in the subclass.info in class TrafficComponentprefix_ - prefix that shoud be prepended at the beginning of each line of the result.
protected void process(java.lang.Object data_,
Port inPort_)
Componentprocess in class Componentdrcl.comp.Componentdata_ - the arrival data.inPort_ - the port where the data arrives.public void _start()
ComponentComponent.run() is called.
An ActiveComponent subclass must override this method to start this component._start in class Componentpublic void _stop()
_stop in class Componentpublic void _resume()
_resume in class Componentpublic void setShaper(TrafficShaper shaper_)
traffic shaper to the output of this source.public TrafficShaper getShaper()
traffic shaper (if there is any).public void setBufferSize(int size_)
public int getBufferSize()
public void setSendUnshapedTrafficEnabled(boolean enabled_)
public boolean isSendUnshapedTrafficEnabled()
|
DRCL JavaSim API | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||