This management scheme aims at a situation characterized by:
- parallel simulation of independent stands with a size of one hectare each
- a specific yield table management is defined for each hectare
- the management simply controls the stem numbers
A brief explanation of the function is provided below. But here is the code itself:
Loading the data
The function load() loads the content from a tabular textfile and stores it in a simple datastructure. It uses the CSVFile object which is actually a binding to a C++ class of iLand.
The input table should have three columns: the index-number of the resource unit, a year and the number of trees that should remain after the management operation. Note that the resource unit index is 0-based, and that the first simulation year is year 1.
A sample file looks like:
## sample file for the management definition ## use either tab or ; as delimiter ## ***************************************** resourceUnitIndex year remaining 0 1 5000 0 10 4000 0 20 2500 0 30 1800 0 40 900 0 50 500 1 1 250 1 10 200 1 20 150 1 30 100 1 40 50 1 50 10 2 1 5000 2 10 3456 2 20 2333 2 30 1789 2 40 852 2 50 400
The manage() function deals with the actual management. If called the first time, load() is called and the data is setup.
The real work starts with looping through all resource units of the system (using the model variable Globals.resourceUnitCount). For each unit the function checks if a entry is present in the mgmt_list object.
If no data is present for the combination of year and resource unit, nothing happens.
Otherwise, the actual management is performed: the current number of trees of the resource unit is compared with the target number; the surplus number of trees is then removed.