Documentation

Entity Server

Serve entities

Library

Basic

Description

This block serves entities as they arrive. It can serve multiple entities simultaneously and output each entity through the output port, unless the port is blocked. When the block permits preemption, an entity in the server can depart early through a second port.

Parameters

Capacity

Specify the number of entities the block can serve simultaneously.

Service time source

Choose the source to specify the service time.

Service time attribute name

Specify the attribute used to determine the service time. This parameter is visible when Service time source is set to Attribute.

Service time value

Specify the value of the service time. This parameter is visible when Service time source is set to Dialog.

Service time action

Use MATLAB® code to specify service time.

Event actions

Specify the behavior of the entity in certain events. Define the behavior in the Event action parameter. For example, the Generate action is called after an entity is generated.

Event action

Define the behavior for the event action specified in Event actions.

Permit preemption based on attribute

Select this check box if you want to allow preemption of entities. Selecting this check box enables these parameters:

  • Sorting attribute name

  • Sorting direction

  • Write residual time to attribute

  • Number of pending entities, np

Sorting attribute name

Specify the name of the attribute used to determine the priority.

Sorting direction

Choose the direction of sorting the entities. Specify 'ascending' if you want entities with smaller key values to appear in front of the queue. Specify 'descending' if you want entities with greater key values to appear in front of the queue.

Write residual time to attribute

Allow the block to save the residual service time from a preempted entity to an attribute.

This parameter is visible when the Permit preemption based on attribute parameter is selected. Selecting this parameter enables the Residual time attribute name parameter.

Residual time attribute name

Specify the name of the attribute to contain the residual service time of a preempted entity. This parameter is visible when the Write residual time to attribute parameter is selected.

Number of entities departed, d

Outputs the number of entities that have departed the block.

Number of entities in block, n

Outputs the number of entities present in the block.

Pending entity present in block, pe

Indicates whether there are entities present in the block that have yet to depart.

Number of pending entities, np

Outputs the number of pending entities in the block, which have yet to depart.

Average wait, w

Outputs the average wait time for entities in the block.

Utilization, util

Outputs the average number of entities being served.

Number of entities preempted, np

Outputs the number of preempted entities. This check box appears if the Permit preemption based on attribute check box is selected.

Introduced in R2016a

Was this topic helpful?