| Contents | Index |
Attributes
This block accepts an entity, assigns data to it, and then outputs it. Assigned data is stored in attributes of the entity. Each attribute has a name and a value. To learn what kind of data an attribute can store, see Attribute Value Support.
Note If you attach large arrays to entities in a model that contains a server or a queue block with large capacity, the simulation might run out of memory. |
In the block dialog box, on the Set Attribute tab, each attribute corresponds to a row in the table. The block can set up to 32 attributes. Use the buttons to the left of the table to manipulate rows in the table:
To add a new row to the table, click the Add button
. By default, the attribute
name in the new row is unique within the table.
To duplicate a row, select it and click the Copy button
.
To remove a row, select it and click the Delete button
. When you click the Delete button,
there is no message asking you to confirm the deletion or offering
an undo operation. However, if you delete a row by mistake, but have
not clicked the Apply button or the OK button
to apply the change, then click the Cancel button.
The dialog box closes and deletion of the row is canceled.
Note If you delete a row and apply the change, it might affect signal output ports corresponding to other rows of the table. For example, if the block has a signal output port A2 and you delete the row marked A1, then the block relabels A2 as A1. Verify that any signal that connects to the relabeled port is still connected as you expect. |
Within each row, you can specify properties of the attribute that corresponds to that row.
Assigning a Constant Value Using the Block Parameters Dialog Box
Select the Name field and type the name of each attribute that you want to set. All names that are valid variable names in the MATLAB language, except nan and inf (with any use of case), are valid as attribute names. To determine whether a name is a valid variable name, use the isvarname function.
Set Value From to Dialog.
Select the Value field and enter the value for the attribute.
Determine if the constant value you typed is a vector that you want the block to interpret a one-dimensional array rather than a multidimensional array. If yes, select Treat Vector as 1-D.
Assigning a Value Using an Input Signal
Select the Name field and type the name of each attribute you want to set. All names that are valid variable names in the MATLAB language, except nan and inf (with any use of case), are valid as attribute names. To determine whether a name is a valid variable name, use the isvarname function.
Set Value From to Signal port. The Value and Treat Vector as 1-D fields become unavailable.
Click OK or Apply. The block now has signal input ports whose labels match the value of the Name field of each attribute in the table.
Connect a signal to each input port. During the simulation, the block assigns the value of this signal to the attribute.
Entity Input Ports
| Label | Description |
|---|---|
| IN | Port for arriving entities. |
Signal Input Ports
| Label | Description |
|---|---|
| Attribute name | Data to assign to the attribute specified in the Ax row of the table in the dialog box. x = 1, 2, 3, etc. The signal must be a fixed-size, event-based signal. You see this port only if you set Value From in the Ax row to Signal port. The default value of the Name that corresponds to row Ax, is Attributex. 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. |
Entity Output Ports
| Label | Description |
|---|---|
| OUT | Port for departing entities, with data assigned to them. |
Signal Output Ports
| Label | Description | Time of Update When Statistic Is On |
|---|---|---|
| #d | Number of entities that have departed from this block since the start of the simulation. | After entity departure |
The initial output value is 0. This value is in effect from the start of the simulation until the first update by the block.

The name of the attribute to set.
Determines whether the data for attribute values comes from the dialog box or a signal.
The value to assign to the attribute. This field is active only if you set Value From to Dialog.
This option affects attributes whose Value From parameter is set to Dialog and whose Value parameter evaluates to an N-element row or column vector. Selecting this option causes the block to assign the attribute as a vector of length N. Otherwise, the block assigns the attribute as a multidimensional array.
Selecting this option enables the block to define new attributes. Otherwise, the block issues an error if any attribute named in the table does not already exist.
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".

Setting Attributes of Entities

Model electronic system architectures, process flows, and logistics as queuing systems or agent-based systems.
Get free kit| © 1984-2012- The MathWorks, Inc. - Site Help - Patents - Trademarks - Privacy Policy - Preventing Piracy - RSS |