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

Each attribute corresponds to a row in the table on the Get Attribute tab in the block's dialog box. Buttons to the left of the table let you manipulate rows in the table:

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

Missing Attributes

You can specify the block's 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, as described below.

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
Ax, where x = 1, 2, 3,...Value of the attribute specified in the Ax row of the table in the dialog.After entity departure1

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

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. See Attribute Value Support to learn what kind of data you can use as a default value. This field appears 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 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.

Examples

See Also

Set Attribute

Accessing Attributes of Entities

  


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