Attribute Reference Dialog

From Planimate Knowledge Base
Jump to: navigation, search

You use this dialog to specify data (eg: a value) or where Planimate should look for data (eg: an attribute).

There are many options here. You can specify a constant value, refer to a Portal, Item or Routine Attribute, refer to a Planimate maintained System Attribute, get the index associated with a Label, read a cell from a Table or (in some cases) refer to table rows, columns or entire tables.

You start by using the Mode button to select the kind of thing you want to reference. Depending what you pick here, other fields and buttons appear in this dialog for you select exactly what you want to reference.

Your options for Mode include:

Value Use this if you want to type in a number directly or want to refer to a Portal Attribute, Item Attribute, Routine Attribute, System Attribute or select from a list of labels.

Cell Use this if you want to make a direct reference to a cell in a table. You get to specify the table, row and column.

Matched Cell Use this if you want to make an indirect reference to a cell in a table. If your table has a key column and you have a key value that you know is in the table, then this mode lets you look up the row with the matching key and get access to data in another column.

Table Property Use this if you want to look up how many rows or columns are currently in a table.

Column Index Use this to find the index of a column with a given name in a table.

Mapper Use this if you want to use the table to perform a linearly-interpolated mapping from values specified in the table's first column to corresponding values specified in another column in the table.

PDF Dist Use this if you want to select a table as a source to a Point Distribution Function. This validates that the table contains point/value pairs.

CDF Dist Use this if you want to select a table as a source to a Cumulative Distribution Function. This validates that the table contains probability values accumulating from zero to one.

Matched Index Use this if your table has a key column and you have a key value that you know is in the table. It will return the row number of the row that contains the matching key value.

Row Use this if you want to operate with an entire row from a table. This is used in certain Routine Operations which process entire table rows rather than individual cell values.

Matched Row Use this if your table has a key column and you have a key value that you know is in the table. It will return the entire row of the row with the matching key. This is used in certain Routine Operations which process entire table rows rather than individual cell values.

Column Use this if you want to operate with an entire column from a table. This is used in certain Routine Operations which process entire table columns rather than individual cell values.

Block Use this to operate on a sub region of a table. You specify the table and the top left cell of the region. This selects a sub region of the table starting at the cell specified and extending to the bottom right corner of the table. This is used in some specific table processing Routine Operations.

Table Use this to operate with an entire table. This is used in some Routine Operations which perform table calculations or where a table is provided to an object for it to work with.

Cell Property Use this to access colour properties of a table cell. You specify a table, row and column similar to a cell reference but instead of returning/setting the cell's value, this will return/set the cell's text and background colour. This is used to highlight certain cells in a table.

Object Property Use this to read and set properties of an Object, including its position, the size of its icon, the object's current occupancy. Some of the object properties are read only. You specify an object using its index in the Object Label List.

Entire Item Use this to operate on the Item that is involved in an interaction. This is used in some Routine Operations.

If a Mode is greyed out in the list, it means that it is not selectable for the current Attribute Reference being edited. This is often the case when editing the "target" of a routine operation. Only the modes which can actually receive data are made available.

Value Fields

Many of the modes will display additional fields for you to fill in. The simplest mode, Value, has one Value Field area. A Table Cell reference on a normal table has two (one for row and one for column). Each Value Field area has a Type button to select what the value field refers to. Planimate sometimes sets the default type, but you can change it.

It is useful to know that a Value Field is just a way of referencing a number; you get to chose whether that number is a constant or something dynamic.

Your options for the Value Field Type are:

Constant Use this to specify a constant number. This is a common default for many Attribute References.

Item Use this to reference an Item Attribute. This will look for an Attribute with the name you enter on the item involved in an interaction.

Portal Use this to reference a Portal Attribute. This will look for an Attribute with the name you enter at the Portal Subsystem where the object is located. If not found, Planimate will search up any owning portals until it reaches the "top" of the model.

Routine Use this to reference a Routine Attribute. This will look for an attribute with the name you enter in the Routine currently executing. This is useful for local or temporary variables within a routine.

System Use this to reference special internal variables that the Planimate engine maintains as it runs your model, such as the current simulation time, item destinations, object locations and run controls. These are called System Attributes.

Label Use this if you want to reference a label. You can select a label list then pick a label from it. The index of the label you select will be the value.

Col Label Use this if you want to reference a table column by the columns label. This is often used for the column reference of a table cell reference. By using a column label, you avoid hard coding a column number in your code which is useful if the table columns ever get rearranged.

Class Use this to reference a Class Attribute. A class attribute is similar to an Item Attribute except that all items of the item's class read and write to the same attribute. This is used in advanced applications where different classes need to track information specific to each class but not specific to each item (eg:statistics and counters).

Carry This is an advanced referencing mode useful in models using the Carrying capability of items. It enables you to read the item attributes of an item that the current item is carrying.

Label List Use this in routine operations which require a label list to be specified but do not require (or use) an actual label value, for example the routine operation which clears a label list.

Value Fields Which Appear

Attribute To Use Appears when Mode is Value. You can enter a number or reference an attribute.

Row Selection Index Appears when referencing tables. Sets the row. Often an item or routine attribute is used here.

Column Selection Index Appears when referencing tables. Sets the column. Often a Column Label is useful here.

Column Containing Key To Match Appears with the Matched Cell, Matched Row and Matched Index modes. Set it to the column in the table that contains keys you want to look up a value in, in order for Planimate to find the row you want to access. Often a Column Label is useful here.

Value To Match Key With Appears with the Matched Cell, Matched Row and Matched Index modes. Set it to the value of the key that you expect to find in the Key Column.

Name Of Table To Use Appears with "<dynamic>" table references. Set to an attribute formatted for a label list which names the table you want to reference. These references are slower than fixed table references and harder to debug, so only use them if you need the "dynamic" functionality.

Object Appears when referencing an Object Property. Use the Object Label List or an attribute formatted to this list to nominate which object.

Property (Table Property Mode)Appears when referencing an Object Property. Click the button to select the property you want.

Property (Object Property Mode) Appears when referencing a Table Property. Click the button to select the property you want.

Probability % Column Appears when setting up a PDF Distribution. Enables you to select which column contains the probability percentages for each bin.

Cumulative Prob Column Appears when setting up a CDF Distribution. Enables you to select which column contains accumulating probability values which define the distribution.

Attribute To Remap Appears when using a Mapper table reference. Enables you to specify the data point that you want to remap through the mapper table.

Top Left Cell Row Top Left Cell Column
Appear in Table Block mode. These define the top left cell of the block. Note that the number of rows and columns for the block are not defined in this Attribute Reference, but applications where Block references are useful (eg: file write) enable these to be separately set.

Additional Buttons

The following additional buttons and fields appear in the Attribute Reference dialog depending on the type of reference.

Table This button enables you to select a table which is in scope. This is required when referencing a table cell, row, column etc. The tables in scope are listed along with a special name, "<dynamic>". Choosing "<dynamic>" shows an extra Value Field, "Name Of Table To Use". Using an attribute formatted for a label list in this field enables the table referenced to be determined at run time.

Copy This button makes an internal copy of the Attribute Reference so it can be pasted into another Attribute Reference. The Attribute Reference closes so you can select another one to paste into.

Paste This button appears if there is an Attribute Reference in the copy buffer, enabling it to be pasted. The Attribute Reference stays open so you can make adjustments to what was just pasted.

Delete Some places where attribute references are used offer this button to clear the reference so it has no effect.





idkbase note 10150