Name

expression — A simple linear equation that describes the vertices that make up time series data

Synopsis

Content Model

No content allowed
      

Attributes

NameTypeDefault
statementThe expression defined using the Patchworks query languageRequired
fromThe lowest independent value used for interpolation0
toThe highest independent value used for interpolation300
byThe step sized used to increment the independent value for interpolation5
thinA parameter to the line thinning algorithm to reduce interior points.0.0001
ignoreMissingAttributesA flag to indicate if missing attributes in the expression should be treated as a zero (true) or raise an error (false).false

Description

Curve values may also be specified as simple linear equations. The Matrix Builder will evaluate these equations as it is building the tracks dataset. The equations may refer to other curves or attributes, and may involve standard mathematical operations.

The expressions are stated using the Patchworks Query Language. Several functions provide access to previously defined curve and attribute values.

The curveid() function returns a reference to a curve by its curve idref value. The attributeid() function returns a reference to a attribute by the attrribute idref value.

The attribute() function returns a reference to an attribute by its label value. The label will be used to dynamically look up the attribute in the context of the stand that is currently being processed.

There are a number of other functions that operate on curves: lookupcurve(), shiftcurve(), curve(), offset(), operable(). These functions and others are described in the Patchworks Query Language.

The curve is constructed by evaluating the expression over the domain of "from" value to the "to" value. The domain is sampled by incrementing by the "by" value. At each sampled point the expression value is computed and added to the curve.

Parents

These elements contain expression: attribute .

Children

Expressions are empty elements that contain no other content.

Attributes

statement

An expression formed using the Patchworks Query Language.

from

A value representing the lower end of the domain of values making up the curve.

to

A value representing the upper end of the domain of values making up the curve.

by

A value representing the increment used to step through from the "from" value to the "to" value.

ignoreMissingAttributes

Complex expressions may contain subexpressions that refer to other attributes. It may occur that the referenced attribute cannot be resolved (looked up) for a particular block. The default action when this happens is that the matirx builder will throw an exception. This attribute can be used to turn the exception checking off. In this case the sub-expression will be replaced with a zero value.

See Also

attribute , curve

Examples

In the following example volume attributes have already been partially assigned. The operable function returns the specified attribute value during ages when the stand is eligible for harvest, and zero otherwise. The from, to and step values used to sample the curvev are taken as default. The expression is evaluated at each interpolation point, and a new curve is generated.

  <select statement="theme2 in T2_MANAGED and theme6 = 'NAT'">
    <features>
      <attribute label="%f.Opgs.%m.soft">
        <expression statement="operable(attribute('%f.Yield.%m.yConpulpv'))" />
      </attribute>
      <attribute label="%f.Opgs.%m.hard">
        <expression statement="operable(attribute('%f.Yield.%m.yHardpulpv'))" />
      </attribute>
    </features>
  </select>
    

In the following example several previously defined attributes are multiplied by factors and added together. The 'ignoreMissingAttributes' flag specifies that if the attribute lookup should fail then the sub-expression should return a value of 0. If this was not specified, a missing attribute definition would cause the Matrix Builder application to halt with an error message.

  <attribute id="1:?:?:WEST:?:?:?:%f.ECA.%m.ECAPer" label="%f.ECA.%m.ECAPer">
    <expression statement="attribute('%f.attr.%m.AG_ECA') * 0.55 + 
          attribute('%f.attr.%m.AM_ECA') * 0.43 + attribute('%f.attr.%m.AF_ECA') * 0.02" 
       ignoreMissingAttributes="true"/>
  </attribute>
    

In the following example several previously defined attributes are divided to compute a ratio. In cases where the denominator is zero a result of 0 is produced. The 'ignoreMissingAttributes' flag specifies that if the attribute lookup should fail then the sub-expression should return a value of 0. If this was not specified, a missing attribute definition would cause the Matrix Builder application to halt with an error message.

  <select>
    <products>
      <attribute label="%f.Output.%m.HV_HSMP" output="false">
        <expression statement="attribute('%f.Output.%m.HV_HSM')/attribute('%f.Output.%m.HV_HWV')" 
        ignoreMissingAttributes="true"/>
      </attribute>
    </products>
  </select>