Fifo
====
Single-server queue model.
Demonstrates:
- subclassing simple modules
- using handleMessage()
- decomposing handleMessage() into several functions
- using simple statistics and output vectors
- using finish()
The model contains three modules. The "gen" module generates jobs, and
sends them to the "fifo" module which is a single-server queue. Jobs are
stored in a queue (cQueue object) until they are served -- this queue can be
found and inspected in the graphical environment among the class members of
the "fifo" module -- either in the object tree in the main window, or in the
inspector of the "fifo" module (right-click "fifo" icon --> Inspect as object
--> click "Contents" tab). Processed jobs are disposed of in the "sink"
module. The "sink" module collects statistics which can also be inspected.
After running the simulation, fifo*.vec file will contain queueing time
data collected via cOutVector objects during the simulation. The data
can be plotted using the Plove program.
AbstractFifo can be used as a base class for modules that involve queueing.
One can subclass AbstractFifo and redefine the following member functions:
void arrival(cMessage *msg)
simtime_t startService(cMessage *msg)
void endService(cMessage *msg)
These functions are called by AbstractFifo::handleMessage() whenever
a message arrives, begins service and ends service, respectively.
startService() should return the service time for the message.
ACBFifo and ACPFifo demostrates how to do this.
fifo.rar_fifo_visual c
版权申诉
110 浏览量
2022-09-21
05:06:49
上传
评论
收藏 476KB RAR 举报
JonSco
- 粉丝: 77
- 资源: 1万+