Bureau-du-Forestier-en-chef / FMT

Forest Management Tool a C++ library for forest planning.

Home Page:https://bureau-du-forestier-en-chef.github.io/FMTdocs/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

FMT (Forest Management Tool)





This page provides only an overview of the installation process and features of FMT. For more details, visit our documentation page here.

πŸ“‘ Description

FMT (Forest Management Tool) is an open source Forest Management library.

  • It is a C++ library made to interpret forest planning models based on the Woodstock files formulation.
  • It can be used through Python, Cran-R or directly from C++.
  • It's generic approach to forest planning gives the opportunity to the user to manipulate forest planning models and generate forest planning solutions.
  • It's objective is to bring all forest planning models types onto the same generic library to help the community to develop new approaches to forest planning problems or improve the one that have been there for years.

✨ Features

Spatially referenced forest planning

FMT allows the user to generate and solve spatially referenced type III forest planning model problems. The tool can be used to do sensitivity analyses over multiple parameters of the forest planning model. It can also be used for analysing impacts of stochastic events such as fire or spruce budworm using Replanning.

Spatially explicit forest planning

FMT gives a framework to construct heuristics to solve forest planning model. FMT is the perfect tool to solve user specific problems related to forest planning like operating area scheduling. It can also be used to implement simple simulation process. The library offers some tools to spatialize spatially referenced solutions or to generate spatially explicit solutions.

FMT is extremely usefull when it comes to implement metaheuristics such as Simulated Annealing, Genetic or Tabu Search into a forest planning context.

If your main inputs are Woodstock files, FMT is probably the way to go to develop new approaches for optimization or simulation of harvest schedules or even stochastic events.

πŸ’½ Installation

The easiest way to use FMT is to use Cmake >= 3.15 to generate a shared library for R or Python, or directly from C++. The Cmake script of this repository supports generating FMT on Windows using VS2017/2019 or MINGW-64 on MSYS2 or CYGWIN.





πŸ“¦ Dependencies

Required :

Optional :

πŸ“– Documentation

FMT has a handwritten extensive documentation with exercises and examples, along with a doxygen-generated documentation that are both available on the FMT documentation webpage.





If you want to compile the doxygen documentation by yourself, with a powershell prompt, go into the FMT folder and use:

 cd Documentation
 doxygen FMTdoxygenconfig

To populate comments in R and Python source files (files starting with R and PY):

 cd Documentation
 python commentsPythonandR.py

πŸ‘‰ Examples

Here's a short example for reading a forest planning model and solve the type III Linear programming formulation.

  • Using Python
from FMT import Models
from FMT import Parser

modelparser = Parser.FMTmodelparser()
models = modelparser.readproject("pathtoprimaryfile",["scenariox"])#read scenario x from the primay file (.pri)
optimizationmodel=Models.FMTlpmodel(models[0],Models.FMTsolverinterface.CLP)#Construct a type III linear programming model from the FMTmodel

###Build the graph for 10 periods
for period in range(0,10):
      print(optimizationmodel.buildperiod())

#Now add objective function to the FMTlpmodel and all the constraints
constraints = optimizationmodel.getconstraints()
objective = constraints.pop(0)
for constraint in constraints:
  print(optimizationmodel.setconstraint(constraint))
print(optimizationmodel.setobjective(objective))
#Do a initial solve of the forest planning model
optimizationmodel.initialsolve()
  • Using R
library(FMT)
modelparser<-new(FMTmodelparser)
models<-modelparser$readproject("pathtoprimaryfile",c("scenariox"),TRUE,TRUE,TRUE)#read scenario x from the primay file (.pri)
optimizationmodel<-new(FMTlpmodel,models[[1]],FMTsolverinterface$CLP)#Construct a type III linear programming model from the FMTmodel
emptyschedule<-new(FMTschedule)
#Build the graph for 10 periods
for (period in 1:10)
   {
   print(optimizationmodel$buildperiod(emptyschedule,FALSE)$str())
   }
#Now add objective function to the FMTlpmodel and all the constraints
allmodelconstraints<-optimizationmodel$getconstraints()
modelobjective<-allmodelconstraints[[1]]
modelconstraints<-allmodelconstraints[2:length(allmodelconstraints)]
for (constraint in modelconstraints)
   {
   print(optimizationmodel$setconstraint(constraint)$str())
   }
print(optimizationmodel$setobjective(modelobjective)$str())
#Do a initial solve of the forest planning model
optimizationmodel$initialsolve()
  • Using C++
#include <vector>
#include "FMTlpmodel.hpp"
#include "FMTmodelparser.hpp"

Parser::FMTmodelparser modelparser;
const std::vector<std::string>scenarios(1, "scenariox");
const std::vector<Models::FMTmodel> models = modelparser.readproject("pathtoprimaryfile", scenarios);
Models::FMTlpmodel optimizationmodel(models.at(0), Models::FMTsolverinterface::MOSEK);
for (size_t period = 0; period < 10; ++period)
	{
	optimizationmodel.buildperiod();
	}
std::vector<Core::FMTconstraint>constraints = optimizationmodel.getconstraints();
const Core::FMTconstraint objective = constraints.at(0);
constraints.erase(constraints.begin());
for (const Core::FMTconstraint& constraint : constraints)
	{
	optimizationmodel.setconstraint(constraint);
	}
optimizationmodel.setobjective(objective);
optimizationmodel.initialsolve();

πŸ”‘ License

FMT is a LiLiQ-R 1.1 licensed library.

License

πŸ“ˆ Coverage

GNU MSVC

πŸ’» Build

GNU MSVC

About

Forest Management Tool a C++ library for forest planning.

https://bureau-du-forestier-en-chef.github.io/FMTdocs/


Languages

Language:C++ 96.8%Language:CMake 2.6%Language:Objective-C 0.2%Language:Batchfile 0.2%Language:Shell 0.1%Language:Python 0.1%Language:R 0.0%Language:C 0.0%