Difference between revisions of "VAT Formula parameter"
imported>Repenning |
imported>Repenning |
||
(8 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
− | Visual AgenTalk (VAT) Formula Syntax is used to create VAT formulas | + | Visual AgenTalk (VAT) Formula Syntax is used to create VAT formulas. These formulas are very powerful as they allow you to create arbitrarily complex expressions including spatial access to other agents' attributes. This is similar to a spreadsheet but even more powerful. |
<br> | <br> | ||
Line 30: | Line 30: | ||
f(x, y) | f(x, y) | ||
+ | |- align="left" valign="top" bgcolor="#ffffcc" | ||
+ | | width="80" bgcolor="white" rowspan="2" | '''Agent Query Functions'''<br> | ||
+ | | width="92" bgcolor="#87cefa" | agents_with_shape(''shape_name'') | ||
+ | | width="265" bgcolor="#87cefa" | Query function that returns the number of agents with a given shape. | ||
+ | | width="131" bgcolor="#87cefa" | agents_with_shape("dead_frog") | ||
+ | | width="347" bgcolor="#87cefa" | returns the number of agents that have a shape with the name "dead_frog" in the simulation.<br> | ||
+ | |- align="left" valign="top" bgcolor="#ffffcc" | ||
+ | | width="92" bgcolor="#87cefa" | agents_of_type(''agent_name'') | ||
+ | | width="265" bgcolor="#87cefa" | Query function that returns the number of agents with a given name. | ||
+ | | width="131" bgcolor="#87cefa" | agents_of_type("frog") | ||
+ | | width="347" bgcolor="#87cefa" | returns the number of "frog" agents in the simulation. | ||
|- align="left" valign="top" bgcolor="#ffffcc" | |- align="left" valign="top" bgcolor="#ffffcc" | ||
| width="80" bgcolor="white" | '''Agent Attribute Access''' | | width="80" bgcolor="white" | '''Agent Attribute Access''' | ||
| width="92" bgcolor="#87cefa" | ''attribute'' | | width="92" bgcolor="#87cefa" | ''attribute'' | ||
− | | width="265" bgcolor="#87cefa" | Access the value of an agent & | + | | width="265" bgcolor="#87cefa" | Access the value of an agent '''attribute'''. An agent can have any number of attributes defined by the user |
| width="131" bgcolor="#87cefa" | Diameter<br> | | width="131" bgcolor="#87cefa" | Diameter<br> | ||
<br> Diameter * 3.14 | <br> Diameter * 3.14 | ||
Line 54: | Line 65: | ||
| width="265" bgcolor="#87cefa" | Access the value of other agents' attribute using relative coordinates.<br> | | width="265" bgcolor="#87cefa" | Access the value of other agents' attribute using relative coordinates.<br> | ||
− | <br> Valid coordinates are up, down, left, right, top and bottom. Coordinates can also be specified numerically as row, column. Valid values for row and column are -1, 0, 1. Positive row values indicates | + | <br> Valid coordinates are up, down, left, right, top and bottom. Coordinates can also be specified numerically as row, column. Valid values for row and column are -1, 0, 1. Positive row values indicates down, positive column indicates right. |
| width="131" bgcolor="#87cefa" | age[left]<br> | | width="131" bgcolor="#87cefa" | age[left]<br> | ||
Line 126: | Line 137: | ||
|} | |} | ||
+ | |||
+ | [[Category:Parameters]] |
Latest revision as of 19:14, 2 May 2017
Visual AgenTalk (VAT) Formula Syntax is used to create VAT formulas. These formulas are very powerful as they allow you to create arbitrarily complex expressions including spatial access to other agents' attributes. This is similar to a spreadsheet but even more powerful.
|