Help - Difference between revisions of "User Expressions"

From TTA Help System
Line 56: Line 56:
 
     <td class="default">[[Image:NoSymbol.png]]</td>
 
     <td class="default">[[Image:NoSymbol.png]]</td>
 
     <td class="default">[[Image:NoSymbol.png]]</td>
 
     <td class="default">[[Image:NoSymbol.png]]</td>
     <td class="default"><code>getValue(LENGTH) / 2</code></td>
+
     <td class="default"><code>treeUserValue("someValue") / 2</code></td>
 
   </tr>
 
   </tr>
 
   <tr class="default">
 
   <tr class="default">
Line 64: Line 64:
 
     <td class="default">[[Image:NoSymbol.png]]</td>
 
     <td class="default">[[Image:NoSymbol.png]]</td>
 
     <td class="default">[[Image:NoSymbol.png]]</td>
 
     <td class="default">[[Image:NoSymbol.png]]</td>
     <td class="default"><code>getValue("id1") * 100</code></td>
+
     <td class="default"><code>treeUserValue("someValue") * 100</code></td>
 
   </tr>
 
   </tr>
 
   <tr class="default">
 
   <tr class="default">
Line 73: Line 73:
 
     <td class="default">[[Image:NoSymbol.png]]</td>
 
     <td class="default">[[Image:NoSymbol.png]]</td>
 
     <td class="default">
 
     <td class="default">
       <div><code>getValue("id1") + 10</code></div>
+
       <div><code>treeUserValue("someValue") + 10</code></div>
 
       <div><code>"Two " + "words"</code></div>
 
       <div><code>"Two " + "words"</code></div>
 
     </td>
 
     </td>

Revision as of 15:01, 7 October 2020

In Topological Tree Analyszer user-defined expressions are used to calculate the actual data (e.g., distances between trees) from basic topological values. A set of functions is available to formulate such expressions and to access the basic values. An unlimited number of user expressions can be defined and will be written to a results table at the end of an analysis. It is also possible to reference results from one user expression from another one and reuse the result there.

Functions to access basic topological values

Functions to access results of other expressions

Operators

The following list contains all valid operators. Each operator binds as strong or more than all operators listed below. The right columns indicate which types the operands need to have.

Name: Operator: Numeric: Textual: Boolean: Example:
Power ^ YesSymbol.png NoSymbol.png NoSymbol.png 10^-2 (= 0.02)
Unary plus + YesSymbol.png NoSymbol.png NoSymbol.png +4
Unary minus - YesSymbol.png NoSymbol.png NoSymbol.png -4
Modulo % YesSymbol.png NoSymbol.png NoSymbol.png 10 % 4 (= 2)
Division / YesSymbol.png NoSymbol.png NoSymbol.png treeUserValue("someValue") / 2
Multiplication * YesSymbol.png NoSymbol.png NoSymbol.png treeUserValue("someValue") * 100
Addition + YesSymbol.png YesSymbol.png NoSymbol.png
treeUserValue("someValue") + 10
"Two " + "words"
Less or equal <= YesSymbol.png NoSymbol.png NoSymbol.png if(treeUserValue("someValue") <= 100, treeUserValue("someValue"), 100)
Greater or equal >= YesSymbol.png NoSymbol.png NoSymbol.png if(treeUserValue("someValue") <= 100, "A", "B")
Less then < YesSymbol.png NoSymbol.png NoSymbol.png if(treeUserValue("someValue") < 100, treeUserValue("someValue"), 100)
Greater then > YesSymbol.png NoSymbol.png NoSymbol.png if(treeUserValue("someValue") < 100, "A", "B")
Equal = YesSymbol.png YesSymbol.png NoSymbol.png if(treeUserValue("value1") = 100, treeUserValue("value2"), treeUserValue("value3"))
Not equal != YesSymbol.png YesSymbol.png NoSymbol.png if(treeUserValue("value1") != "empty", treeUserValue("value2"), 0)
And && NoSymbol.png NoSymbol.png YesSymbol.png if(treeUserValue("value1") < 100 && treeUserValue("value1") > 50, treeUserValue("value2"), "")
Or || NoSymbol.png NoSymbol.png YesSymbol.png if(treeUserValue("value1") < 100 || treeUserValue("value2") < 100, treeUserValue("value3"), "undefined")

Text functions

General mathematical functions

General constants