Show:
Defined in: ABE\abe_stand.js:1
Module: ABE

Access to properties of the current stand. The stand variable is available in the execution context of forest management and provides access to properties and functions of the stand that is currently processed.

Note that the variable stand is provided through the C++ framework and does not need to be created separately.

Use the 'flag' and 'setFlag' methods to (persistently) modify / read user-specific properties for each stand. This is a means to pass stand-specific information between activities (or between different events within one activity).

Methods

activity

(
  • activity_name
)
Activity

Use activity to retrieve an Activity object.

Note: the global variable activity is a "short-cut" to access the currently active activity.

  stand.activity("my_thinning_2").enabled = false; // disable an activity
                      var act = stand.activity("my_thinning_1"); // save a reference to the activity for later use
                    

See also: the global variable activity

Parameters:

  • activity_name String

    The name of the activity to be retrieved. Activity names are provided during activity definition (see fmengine.addManagement)

Returns:

Activity:

the Activity, or undefined if not found.

flag

(
  • name
)

Retrieves the stand-specific property associated with the name 'name' for the stand of the current execution context.

  stand.setFlag('test', 3); // simple values
                      stand.setFlag('my_goal', { s1: 10, s2: 20, s3: function(){return this.s1+this.s2;} } ); // complex objects (including functions are allowed)
                    
                      fmengine.log( stand.flag('my_goal').s3 + stand.flag('test') + stand.U  ); // -> 133 (if U=100 of the stand)

Parameters:

  • name String

    The (user-defined) property name of the stored parameter.

reload

()

Force a reload of the stand data, i.e. fetch stand statistics (e.g. basal area, age) from the trees comprising the stand.

Usually, this is done automatically by ABE, however, it might be useful in some rare circumstances.

relSpeciesBasalArea

(
  • index
)

Retrieve the basal area share (0..1) of the species at position index.

// get the share of the dominant species:
                    log( stand.relSpeciesBasalArea(0) * 100 + "%");

Parameters:

  • index Integer

    The index of the species (valid between 0 and nspecies-1).

relSpeciesBasalAreaOf

(
  • speciescode
)

Retrieve the relative basal area of the species 'speciescode'.

Parameters:

  • speciescode String

    The code of the species (e.g., 'piab').

setFlag

(
  • name
  • value
)

Sets 'value' as the stand-specific property associated with the name 'name' for the stand of the current execution context.

Parameters:

  • name String

    The (user-defined) property name of the stored parameter.

  • value Value

    The value that should be stored for 'name'. 'value' can be any valid Javascript expression (including objects).

sleep

(
  • years
)

The ┬┤sleep┬┤ method suspends the activities on the stand for years years. Only after the specified has elapsed, ABE continues to examine the stand.

Parameters:

  • years Integer

    The number of years that the stand should sleep.

speciesBasalArea

(
  • index
)

Retrieve the basal area of the species at position index.

Parameters:

  • index Integer

    The index of the species (valid between 0 and nspecies-1).

speciesBasalAreaOf

(
  • speciescode
)

Retrieve the basal area of the species with the species code 'speciescode'. Note that only trees with height > 4m are included.

Parameters:

  • speciescode String

    The code of the species (e.g., 'piab').

speciesId

(
  • index
)

Retrieve the species id at position index.

Parameters:

  • index Integer

    The index of the species (valid between 0 and nspecies-1).

Properties

absoluteAge

Double

Defined in ABE\abe_stand.js:82

The age of the stand given in years since the rotation started. At startup, the absoluteAge is estimated from the age of the stand (i.e. the mean age of the initialized trees). Later, the stand age counter is reset by management activities. Note that this property is writable.

See also age.

age

Double

Defined in ABE\abe_stand.js:72

The mean age of the stand (years). It is calculated as basal area weighted mean age of all trees on the stand (>4m). Note the difference to absoluteAge, which is the number of years since the rotation started.

See also absoluteAge.

area

Double

The total area of the stand in hectares.

basalArea

Double

Defined in ABE\abe_stand.js:41

The basal area / ha stocking on the stand (living trees, >4m).

elapsed

Int

The number of years since the execution of the last activity for the current stand. Value is -1 if no activity was executed previously.

height

Double

Defined in ABE\abe_stand.js:56

The mean height of the stand (meter). It is calculated as basal area weighted mean height of all trees on the stand (>4m). See also topHeight.

id

Integer

Defined in ABE\abe_stand.js:31

The id of the stand that is currently processed.

See also: standId in fmengine.

Default: -1

lastActivity

String

The name of the last previously executed activity, or an empty string if no activity was executed before. The name can be used to access properties of the activity.

     if (stand.lastActivity == "thinning1")
                              stand.activity( stand.lastActivity ).enabled = true; // re-enable last activity if it was 'thinning1'

nspecies

Int

Defined in ABE\abe_stand.js:93

The number of different tree species present on the stand (trees >4m). Use to iterate over the available species on the stand:

  // print the species id and the basal area for each available species.
                      // note that the species are ordered by the basal area share.
                      for (var i=0;i<stand.nspecies;++i)
                          log(stand.speciesId(i) + ": " + stand.speciesBasalArea(i));

topHeight

Double

Defined in ABE\abe_stand.js:64

The top height (in meters) is defined as the mean height of the 100 thickest trees per ha. For larger/ smaller stands, the number of trees is scaled accordingly. See also height.

trace

Boolean

Defined in ABE\abe_stand.js:15

If trace is set to true, detailed log information is produced by ABE. This is useful for testing/ debugging. The trace-mode can be switched on/ off like this:

  // enable trace for stand 7
                      fmengine.standId = 7; // set the current stand to the stand with Id 7
                      stand.trace = true; // enable trace
                    

See also: verbose

Default: false

U

Double

The rotation length of the current stand. The rotation length is defined by the stand treatment programme that is currently assigned to a given stand. The 'U' is frequently used for timing activites relative to the length of the period.

volume

Double

Defined in ABE\abe_stand.js:49

The total standing timber volume / ha of the stand (living trees, >4m).