Heureka API .NET Documentation
Example: Activate extraction of harvest residues

By default, no harvest residues (GROT) are extacted after harvest operations. You can active this seperately for final fellings, thinnings, and selection fellings. A default requirement for extraction is that the spruce proportion is at least 60 %, but this can also be changed.

Prerequisite: A price list has been added

Active extraction of harvest residues (GROT)
Copy Code
// Active extraction of harvest residues in final fellings, and lower the spruce proportion criteria to 50 %.
var gc = new GrowthCalculator();
gc.GetControlTable<TpgControlTable>().ForestFuelExtractionFinalFelling = true; 
gc.GetControlTable<TreatmentModelControlTable>().Restrictions.MinSpruce = 0.5;

// Add final felling treatment to first period
var trmtList = new ApiTreatmentList(compartment);
trmtList.AddTreatment(TreatmentType.FinalFelling, startDate);

// Run growth projection
compartment.Grow(trmtList, toDate);

// Access results by calling ApiCompartment with the beforeTreatment argument set to false.
// The ValueData property is the same as the Financial Value Results described on the Heureka wiki.
var result = compartment.GetState(startDate, beforeTreatment:false).ValueData;
var grot = result.HarvestResidueUtilized, valueData.HarvestResidueUtilized); // ton dry-matter per hectare