Skip to Main Content Skip to Search
Product Documentation

Single Server - Serve one entity for period of time

Library

Servers

Description

This block serves one entity for a period of time, and then attempts to output the entity through the OUT port. If the OUT port is blocked, then the entity stays in this block until the port becomes unblocked. If an entity in this block is scheduled to time out, then it might depart prematurely via the optional TO port; see Forcing Departures Using Timeouts for details about timeouts.

You specify the service time, which is the duration of service, via a parameter, attribute, or signal, depending on the Service time from parameter value. The block determines the service time for an entity upon its arrival. Service times are assumed to be specified in seconds.

The block permits preemption if you select Permit preemption based on attribute. In this case, an entity in the server can depart early via the P port. Preemption occurs only if attributes of the current entity and the entity attempting to arrive satisfy specified criteria. For details, see Preempting an Entity in a Server.

When the block does not permit preemption, the IN port is unavailable whenever this block stores an entity. In this case, the IN port becomes available when the entity departs.

Ports

Entity Input Ports

LabelDescription
INPort for arriving entities, which will be served.

Signal Input Ports

LabelDescription
tService time, in seconds, for a newly arrived entity. This signal must be an event-based signal. You see this port only if you set Service time from to Signal port t.

Entity Output Ports

LabelDescription
OUTPort for departing entities that have completed their service time, have not timed out while in this block, and have not been preempted.
PPort for entities that have been preempted by an arriving entity. This port must not be blocked at the time of preemption.
TOPort for entities that time out while in this block. You see this port only if you select Enable TO port for timed-out entities. This port must not be blocked when an entity attempts to depart here.

Signal Output Ports

LabelDescriptionTime of Update When Statistic Is OnOrder of Update When Entity Departs
#dNumber of entities that have departed from this block via the OUT port since the start of the simulation.After entity departure via the OUT port4
#nNumber of entities currently in the block, either 0 or 1.After entity arrival and after entity departure via the OUT or TO port3
#pNumber of entities that have been preempted from this block since the start of the simulation.After entity departure via the P port4
pe

A value of 1 indicates that the block stores at least one entity that has tried and failed to depart. In that case, the entity is a pending entity.

A value of 0 indicates that the block does not store any pending entities.

Sample time hit of 1 occurs after the block stores an entity that has tried and failed to depart.

Sample time hit of 0 occurs after the departure of the pending entity via any port.

1
wSample mean of the waiting times in this block for all entities that have departed from the OUT or TO port. An entity's waiting time might exceed its service time if the OUT port is blocked when the entity completes service.After entity departure via the OUT or TO port2
utilUtilization of the server, which is the fraction of simulation time spent storing an entity. At T=0, the utilization is 0 or 1 depending on whether the server contains an entity.Performance considerations cause the block to update the signal only after each entity departure via the OUT or TO port, and after each entity arrival.2
#toNumber of entities that have timed out from this block since the start of the simulation.After entity departure via the TO port4

Output signals having the same number in the Order of Update column in the table above are updated in an arbitrary sequence relative to each other; you should not rely on a specific sequence for your simulation results.

The initial output value, which is in effect from the start of the simulation until the first update by the block, is 0 for all signals.

Dialog Box

Single Server Tab

Service time from

Determines whether the service time is computed from a parameter in this dialog box, an input signal, or an attribute of the entity being served.

Service time

The service time, in seconds, for all entities. You see this field only if you set Service time from to Dialog.

Attribute name

The name of the attribute whose value the block uses as the service time for an entity. You see this field only if you set Service time from to Attribute.

Service completion event priority

The priority of the service completion event, relative to other simultaneous events in the simulation.

Preemption Tab

Permit preemption based on attribute

If you select this option, the block can replace an entity by a higher priority entity. Otherwise, the block never permits new arrivals when it is storing an entity. Selecting this option also clears the Average wait, w check box on the Statistics tab and makes that parameter unavailable.

Sorting attribute name

The block uses this attribute to determine whether a new entity can preempt the one in the server. You see this field only if you select Permit preemption based on attribute.

Sorting direction

Preemption occurs when the arriving entity has a strictly smaller (Ascending) or strictly larger (Descending) value of the attribute named above, compared to the attribute value of the entity in the server. You see this field only if you select Permit preemption based on attribute.

Write residual service time to attribute

If you select this option, a preemption event causes the block to set an attribute in the preempted entity. The attribute value is the remaining service time the entity would have required if it had not been preempted. You see this field only if you select Permit preemption based on attribute.

Residual service time attribute name

The name of the attribute the block uses when recording the residual service time of entities. You see this field only if you select Write residual service time to attribute.

Create attribute if not present

Selecting this option enables the block to define a new attribute for the residual service time. Otherwise, the block issues an error if the attribute named above does not already exist. You see this field only if you select Write residual service time to attribute.

Timeout Tab

Enable TO port for timed-out entities

This option becomes relevant if an entity times out while in this block. Selecting this option provides a TO entity output port through which the timed-out entity departs. If you clear this option in a model that uses timeouts, see the If entity has no destination when timeout occurs parameter of the Schedule Timeout block.

Statistics Tab

These parameters determine whether the block produces data at signal output ports or omits those ports. For descriptions of the data and ports, see the preceding table, "Signal Output Ports".

Number of entities departed

Allows you to use the signal output port labeled #d.

Number of entities in block

Allows you to use the signal output port labeled #n.

Number of entities preempted

Allows you to use the signal output port labeled #p. This field is available only if you select the Permit preemption based on attribute option on the Preemption tab.

Pending entity present in block

Allows you to use the signal output port labeled pe.

Average wait

Allows you to use the signal output port labeled w. This field is available only if you clear the Permit preemption based on attribute option on the Preemption tab.

Utilization

Allows you to use the signal output port labeled util.

Number of entities timed out

Allows you to use the signal output port labeled #to.

Examples

The following example (open model) illustrates the timing of updates of the util signal, as described in Signal Output Ports.

The server has idle periods that reduce its utilization. However, the server block recomputes the util signal only when the number of entities in the server changes. While the definition of utilization says that the utilization is less than 1 at time 3, the util signal remains at its previous value of 1 until the next entity arrives at time 4.

In a longer simulation, the differences in the value of util compared to its theoretical definition become less pronounced.

See Also

N-Server, Infinite Server

Basic Queues and Servers

  


Free SimEvents Evaluation Kit

Learn how you can use SimEvents discrete-event simulation capabilities through these technical resources.

Get free kit

Trials Available

Try the latest version of discrete-event simulation products.

Get trial software
 © 1984-2012- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS