Entity Departure Counter

Count departures and write result to signal port and/or attribute

Library

Probes

Description

This block computes the number of entities that have departed from this block since the start of the simulation or since the last reset, whichever occurred later. The block writes this number to a signal output port and/or an attribute of each departing entity. The departing entity is included in the count.

Ports

Entity Input Ports

LabelDescription
INPort for arriving entities.

Signal Input Ports

LabelDescription
trWhen the signal at this port satisfies the specified trigger criteria, the block resets its internal counter and the #d output signal to zero. This port appears only if you set Reset counter upon to Trigger from port tr.
vcWhen the signal at this port satisfies the specified value-change criteria, the block resets its internal counter and the #d output signal to zero. This port appears only if you set Reset counter upon to Change in signal from port vc.

Entity Output Ports

LabelDescription
OUTPort for departing entities.

Signal Output Ports

LabelDescriptionTime of Update When Statistic Is On
#dNumber of entities that have departed from this block since the start of the simulation or since the last reset.After entity departure

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

Dialog Box

Write count to signal port #d

Controls the presence and behavior of the signal output port labeled #d. This parameter determines whether the block outputs the entity count through a signal output port throughout the simulation, only when you stop or pause the simulation, or not at all.

Write count to attribute

If you set this to On, the block assigns the entity count to the attribute specified in the Attribute name parameter.

Attribute name

The name of the attribute the block uses to record the entity count. This field appears only if you set Write count to attribute to On.

Create attribute if not present

Selecting this option enables the block to define a new attribute for the entity count. Otherwise, the block issues an error if the attribute named above does not already exist. This field appears only if you set Write count to attribute to On.

Reset counter upon

Determines whether the block resets its internal counter to zero based on trigger edges, based on changes in signal values, or not at all.

Trigger type

Determines whether rising, falling, or either type of trigger edge causes the counter to reset. This field appears only if you set Reset counter upon to Trigger from port tr.

Type of change in signal value

Determines whether rising, falling, or either type of value change causes the counter to reset. This field appears only if you set Reset counter upon to Change in signal from port vc.

Resolve simultaneous signal updates according to event priority

Select this option to explicitly prioritize the counter's reset event, relative to other simultaneous events in the simulation. If you do not select this option, the event has priority SYS1 on the event calendar. For details, see Choosing How to Resolve Simultaneous Signal Updates. This field appears only if you set Reset counter upon to Trigger from port tr or Change in signal from port vc.

Event priority

The priority of the counter's reset event, relative to other simultaneous events in the simulation. For details, see Specifying Event Priorities to Resolve Simultaneous Signal Updates. This field appears only if you set Reset counter upon to either Trigger from port tr or Change in signal from port vc, and then select Resolve simultaneous signal updates according to event priority.

Examples

See Also

Instantaneous Entity Counting Scope

Counting Entities

  


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