|On this page…|
Suppose you have a set of measured or expected service times for a server in the system you are modeling and you want to use that data in the simulation. You can use the Event-Based Sequence block to create a signal whose sequence of values comes from the data set and whose timing corresponds to relevant events, which in this case are the arrivals of entities at the server. You do not need to know in advance when entities will arrive at the server because the Event-Based Sequence block automatically infers from the server when to output the next value in the data set.
More generally, you can use the Event-Based Sequence block to incorporate your data into a simulation via event-based signals, where the block infers from a subsequent block when to output the next data value. You must connect the Event-Based Sequence block, directly or indirectly, to exactly one notifying port. The t input port of a Single Server block is an example of a notifying port; for a list, see Notifying Ports. The notifying port tells this block when to generate a new output value. An indirect connection must be via a block listed in Computational Blocks having exactly one input signal and no function-call output signals.
For details on the connectivity restrictions of the Event-Based Sequence block, see its reference page.
For examples using this block, see these sections:
A flexible way to generate event-based sequences is to use the Signal Latch block to indicate explicitly which events cause the Event-Based Sequence block to generate a new output value. Use this procedure:
Insert an Event-Based Sequence block into your model and configure it to indicate the data you want to use.
Insert a Signal Latch block and set Read from memory upon to Write to memory event. The block no longer has an rvc signal input port.
Determine which events should result in the output of the next data value, and set the Signal Latch block's Write to memory upon accordingly.
Connect the signal whose events you identified in the previous step to the write-event port (wts, wvc, wtr, or wfcn) of the Signal Latch block. Connect the Event-Based Sequence block to the in port of the Signal Latch block.
The out port of the Signal Latch block is the desired event-based sequence.
You can modify the model in Create a Random Signal for Switching by replacing the Event-Based Random Number block with the Event-Based Sequence block.
This causes the model's Output Switch to select ports based on the data you provide. If you set the Event-Based Sequence block's Vector of output values parameter to [1 2 3 2].', for example, then the switch selects ports 1, 2, 3, 2, 1, 2, 3, 2, 1,... as entities leave the queue during the simulation. If you change Form output after final data value by to Holding final value, then the switch selects ports 1, 2, 3, 2, 2, 2, 2,... instead.