Attribute: Difference between revisions

From Tygron Support wiki
Jump to navigation Jump to search
 
(65 intermediate revisions by 8 users not shown)
Line 1: Line 1:
{{being_updated}}
A number of components, such as [[neighborhood]]s, [[area]]s, [[building]]s and [[zone]]s, have adjustable attributes. These attributes are used:
* to provide meaningful information
* as parameters in calculations
* to provide (visual) information to distinguish themselves among peers


{{learned|what an attribute is|how the concept of attributes relates to the Tygron Engine|how to create and edit attributes}}
Attributes can be defined and redefined by a user. Some attributes are predefined by the {{software}} and already exist as default properties of a component. Some components can even inherit properties from other type of components, such as a [[Building]] that inherits attributes from it's referenced [[Function]].


==What is an Attribute?==
In general the {{software}} allows users to inspect, adjust and reset existing attributes of these components and define and remove new ones.
An attribute is a characteristic or (additional) property of something. Attributes are a common way to provide additional information or configuration for elements of data in software.


==Attributes in relation to the Tygron Engine==
The group of components than can store attributes is called ''Attribute Items''. The current list of ''Attribute Items'' is:
A number of spatial components, such as [[neighborhood]]s, [[area]]s, [[construction]]s and [[zone]]s, can be provided attributes. These components have attributes to provide information, often defined by the user, in addition to the default properties the components have. The Tygron Engine also stores or reflects a number of standard properties as attributes, meaning that these properties can easily be inspected or changed in the same way user-defined data can.
* [[Area]]s
* [[Building]]s
* [[Functions]] and their overrides
* [[Indicator]]s
* [[Neighborhood]]s
* [[Net load]]s
* [[Net line]]s
* [[Net line#Net line definitions|Net function]]s
* [[Overlay]]s
* [[Panel]]s
* [[Terrain]]s
* [[Weather]]s
* [[Zone]]s


[[Globals]] behave similarly to attributes, except that they are not part of any specific component in the project, but part of the project as a whole.
Note that although [[Global]]s seem to behave similarly to attributes, they are not part of any specific ''Attribute Item'' in a project. Instead they are individual components part of the project.


==Attribute values==
==Attribute values==
An attribute always consists of a name and a value. The name of an attribute is usually written in capital letters, and uses underscores in place of spaces. The value must always be a number. It can be either a positive or a negative number. The number can also be a decimal number (I.e., the value is not necessarily a whole number).
An attribute always consists of a name and a value. The name of an attribute is usually written in capital letters, and uses underscores in place of spaces. The value must always be a number. It can be either a positive or a negative number. The number can also be a decimal number (I.e., the value is not necessarily a whole number).
''Note that not there are some [[TQL_name|restrictions for attribute names]].''
Some components have properties which are also reflected in attributes. Properties such as the color of the component are present both as a dedicated property and as an attribute. By changing the property, the attribute is changed as well. When the attribute is changed, the property is changed as well.


Each component which can have attributes has their own list of attributes. When a given area has an attribute with a specific name, another area may or may not have an attribute with the same name as well. When 2 components have an attribute with the same name, their values are also still set per component. That means that they may coincidentally have the same value, but when the value of the attribute of one component is changed, the value of the attribute of the other component is not automatically changed as well.
Each component which can have attributes has their own list of attributes. When a given area has an attribute with a specific name, another area may or may not have an attribute with the same name as well. When 2 components have an attribute with the same name, their values are also still set per component. That means that they may coincidentally have the same value, but when the value of the attribute of one component is changed, the value of the attribute of the other component is not automatically changed as well.
===Attribute arrays===
{{main|Attribute array}}
Attributes are most commonly a single value, but can also be an array of values.


===Attribute values during a session===
===Attribute values during a session===
Line 23: Line 47:
''Note that this means that an attribute value of 0 can mean that the proper value of the attribute is 0, or that the attribute does not exist.
''Note that this means that an attribute value of 0 can mean that the proper value of the attribute is 0, or that the attribute does not exist.


Attributes can also be changed during a session. This can be done either via [[Event]]s or via [[TQL]]. Events, such as AREA_SET_ATTRIBUTE or ZONE_SET_ATTRIBUTE, can be used in the Engine to change the values of attributes. Attributes can also be changed using TQL, which means that attributes can be changed as a result of an Excel calculation.
Attributes can also be changed during a session. This can be done either via [[Event]]s or via [[TQL]]. Events, such as AREA_SET_ATTRIBUTE or ZONE_SET_ATTRIBUTE, can be used in the {{software}} to change the values of attributes. Attributes can also be changed using TQL, which means that attributes can be changed as a result of an Excel calculation.
 
==How to add and remove attributes==
[[File:Attribute add.jpg|framed|left|This panel allows you to add new attributes.]]
 
[[File:attribute_tab.jpg|framed|right|Switch to the Attributes tab to create or edit attributes.]]
Attributes can be added to components such as [[Neighborhood]]s, [[Area]]s, [[Construction]]s and [[Zone]]s. In order to add, remove, or change an attribute for any components, select the component in the left panel, and then select the attributes tab in the right panel. The attributes of that component will be displayed.<br style='clear:right;'>
===Adding attributes===
[[File:attribute_new_name.jpg|framed|right|Enter the desired name for the new attribute.]]
To create a new attribute, enter the desired name for the new attribute in the "Add new Attribute with Name" field.<br style='clear:right;'>
[[File:attribute_new_value.jpg|framed|right|Enter the desired value for the new attribute.]]
To create a new attribute, enter the desired value for the new attribute in the "Add new Attribute with Value" field.<br style='clear:right;'>
[[File:attribute_new_save.jpg|framed|right|Enter the desired value for the new attribute.]]
Once an attribute name and a valid attribute value have been entered in the appropriate fields, the "Save New Attribute" button becomes available. Selecting it will add the attribute to the list of existing attributes for the component.<br style='clear:right;'>
===Removing attributes===
[[File:attribute_reset.jpg|framed|right|Enter the desired value for the new attribute.]]
To remove all attributes from a component, select the "Reset Variables" button.


''Note that when you remove attributes which are related to properties of the component, the value of the properties will be changed as well, as though the attribute was set to "0".
===Common attribute values===
 
It is currently not possible to remove individual attributes from a component. When desired, it is possible to set individual attributes to "0".<br style='clear:right;'>
{{Editor steps|title=add a new attribute|Enter a name for the new attribute.|Enter a value for the new attribute.|Select "Save New Attribute".}}
{{Editor steps|title=remove an attribute|Select "Reset Variables".}}
 
===Importing Attributes===
[[File:Import_area_file.jpg|framed|right|This panel allows you to select the attribute that you want to import]]
When creating areas using [[GeoJSON]], it is possible to have attributes created based on the same file. In the GeoJSON import window, you will have the option to select attributes of the imported shapes, and to store them as attributes in areas. The same restrictions apply for importing attributes as when normally creating or editing attributes. I.e. the values must be valid numbers.
 
{{Editor steps|title=add attributes with a GeoJSON file|Option 1) Select the GeoJSON file in the folder Option 2) <br> Hoover over the desired component in the Editor and Select import GeoJSON file|In of  case option 1 Drag and Drop the file in the Tygron Engine|Select the desired input|Make sure the attribute checkbox is checked|Select the right attribute name|Select the right attributes to import|Select Send to import the attributes together with the imported area.}}<br style='clear:both'>
 
==Edit attributes==
[[File:attribute_attribute.jpg|framed|right|Each attribute is listed with a name and a value. The values of existing attributes can be changed.]]
The value of any attribute can be changed after it has been added to a component. In the list of attributes, the value field for any attribute can be selected. The value can be changed by entering a different value in the field. The value must be a valid number, or the new value is rejected immediately.
 
{{Editor steps|title=change the value of an attribute|Select the value of the attribute you wish to change.|Change the value to a valid value.|Press "Enter" to set the value.}}
 
===Special attribute values===
Some attributes may have a more exact spectrum of values which are valid. For example, the ACTIVE attribute is either 1 or a 0.
Some attributes may have a more exact spectrum of values which are valid. For example, the ACTIVE attribute is either 1 or a 0.


''Note that for attributes like these, other number values are not automatically rejected. When the engine or a user-defined calculation depends on the attribute being within a specific range of values, and the actual value is a different, valid number, no guarantees can be made about the result.''
''Note that these attributes can be given other values as well. The resulting behavior for calculations and functionality depending on these attributes is undefined.


====Active====
====ACTIVE====
: ''Applies to: [[Area]]s
: ''Applies to: [[Area]]s, [[Neighborhood]]s, [[Overlay]]s, [[Indicator]]s and [[Stakeholder]]s
Some components may have an "active" property. When that property indicates the component is active, the "ACTIVE" attribute's value is "1". When the component is inactive, the attribute's value is "0".
Some components may have an "active" property. When that property indicates the component is active, the "ACTIVE" attribute's value is "1". When the component is inactive, the attribute's value is "0".


====Color====
====COLOR====
: ''Applies to: [[Area]]s, [[Neighborhood]]s, [[Zone]]s
: ''Applies to: [[Area]]s, [[Neighborhoods]], [[Zone]]s
Many components with attributes automatically have a "COLOR" attribute added to them, the value of which is the same as the color property of that component. When that color property is changed, the attribute is changed, and vice versa.
{{main|Color}}
Spatial components with attributes commonly have a "COLOR" attribute, defining the color by which they are displayed.The value corresponds to the color property of that component. When that color property is changed, the attribute is changed, and vice versa.


The numeric value of the attribute corresponds with an RGB color value, calculated by combining the red, green and blue values of the desired color together, multiplied by powers of 256. The amount of red, green, and blue are values between 0 and 255, inclusive. These are added to a base value of -16777216. A proper color value can be calculated as follows: -16777216 + (red * 256²) + (green * 256) + (blue).
===Examples of special attribute values===


====Urbanization====
====URBANIZATION====
: ''Applies to: [[Neighborhood]]s
: ''Applies to: [[Neighborhoods]]
The "URBANIZATION" attribute is an indication of how deep within a city a neighborhood lies. It ranges from 1 (dense urbanization) to 5 (virtually no urbanization).
The "URBANIZATION" attribute is an indicator for the degree of urbanization. It ranges from 1 (dense urbanization) to 5 (virtually no urbanization).


====Nature Reserve====
====NATURE_RESERVE====
: ''Applies to: [[Area]]s
: ''Applies to: [[Area]]s
The "NATURE_RESERVE" attribute indicates whether an area is a protected area of nature. This usually means the allowance for pollution and noise is lower. Areas with an "NATURE_RESERVE" attribute value of "1" are deemed protected nature. When the attribute's value is 0, the area is not necessarily deemed protected nature.
The "NATURE_RESERVE" attribute indicates whether an area is a protected area of nature. This usually means the allowance for pollution and noise is lower. Areas with an "NATURE_RESERVE" attribute value of "1" are deemed protected nature. When the attribute's value is 0, the area is not necessarily deemed protected nature.
{{article end
| notes=
* When removing attributes which are related to properties of the component, the value of the properties will be changed as well, as though the attribute was set to "0".
| howtos=
[[File:Attribute editing panel.jpg|thumb|right|The [[right panel]] allows you to add new attributes. The top half allows you to edit existing attributes, the bottom half allows you to add new attributes.]]
* [[How to add an Attribute]]
* [[How to remove an Attribute]]
* [[How to edit an Attribute]]
* [[How to import Attributes]]
* [[How to remove Attributes from multiple Items]]
* [[How to change multiple Attributes at once for Water Overlays]]
| seealso=
* [[Overlay Key]]
* [[Global]]
}}

Latest revision as of 16:14, 26 January 2023

A number of components, such as neighborhoods, areas, buildings and zones, have adjustable attributes. These attributes are used:

  • to provide meaningful information
  • as parameters in calculations
  • to provide (visual) information to distinguish themselves among peers

Attributes can be defined and redefined by a user. Some attributes are predefined by the Tygron Platform and already exist as default properties of a component. Some components can even inherit properties from other type of components, such as a Building that inherits attributes from it's referenced Function.

In general the Tygron Platform allows users to inspect, adjust and reset existing attributes of these components and define and remove new ones.

The group of components than can store attributes is called Attribute Items. The current list of Attribute Items is:

Note that although Globals seem to behave similarly to attributes, they are not part of any specific Attribute Item in a project. Instead they are individual components part of the project.

Attribute values

An attribute always consists of a name and a value. The name of an attribute is usually written in capital letters, and uses underscores in place of spaces. The value must always be a number. It can be either a positive or a negative number. The number can also be a decimal number (I.e., the value is not necessarily a whole number).

Note that not there are some restrictions for attribute names.

Some components have properties which are also reflected in attributes. Properties such as the color of the component are present both as a dedicated property and as an attribute. By changing the property, the attribute is changed as well. When the attribute is changed, the property is changed as well.

Each component which can have attributes has their own list of attributes. When a given area has an attribute with a specific name, another area may or may not have an attribute with the same name as well. When 2 components have an attribute with the same name, their values are also still set per component. That means that they may coincidentally have the same value, but when the value of the attribute of one component is changed, the value of the attribute of the other component is not automatically changed as well.


Attribute arrays

Main article: Attribute array

Attributes are most commonly a single value, but can also be an array of values.

Attribute values during a session

Attributes can be read during a session. Primarily, it is possible to read attributes of components using TQL. By requesting the value of an attribute of a component using TQL, the value of that attribute can be used in, for example, Excel calculations.

It is possible that, when requesting the value of an attribute of a component, that attribute does not exist for that component. In this case, the value of that attribute is deemed to be "0".

Note that this means that an attribute value of 0 can mean that the proper value of the attribute is 0, or that the attribute does not exist.

Attributes can also be changed during a session. This can be done either via Events or via TQL. Events, such as AREA_SET_ATTRIBUTE or ZONE_SET_ATTRIBUTE, can be used in the Tygron Platform to change the values of attributes. Attributes can also be changed using TQL, which means that attributes can be changed as a result of an Excel calculation.

Common attribute values

Some attributes may have a more exact spectrum of values which are valid. For example, the ACTIVE attribute is either 1 or a 0.

Note that these attributes can be given other values as well. The resulting behavior for calculations and functionality depending on these attributes is undefined.

ACTIVE

Applies to: Areas, Neighborhoods, Overlays, Indicators and Stakeholders

Some components may have an "active" property. When that property indicates the component is active, the "ACTIVE" attribute's value is "1". When the component is inactive, the attribute's value is "0".

COLOR

Applies to: Areas, Neighborhoods, Zones
Main article: Color

Spatial components with attributes commonly have a "COLOR" attribute, defining the color by which they are displayed.The value corresponds to the color property of that component. When that color property is changed, the attribute is changed, and vice versa.

Examples of special attribute values

URBANIZATION

Applies to: Neighborhoods

The "URBANIZATION" attribute is an indicator for the degree of urbanization. It ranges from 1 (dense urbanization) to 5 (virtually no urbanization).

NATURE_RESERVE

Applies to: Areas

The "NATURE_RESERVE" attribute indicates whether an area is a protected area of nature. This usually means the allowance for pollution and noise is lower. Areas with an "NATURE_RESERVE" attribute value of "1" are deemed protected nature. When the attribute's value is 0, the area is not necessarily deemed protected nature.

Notes

  • When removing attributes which are related to properties of the component, the value of the properties will be changed as well, as though the attribute was set to "0".

How-to's

The right panel allows you to add new attributes. The top half allows you to edit existing attributes, the bottom half allows you to add new attributes.

See also