N-Server - Serve up to N entities for period of time

Library

Servers

Description

This block stores up to N entities, serving each one independently for a period of time and then attempting 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.

An N-server is like a set of N single servers connected in parallel, followed by a path combiner; the path combiner notifies entities of an unblocked path in the sequence in which the entities completed their service time, until one entity departs.

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.

All entities that arrive do so via the IN port. The IN port is unavailable whenever this block contains N entities. In that case, the IN port becomes available when at least one of the N entities 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 port appears 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 and have not timed out while in this block.
TOPort for entities that time out while in this block. This port appears 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 port5
#nNumber of entities currently in the block, between 0 and N.After entity arrival and after entity departure4
peThe value is 1 if the block is holding any pending entities, that is, entities that have completed their service but cannot depart because the OUT port is blocked. The value of this signal is 0 if the block has no pending entities or if an entity departure is imminent.After service completion and when entity departure is imminent1
#peThe number of entities that have completed their service but cannot depart because the OUT port is blocked. After service completion (increase in value) and after entity departure (decrease in value)3
wSample mean of the waiting times in this block for all entities that have departed via any port. An entity's waiting time might exceed its service time if the OUT port is blocked when the entity completes service.After entity departure2
utilUtilization of the N-server. If Number of servers is finite, util is the time average of the fraction of servers that are storing an entity. At time values when an entity arrives or departs, util equals 1/N times the time average of the #n signal. If Number of servers is infinite, then util is always zero.Performance considerations cause the block to suppress signal updates until specific occurrences cause updates. In On mode, updates occur after an entity departure and after an entity arrival. In Upon stop or pause mode, stopping or pausing the simulation causes an update.2
#toNumber of entities that have timed out from this block since the start of the simulation.After entity departure via the TO port5

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.

A more precise definition of the utilization signal util at an update time T>0 is

where Ik is the kth time interval between successive pairs of times that util is updated and is the number of entities the N-Server block is storing during the open interval Ik. If an update of util occurs at T=0, the value is #n/N.

Dialog Box

N-Server Tab

Number of servers

The number of servers the block represents, N.

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. This field appears 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. This field appears 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.

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 certain ports produce data throughout the simulation, produce data only when you stop or pause the simulation, or are omitted from the block. For descriptions of the affected ports, see the "Signal Output Ports" table above.

Number of entities departed

Controls the presence and behavior of the signal output port labeled #d.

Number of entities in block

Controls the presence and behavior of the signal output port labeled #n.

Status of pending entity departure

Controls the presence of the signal output port labeled pe.

Number of pending entities

Controls the presence and behavior of the signal output port labeled #pe.

Average wait

Controls the presence and behavior of the signal output port labeled w.

Utilization

Controls the presence and behavior of the signal output port labeled util.

Number of entities timed out

Controls the presence and behavior of the signal output port labeled #to.

Examples

See Example: M/M/5 Queuing System.

See Also

Single Server, Infinite Server

Modeling Multiple Servers

  


 © 1984-2008- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS