The queue length is an example of a statistic that quantifies a state at a particular instant. Other statistics, such as average waiting time and server utilization, summarize behavior between T=0 and the current time. To modify the model so that you can view the average waiting time of entities in the queue and server, as well as the proportion of time that the server spends storing an entity, use the following procedure:
Note: To skip the model-building steps and open a completed version of the model for this section, enter simeventsdocex('doc_dd1_wait_util')simeventsdocex('doc_dd1_wait_util') in the MATLAB Command Window. Then skip to step 8 to run the simulation.
1. Double-click the FIFO Queue block to open its dialog box. Click the Statistics tab, set the Average wait parameter to On, and click OK. This causes the block to have a signal output port for the signal representing the average duration that entities wait in the queue. The port label is w.
2. Double-click the Single Server block to open its dialog box. Click the Statistics tab, set both the Average wait and Utilization parameters to On, and click OK. This causes the block to have a signal output port labeled w for the signal representing the average duration that entities wait in the server, and a signal output port labeled util for the signal representing the proportion of time that the server spends storing an entity.
3.Copy the Signal Scope1 block and paste it into the model window.
Note: If you modified the plot corresponding to the Signal Scope1 block, then one or more parameters in its dialog box might be different from the default values. Copying a block also copies parameter values.
4. Double-click the new copy to open its dialog box.
5. Set Plot type to Continuous and click OK. For summary statistics like average waiting time and utilization, a continuous-style plot is more appropriate than a stairstep plot. Note that the Continuous option refers to the appearance of the plot and does not change the signal itself to make it continuous-time.
6. Copy the Signal Scope2 block that you just modified and paste it into the model window twice. You now have five scope blocks. Each copy assumes a unique name. If you want to make the model and plots easier to read, you can click the names underneath each scope block and rename the block to use a descriptive name like Queue Waiting Time, for example.
7. Connect the util signal output port and the two w signal output ports to the in signal input ports of the unconnected scope blocks by dragging the mouse pointer from port to port. The model now looks like the following figure. Save the model.
8. Run the simulation with different values of the Period parameter in the Time-Based Entity Generator block, as described in Simulate with Different Intergeneration Times (директория R2013a>SimEvents>Getting Started with SimEvents>Explore Simulations Using the Debugger and Plots). Look at the plots to see how they change if you set the intergeneration time to 0.3 or 1.1, for example.