Name

assign — temporarily assigns values to fields

Synopsis

Content Model

	    <assign> = EMPTY
	    

Attributes

NameTypeDefault
fieldfield name previously defined in ForestModel Required
valueThe value to be temporarily assigned to the field, single value or list (array) Required

Description

The <assign> element alters the value of a stratification value created by a <define> element. When a stand record with matching stratum values enters a selection that contains an <assign> section, then the field will be updated accordingly before processing continues. This allows strata values to change in response to model parameters, for example to change the forest unit after a silvicultural treatment.

The assign element may be present in retention, treatment and succession elements, and used to change the stratification values of the forest stand.

Parents

These elements contain assign: produce, retention, transition, succession .

Children

No elements occur in assign (empty element).

Attributes

field

The field attribute identifies the predefined field that is being assigned the value. The field attribute must match the field attribute in the <define> element.

value

The value attribute is an expression that uses any combination of literals and fields.

See Also

define.

Examples

  <select statement="MU = 'unit' and FUSUCCN = 'SB1' and SILVINT eq 'Basc2'">
    <succession breakup="165" renew="55">
      <assign field="FUSUCCN" value="SB1" />
      <assign field="SILVINT" value="Exten" />
    </succession>
  </select>
	  

A common use of the assign element is within succession select statements. When a succession event occurs the characteristics of the forest stand change. An assign tag can be used to change particular fields of the inventory record to signify this change. In our example, a Bascic 2 SB1 stand succeeds to a 55 year old SB1 stand with Extensive characteristics at age 165.

 <select statement="MU eq 'RMF' and FU eq 'BW1' and IFM in managed and SILVINT eq 'Exten'">
    <track>
      <treatment label="Exten" minage="60" maxage="140">
        <produce>
          <assign field="treatment" value="'Exten'" />
        </produce>
        <transition>
          <assign field="FUSUCCN" value="'BW1'" />
        </transition>
      </treatment>
    </track>
  </select>
	    

Other instances of the assign tag occur in the track section of the XML file. Like succession, the characteristics of the stand change when a management treatment is applied. The <transition> element is used to change the stand characteristics after a treatment using an assign element.

Notice in the above example that assign has been used in a <produce> element as well. This is where values are temporarily assigned to the empty 'helper' variables defined at the beginning of the XML file. The helper variable 'treatment' was defined earlier and left 'empty'. Now it can be assigned the treatment type temporarily, essentially appending a new field to the inventory record so the appropriate products can be found for that treatment and stand type.