Skip to Main Content Skip to Search
Product Documentation

Get Attribute - Output value of entity's attribute

Library

Attributes

Description

This block outputs signals using data from attributes of entities. For each arriving entity, the block updates the signal at the signal output ports using values of the attributes named in the block dialog box. The block also outputs the entity unchanged.

Manipulating the Rows of the Table

In the block dialog box, on the Get Attribute tab, each attribute corresponds to a row in the table. The block can get up to 32 attributes. Use the buttons to the left of the table to manipulate rows in the table:

Within each row, you can specify aspects of the block behavior that relate to the attribute that corresponds to that row.

Missing Attributes

You can specify the block behavior if the arriving entity does not possess an attribute listed in the table of the block dialog box. Use the When Attribute Is Missing parameter in the table row for that attribute.

Parameter ValueBlock Behavior in Case of Missing Attribute
ErrorThe block issues an error message and halts the simulation. In this case, the Default Value and Treat Vector as 1-D parameters in the table row for that attribute are disabled.
Default valueThe block outputs a default value that you specify using the Default Value and Treat Vector as 1-D parameters in the table row for that attribute. The simulation proceeds.
WarnThe block outputs a default value that you specify using the Default Value and Treat Vector as 1-D parameters in the table row for that attribute. The block also issues a warning in the MATLAB Command Window. The simulation proceeds.

Ports

Entity Input Ports

LabelDescription
INPort for arriving entities.

Entity Output Ports

LabelDescription
OUTPort for departing entities.

Signal Output Ports

LabelDescriptionTime of Update When Statistic Is OnOrder of Update
#dNumber of entities that have departed from this block since the start of the simulation.After entity departure2
Attribute nameValue of the attribute specified in the Ax row of the table in the dialog box. x = 1, 2, 3, etc. The default value of the Name that corresponds to row Ax, is Attribute x. x = 1, 2, 3, etc. To change the name of an attribute specified in the table from the default, place the cursor in the Name field and type a new name.After entity departure1

Output signals having the same number in the Order of Update column in the preceding table are updated in an arbitrary sequence relative to each other. Do 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

Get Attribute Tab

Name

The name of the attribute to query.

When Attribute Is Missing

The response of the block when the entity does not possess an attribute named in the table.

Default Value

The value for the corresponding output signal if the entity does not possess an attribute named in the table. To learn what kind of data you can use as a default value, see Attribute Value Support. You see this field only if you set When Attribute Is Missing to Default value or Warn.

Treat Vector as 1-D

This option affects attributes whose When Attribute Is Missing parameter is set to Default value or Warn, and whose Default Value parameter evaluates to an N-element row or column vector. Selecting this option causes the block to consider the default value as a vector of length N. Otherwise, the block considers the default value as a multidimensional array.

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.

Examples

See Also

Set Attribute

Accessing Attributes of Entities

  


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