FMT 1.2.0
Forest management tools for forest planning
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | List of all members
Core::FMTYieldModelUnitCoverage Class Reference

Yield model calculating the sum of a yield value over a spatial unit at period 0. More...

#include <FMTYieldModelUnitCoverage.h>

Inheritance diagram for Core::FMTYieldModelUnitCoverage:
[legend]
Collaboration diagram for Core::FMTYieldModelUnitCoverage:
[legend]

Public Member Functions

 FMTYieldModelUnitCoverage (const boost::property_tree::ptree &p_jsonProps, const std::vector< std::string > &p_yields, const Core::FMTMask &p_mask)
 Main constructor for the unit coverage model.
 
const std::vector< double > predict (const Core::FMTYieldRequest &p_request) const
 predict the yields values using this class.
 
std::unique_ptr< FMTYieldModelpreSolve (const FMTMaskFilter &p_filter, const std::vector< FMTTheme > &p_newThemes) const
 If the FMTYieldModelUnitCoverage contains Core classes it also need to be presolved when presolved is called on the FMTModel. By default it will return the same FMTYieldModelUnitCoverage.
 
std::unique_ptr< FMTYieldModelpostSolve (const FMTMaskFilter &p_filter, const std::vector< FMTTheme > &p_baseThemes) const
 Postsolve the yieldmodel by default it will return a clone.
 
std::unique_ptr< FMTYieldModelclone () const
 clone this FMTYieldModel
 
- Public Member Functions inherited from Core::FMTYieldModel
virtual void setModel (Models::FMTModel *p_modelPtr)
 Set the model linked to the yield model.
 
virtual ~FMTYieldModel ()
 Destructor for FMTYieldModel.
 
 FMTYieldModel ()
 Constructor for FMTYieldModel.
 
 FMTYieldModel (const FMTYieldModel &rhs)=default
 Copy constructor for FMTYieldModel.
 
FMTYieldModeloperator= (const FMTYieldModel &rhs)=default
 Default copy assignment operator for FMTYieldModel.
 
const std::string & getModelName () const
 Return the model name.
 
const std::vector< std::string > & getModelYields () const
 Return the model yield names.
 
virtual std::unique_ptr< FMTYieldModelclone () const =0
 clone the yield model.
 
virtual const std::vector< double > predict (const Core::FMTYieldRequest &request) const =0
 Predict the yield for a request.
 
virtual std::unique_ptr< FMTYieldModelpreSolve (const FMTMaskFilter &filter, const std::vector< FMTTheme > &newthemes) const
 Return a presolved copy of the yield model, or the same model by default.
 
virtual std::unique_ptr< FMTYieldModelpostSolve (const FMTMaskFilter &filter, const std::vector< FMTTheme > &basethemes) const
 Return a postsolved copy of the yield model, a clone by default.
 
virtual operator std::string () const
 Return the string representation of the yield model.
 
virtual std::vector< std::vector< double > > getPeriodicValues () const
 Try to turn the yield model into periodic constant values.
 
virtual void clearRandomYieldsCache ()
 Clear the cache of all random yield models.
 
- Public Member Functions inherited from Core::FMTObject
 FMTObject ()
 Default constructor for FMTObject.
 
virtual ~FMTObject ()
 Default virtual destructor for FMTObject.
 
 FMTObject (const std::unique_ptr< Exception::FMTExceptionHandler > exhandler)
 Construct a FMTObject passing in the exception handler of another FMTObject.
 
 FMTObject (const FMTObject &rhs)
 Copy constructor for FMTObject.
 
FMTObjectoperator= (const FMTObject &rhs)
 Copy assignment operator for FMTObject.
 
virtual void passInLogger (const std::unique_ptr< Logging::FMTLogger > &logger)
 Pass in the logger of another FMTObject.
 
void passInExceptionHandler (const std::unique_ptr< Exception::FMTExceptionHandler > &exhandler)
 Pass in the exception handler of another FMTObject.
 
void redirectLogToFile (const std::string &location)
 Redirect the log to a specific file, appending to it.
 
virtual void setDefaultLogger ()
 Create and set a default logger to the FMTObject.
 
virtual void setQuietLogger ()
 Create and set a quiet logger to the FMTObject.
 
virtual void setTaskLogger ()
 Create and set a task logger to the FMTObject.
 
virtual void setDebugLogger ()
 Create and set a debug logger to the FMTObject.
 
void setDefaultExceptionHandler ()
 Create and set a default exception handler to the FMTObject.
 
void setQuietExceptionHandler ()
 Create and set a quiet exception handler to the FMTObject.
 
void setDebugExceptionHandler ()
 Create and set a debug exception handler to the FMTObject.
 
void setFreeExceptionHandler ()
 Create and set a free exception handler to the FMTObject.
 
void disableNestedExceptions ()
 Disable the nested exception throw of the exception handler.
 
void enableNestedExceptions ()
 Enable the nested exception throw of the exception handler.
 
void setErrorsToWarnings (const std::vector< Exception::FMTexc > &errors)
 Set a list of errors to be cast to warnings on the exception handler.
 
void setMaxWarningsBeforeSilenced (const size_t &maxwarningcount)
 Set the number of warnings raised before being silenced.
 
template<class Archive >
void serialize (Archive &ar, const unsigned int version)
 

Static Public Member Functions

static std::string getModelType ()
 Get the model type.
 
- Static Public Member Functions inherited from Core::FMTObject
static Logging::FMTLoggergetLogger ()
 get a pointer to the actual logger.
 
static Exception::FMTExceptionHandlergetExceptionHandler ()
 get a pointer to the actual exception handler.
 
static std::string getRuntimeLocation ()
 Return the location of the FMT shared library.
 
static unsigned long long getAvailableMemory ()
 Return the available memory in bytes.
 
static void setTerminateStack ()
 will write the stack in the log when terminate called and raise a function failed.
 
static void setAbortStack ()
 will write the stack in the log when abort called with SIGABRT and raise a function failed.
 

Additional Inherited Members

- Protected Member Functions inherited from Core::FMTObject
template<class Archive >
void forceSave (Archive &ar, const unsigned int version) const
 Force the serialization to save useful information, which the default FMTObject serialization does not.
 
template<class Archive >
void forceLoad (Archive &ar, const unsigned int version)
 Force the serialization to load useful information, which the default FMTObject serialization does not.
 
void checkSignals () const
 Check if the user has sent a ctrl-c signal using boost::python to FMT.
 
void setCplHandler ()
 Pass the FMT exception handler to the GDAL exception handler (GDAL only).
 
- Static Protected Member Functions inherited from Core::FMTObject
static std::chrono::time_point< std::chrono::high_resolution_clock > getClock ()
 Return a clock of the current time.
 
template<class chrono >
static double getDuration (const std::chrono::time_point< std::chrono::high_resolution_clock > &startclock)
 Return the time elapsed since a start clock as a double.
 
static std::string getDurationInSeconds (const std::chrono::time_point< std::chrono::high_resolution_clock > &startclock)
 Return the time elapsed since a start clock in seconds as a string.
 
static void _logStack ()
 Log the stack trace...
 
static void _terminate ()
 Raise an error with the boost stacktrace.
 
static void _abort (int p_signal)
 Raise an error with the boost stacktrace on abort.
 
- Protected Attributes inherited from Core::FMTYieldModel
std::string m_modelName
 
std::vector< std::string > m_modelYields = {}
 
const std::string m_JSON_PROP_MODEL_NAME = "modelFileName"
 
Models::FMTModelm_modelPtr =nullptr
 
- Static Protected Attributes inherited from Core::FMTObject
static std::unique_ptr< Exception::FMTExceptionHandler_exhandler
 A shared pointer to the exception handler.
 
static std::unique_ptr< Logging::FMTLogger_logger
 A shared pointer to the logger.
 

Detailed Description

Yield model calculating the sum of a yield value over a spatial unit at period 0.

Constructor & Destructor Documentation

◆ FMTYieldModelUnitCoverage()

Core::FMTYieldModelUnitCoverage::FMTYieldModelUnitCoverage ( const boost::property_tree::ptree p_jsonProps,
const std::vector< std::string > &  p_yields,
const Core::FMTMask p_mask 
)

Main constructor for the unit coverage model.

Parameters
[in]p_jsonPropsthe json file
[in]p_yieldsthe input yields
[in]p_maskthe mask of the yields we are looking at.

Member Function Documentation

◆ clone()

std::unique_ptr< FMTYieldModel > Core::FMTYieldModelUnitCoverage::clone ( ) const
virtual

clone this FMTYieldModel

Returns
a cloned FMTYieldModel.

Implements Core::FMTYieldModel.

◆ getModelType()

static std::string Core::FMTYieldModelUnitCoverage::getModelType ( )
static

Get the model type.

Returns
a string of the model type _random.

◆ postSolve()

std::unique_ptr< FMTYieldModel > Core::FMTYieldModelUnitCoverage::postSolve ( const FMTMaskFilter p_filter,
const std::vector< FMTTheme > &  p_baseThemes 
) const
virtual

Postsolve the yieldmodel by default it will return a clone.

Parameters
[in]p_filterthe mask filter to apply.
[in]p_baseThemesthe non presolved themes.
Returns
a pointer to a postsolved FMTYieldModel.

Reimplemented from Core::FMTYieldModel.

◆ predict()

const std::vector< double > Core::FMTYieldModelUnitCoverage::predict ( const Core::FMTYieldRequest p_request) const
virtual

predict the yields values using this class.

Parameters
[in]p_requesta valid FMTYieldRequest.
Returns
calculate the sum of each yields throught the spatial unit.

Implements Core::FMTYieldModel.

◆ preSolve()

std::unique_ptr< FMTYieldModel > Core::FMTYieldModelUnitCoverage::preSolve ( const FMTMaskFilter p_filter,
const std::vector< FMTTheme > &  p_newThemes 
) const
virtual

If the FMTYieldModelUnitCoverage contains Core classes it also need to be presolved when presolved is called on the FMTModel. By default it will return the same FMTYieldModelUnitCoverage.

Parameters
[in]p_filterthe mask filter to apply.
[in]p_newThemesthe new themes of the presolved model.
Returns
a pointer to a presolved FMTYieldModel.

Reimplemented from Core::FMTYieldModel.


The documentation for this class was generated from the following file: