planting Class
planting\planting.js:2
The planting library includes management operations related to artificial and natural regeneration.
Commonalities....
Methods
dynamic
-
options
Dynamically schedules planting activities based on provided options.
Parameters:
-
options
ObjectOptions for configuring the dynamic planting.
-
id
StringA unique identifier for the planting activity (default: 'planting').
-
schedule
ScheduleThe planting schedule.
-
speciesSelectivity
Object | FunctionDefines the target species and their relative weights. This can be an object with species as keys and weights as values, or a function that returns such an object.
-
speciesDefaults
ObjectDefault settings for species (default: lib.planting.speciesDefaults).
-
patches
Stringshould planting should happen only on some selected patches (default: undefined).
-
sendSignal
String | Undefinedsignal send out after final femel harvest activity (default: undefined).
-
constraint
String | Undefinedconstraint (default: undefined).
-
general
-
options
Schedules a general planting activity.
Parameters:
-
options
ObjectOptions for configuring the general planting.
-
id
StringA unique identifier for the activity (default: 'planting').
-
schedule
NumberThe planting schedule (default: 1).
-
species
StringThe species to plant. Mandatory.
-
spacing
NumberThe spacing between plants (default: 10).
-
fraction
NumberThe fraction of the area to be planted (default: 1).
-
treeHeight
NumberInitial tree height (default: 0.3).
-
pattern
String | UndefinedPlanting pattern (e.g., "rect2"). (default: undefined).
-
clear
BooleanWhether to clear existing vegetation before planting (default: false).
-
sendSignal
String | Undefinedsignal send after planting activity (default: undefined).
-
constraint
String | Undefinedconstraint (default: undefined).
-
Example:
// NOTE: lib.planting is an object, not a class. No need to use 'new'
lib.planting.general({
schedule: 2,
species: 'Pine',
spacing: 12,
pattern: 'rect'
});
Properties
speciesDefaults
Object
Default planting settings for various species.
Example:
// Accessing default settings for 'piab' (spruce)
const spruceDefaults = lib.planting.speciesDefaults.piab;
console.log(spruceDefaults);
// Output: { species: 'piab', h: 0.3, age: 1, fraction: [Function] }