FMT 1.2.0
Forest management tools for forest planning
Loading...
Searching...
No Matches
FMTSesModel.h
Go to the documentation of this file.
1/*
2Copyright (c) 2019 Gouvernement du Québec
3
4SPDX-License-Identifier: LiLiQ-R-1.1
5License-Filename: LICENSES/EN/LiLiQ-R11unicode.txt
6*/
7
8#ifndef FMTSESM_Hm_included
9#define FMTSESM_Hm_included
10
11#include "FMTSeModel.h"
12#include <boost/serialization/vector.hpp>
13#include <boost/serialization/serialization.hpp>
14#include <boost/serialization/nvp.hpp>
15#include <boost/serialization/export.hpp>
16
17namespace Models
18{
19// DocString: FMTSesModel
24class FMTEXPORT FMTSesModel final: public FMTSeModel
25 {
26 // DocString: FMTSesModel::Serialize
33 friend class boost::serialization::access;
34 template<class Archive>
35 void serialize(Archive& ar, const unsigned int version)
36 {
37 ar & boost::serialization::make_nvp("semodel", boost::serialization::base_object<FMTSeModel>(*this));
38 }
39 // DocString: FMTSesModel::swapPtr
44 virtual void swapPtr(std::unique_ptr<FMTModel>& rhs);
45 // DocString: FMTSesModel()
50 FMTSesModel(const FMTSeModel& rhs);
51 public:
52 // DocString: FMTSesModel()
56 FMTSesModel() = default;
57 // DocString: ~FMTSesModel()
61 ~FMTSesModel() = default;
62 // DocString: FMTSesModel(const FMTSesModel)
67 FMTSesModel(const FMTSesModel& rhs)=default;
68 // DocString: FMTSesModel(const FMTModel)
73 FMTSesModel(const FMTModel& rhs);
74 // DocString: FMTSesModel(const FMTModel)
80 FMTSesModel(const FMTModel& rhs, const Spatial::FMTForest& forest);
81 // DocString: FMTSesModel::operator=
87 FMTSesModel& operator = (const FMTSesModel& rhs)=default;
88 // DocString: FMTSesModel(FMTSesModel&&)
93 FMTSesModel(FMTSesModel&& rhs)=default;
94 // DocString: FMTSesModel::operator=(FMTSesModel&& rhs)
100 FMTSesModel& operator =(FMTSesModel&& rhs) =default;
101 // DocString: FMTSesModel::getDisturbanceStats
106 std::string getDisturbanceStats() const;
107 // DocString: FMTSesModel::greedyReferenceBuild
116 std::map<std::string, double> greedyReferenceBuild(
117 const Core::FMTSchedule& p_schedule,
118 size_t p_randomIterations,
119 int p_seed = 0,
120 double p_tolerance = FMT_DBL_TOLERANCE);
121 // DocString: FMTSesModel::clone
126 virtual std::unique_ptr<FMTModel>clone() const;
127 // DocString: FMTSesModel::build
133 virtual bool build(std::vector<Core::FMTSchedule> schedules=std::vector<Core::FMTSchedule>());
134 // DocString: FMTSesModel::solve
139 virtual bool solve()
140 {
141 return true;
142 }
143 // DocString: FMTSesModel::preSolve
149 virtual std::unique_ptr<FMTModel>preSolve(std::vector<Core::FMTActualDevelopment> optionaldevelopments = std::vector<Core::FMTActualDevelopment>()) const;
150 // DocString: FMTSesModel::getCopy
156 virtual std::unique_ptr<FMTModel> getCopy(int period = 0) const;
157 };
158
159}
160
161BOOST_CLASS_EXPORT_KEY(Models::FMTSesModel)
162
163#endif // FMTSESM_Hm_included
#define FMT_DBL_TOLERANCE
Definition: FMTutility.h:11
#define FMTEXPORT
Definition: FMTutility.h:125
Spatially referenced schedule describing the area of developments for which an action can be operated...
Definition: FMTSchedule.h:29
Base class for the different models in FMT.
Definition: FMTModel.h:62
Abstract class for spatially explicit models, parent of FMTSesModel and FMTSaModel.
Definition: FMTSeModel.h:33
Spatially explicit simulation model using a cellular automaton to simulate actions on a raster stack ...
Definition: FMTSesModel.h:25
virtual std::unique_ptr< FMTModel > getCopy(int period=0) const
Return a copy of the model for the selected period.
FMTSesModel()=default
Default constructor for FMTSesModel.
std::string getDisturbanceStats() const
Return a string of patch statistics (area, perimeter) of the disturbances stack.
virtual bool solve()
Return true; there is no solve since this is a simulation.
Definition: FMTSesModel.h:139
~FMTSesModel()=default
Default destructor for FMTSesModel.
FMTSesModel(const FMTModel &rhs)
Construct a FMTSesModel from a FMTModel.
FMTSesModel(const FMTSesModel &rhs)=default
Copy constructor for FMTSesModel.
FMTSesModel(FMTSesModel &&rhs)=default
Default move constructor for FMTSesModel.
virtual std::unique_ptr< FMTModel > preSolve(std::vector< Core::FMTActualDevelopment > optionaldevelopments=std::vector< Core::FMTActualDevelopment >()) const
Return a presolved copy of the model.
FMTSesModel(const FMTModel &rhs, const Spatial::FMTForest &forest)
Construct a FMTSesModel from a FMTModel and a forest.
virtual bool build(std::vector< Core::FMTSchedule > schedules=std::vector< Core::FMTSchedule >())
Build the model by calling greedyReferenceBuild over the number of periods set as LENGTH.
virtual std::unique_ptr< FMTModel > clone() const
Get a clone of the FMTSesModel.
std::map< std::string, double > greedyReferenceBuild(const Core::FMTSchedule &p_schedule, size_t p_randomIterations, int p_seed=0, double p_tolerance=FMT_DBL_TOLERANCE)
Find the best spatialization for a schedule using random draws over several iterations.
Spatially referenced layer of Core::FMTDevelopment representing the forest.
Definition: FMTForest.h:33
Namespace containing all enumerator and classes used to construct or manipulate the different type of...
Definition: FMTAreaParser.h:54