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

Child class of FMTDevelopment representing an actual forest stand, holding the area of the stand. More...

#include <FMTActualDevelopment.h>

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

Public Member Functions

 FMTActualDevelopment (FMTActualDevelopment &&rhs)
 Move copy constructor.
 
FMTActualDevelopmentoperator= (FMTActualDevelopment &&rhs)
 Move assignment operator for FMTActualDevelopment.
 
 FMTActualDevelopment ()
 Default constructor for FMTActualDevelopment.
 
 ~FMTActualDevelopment ()=default
 Default destructor for FMTActualDevelopment.
 
 FMTActualDevelopment (const FMTActualDevelopment &rhs)
 Copy constructor for FMTActualDevelopment.
 
 FMTActualDevelopment (const FMTMask &mask, const int &age, const int &lock, const double &area)
 Construct an actual development from a mask, an age, a lock level and an area.
 
 FMTActualDevelopment (const FMTDevelopment &rhs, double larea)
 Construct an actual development from a development and an area.
 
FMTActualDevelopmentoperator= (const FMTActualDevelopment &rhs)
 Copy assignment operator for FMTActualDevelopment.
 
bool operator== (const FMTActualDevelopment &rhs) const
 Equality comparison operator of FMTActualDevelopment.
 
bool operator!= (const FMTActualDevelopment &rhs) const
 Inequality comparison operator of FMTActualDevelopment.
 
bool operator< (const FMTActualDevelopment &rhs) const
 Less than comparison operator of FMTActualDevelopment.
 
 operator std::string () const override
 Return the string representation of the actual development as in the area section.
 
double getArea () const override
 Return the area of the actual development.
 
void setArea (const double &newarea)
 Set the area of the actual development.
 
std::unique_ptr< FMTDevelopmentclone () const override
 Return a unique pointer of FMTDevelopment cloning the actual development.
 
FMTActualDevelopment preSolve (const FMTMaskFilter &filter, const std::vector< FMTTheme > &presolvedthemes) const
 Presolve the actual development using the FMTDevelopment preSolve function.
 
FMTActualDevelopment reduceLockToDeath (const FMTLifespans &lifespans) const
 Reduce the lock of the actual development to its lifespan if the lifespan is shorter than the lock.
 
- Public Member Functions inherited from Core::FMTDevelopment
 FMTDevelopment (FMTDevelopment &&rhs)
 Move copy constructor.
 
FMTDevelopmentoperator= (FMTDevelopment &&rhs)
 Move assignment operator for FMTDevelopment.
 
int getAge () const
 Get the age of the development.
 
uint8_t getShortAge () const
 Get the age of the development as a short int.
 
int getLock () const
 Get the lock of the development.
 
int getPeriod () const
 Get the period of the development.
 
const Core::FMTMaskgetMask () const
 Get a const reference to the mask of the development.
 
Core::FMTMask getMaskCopy () const
 Get a copy of the mask of the development.
 
void setAge (const int &lage)
 Set the age of the development.
 
void setLock (const int &llock)
 Set the lock of the development.
 
void setPeriod (const int &lperiod)
 Set the period of the development.
 
void setMask (const Core::FMTMask &p_mask)
 Set the mask of the development.
 
 FMTDevelopment ()
 Default constructor for FMTDevelopment.
 
virtual ~FMTDevelopment ()=default
 Default virtual destructor for FMTDevelopment.
 
 FMTDevelopment (const FMTMask &p_mask, const int &p_age, const int &p_lock)
 Construct a development from a mask, an age and a lock level.
 
 FMTDevelopment (const FMTMask &p_mask, const int &p_age, const int &p_lock, const int &p_period)
 Construct a development from a mask, an age, a lock level and a period.
 
 FMTDevelopment (const FMTDevelopment &rhs)
 Copy constructor for FMTDevelopment.
 
virtual std::unique_ptr< FMTDevelopmentclone () const
 Virtual clone function for FMTDevelopment.
 
FMTDevelopmentoperator= (const FMTDevelopment &rhs)
 Copy assignment operator for FMTDevelopment.
 
bool operator== (const FMTDevelopment &rhs) const
 Equality comparison operator of FMTDevelopment.
 
bool operator!= (const FMTDevelopment &rhs) const
 Inequality comparison operator of FMTDevelopment.
 
bool operator< (const FMTDevelopment &rhs) const
 Less than comparison operator of FMTDevelopment.
 
FMTFuturDevelopment grow () const
 Return a grown copy of this development, increasing the age and period and decreasing the lock level if it was greater than 0.
 
FMTYieldRequest getYieldRequest (const Graph::FMTGraphVertexToYield *graphyieldrequest=nullptr) const
 Get a yield request for this development, without reference to a graph unless one is provided.
 
std::string getNonOperabilityInfo (const FMTAction &p_action, const Core::FMTYields &p_yields, const Graph::FMTGraphVertexToYield *p_yieldRequest) const
 Check why this developpement is not operable for p_action and return the info.
 
bool operable (const FMTAction &action, const Core::FMTYields &ylds, const Graph::FMTGraphVertexToYield *graphyieldrequest=nullptr) const
 Check if this development is operable to an action based on multiple yields.
 
bool anyOperable (const std::vector< const FMTAction * > &actions, const Core::FMTYields &ylds, const Graph::FMTGraphVertexToYield *graphyieldrequest=nullptr) const
 Check if this development is operable to any of the actions based on multiple yields.
 
virtual operator std::string () const
 Return the string representation of the development as in the area section.
 
virtual double getArea () const
 Return the area of the development.
 
FMTDevelopment clearLock () const
 Return a copy of this development with the lock level set to 0.
 
std::vector< FMTDevelopmentPathoperate (const FMTAction &action, const FMTTransition &Transition, const Core::FMTYields &ylds, const std::vector< FMTTheme > &themes) const
 Return the development paths resulting from operating this development with an action and a transition based on yields and sorted themes.
 
double getInventoryCoef (const Core::FMTYields &ylds, const std::string &target_yield, const Graph::FMTGraphVertexToYield *graphyieldrequest=nullptr) const
 Return the inventory coefficient of the development for a given yield based on the yields.
 
double getHarvestCoef (const std::vector< FMTDevelopmentPath > &topaths, const FMTAction &action, const Core::FMTYields &ylds, const std::string &target_yield, const Graph::FMTGraphVertexToYield *graphyieldrequest=nullptr) const
 Return the harvest coefficient of the development for a given yield following multiple development paths for an action based on yields.
 
bool is (const FMTSpec &specification, const Core::FMTYields &ylds, const Graph::FMTGraphVertexToYield *graphyieldrequest=nullptr) const
 Check if this development respects a specification based on multiple yields.
 
bool worthTestingOperability (const FMTAction &action) const
 Return true if it is worth testing operability for the action, used for optimization.
 
std::vector< int > anyWorthTestingOperability (const std::vector< const FMTAction * > &actions, const FMTAction &firstaction) const
 Return the pointer distances from the first action of the actions worth testing for operability.
 
std::vector< bool > isAnyWorthTestingOperability (const std::vector< const FMTAction * > &actions, const std::vector< FMTAction > &allactions) const noexcept
 Return a vector of booleans, true if the corresponding action is worth testing for operability.
 
size_t hash () const
 Return the hash of the development combining its mask, age, lock and period.
 
- 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)
 

Friends

class boost::serialization::access
 Serialize the FMTActualDevelopment through its base FMTDevelopment for multiprocessing across multiple cpus (pickle in Python).
 

Additional Inherited Members

- 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.
 
- 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.
 
- 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

Child class of FMTDevelopment representing an actual forest stand, holding the area of the stand.

Constructor & Destructor Documentation

◆ FMTActualDevelopment() [1/5]

Core::FMTActualDevelopment::FMTActualDevelopment ( FMTActualDevelopment &&  rhs)

Move copy constructor.

Parameters
[in]rhsdevelopment to swap

◆ FMTActualDevelopment() [2/5]

Core::FMTActualDevelopment::FMTActualDevelopment ( )

Default constructor for FMTActualDevelopment.

◆ ~FMTActualDevelopment()

Core::FMTActualDevelopment::~FMTActualDevelopment ( )
default

Default destructor for FMTActualDevelopment.

◆ FMTActualDevelopment() [3/5]

Core::FMTActualDevelopment::FMTActualDevelopment ( const FMTActualDevelopment rhs)

Copy constructor for FMTActualDevelopment.

Parameters
[in]rhsthe FMTActualDevelopment to copy.

◆ FMTActualDevelopment() [4/5]

Core::FMTActualDevelopment::FMTActualDevelopment ( const FMTMask mask,
const int &  age,
const int &  lock,
const double &  area 
)

Construct an actual development from a mask, an age, a lock level and an area.

Parameters
[in]maskthe mask.
[in]agethe age.
[in]lockthe lock level.
[in]areathe area.

◆ FMTActualDevelopment() [5/5]

Core::FMTActualDevelopment::FMTActualDevelopment ( const FMTDevelopment rhs,
double  larea 
)

Construct an actual development from a development and an area.

Parameters
[in]rhsthe development.
[in]lareathe area.

Member Function Documentation

◆ clone()

std::unique_ptr< FMTDevelopment > Core::FMTActualDevelopment::clone ( ) const
overridevirtual

Return a unique pointer of FMTDevelopment cloning the actual development.

Returns
a unique pointer to the cloned development.

Reimplemented from Core::FMTDevelopment.

◆ getArea()

double Core::FMTActualDevelopment::getArea ( ) const
overridevirtual

Return the area of the actual development.

Returns
the area of the actual development.

Reimplemented from Core::FMTDevelopment.

◆ operator std::string()

Core::FMTActualDevelopment::operator std::string ( ) const
overridevirtual

Return the string representation of the actual development as in the area section.

Returns
the string representation of the actual development.

Reimplemented from Core::FMTDevelopment.

◆ operator!=()

bool Core::FMTActualDevelopment::operator!= ( const FMTActualDevelopment rhs) const

Inequality comparison operator of FMTActualDevelopment.

Parameters
[in]rhsthe development to compare with.
Returns
true if both developments are different else false.

◆ operator<()

bool Core::FMTActualDevelopment::operator< ( const FMTActualDevelopment rhs) const

Less than comparison operator of FMTActualDevelopment.

Parameters
[in]rhsthe development to compare with.
Returns
true if this development is less than rhs else false.

◆ operator=() [1/2]

FMTActualDevelopment & Core::FMTActualDevelopment::operator= ( const FMTActualDevelopment rhs)

Copy assignment operator for FMTActualDevelopment.

Parameters
[in]rhsthe FMTActualDevelopment to copy.
Returns
a reference to this FMTActualDevelopment.

◆ operator=() [2/2]

FMTActualDevelopment & Core::FMTActualDevelopment::operator= ( FMTActualDevelopment &&  rhs)

Move assignment operator for FMTActualDevelopment.

Parameters
[in]rhsthe development to move from.
Returns
a reference to this FMTActualDevelopment.

◆ operator==()

bool Core::FMTActualDevelopment::operator== ( const FMTActualDevelopment rhs) const

Equality comparison operator of FMTActualDevelopment.

Parameters
[in]rhsthe development to compare with.
Returns
true if both developments are equal else false.

◆ preSolve()

FMTActualDevelopment Core::FMTActualDevelopment::preSolve ( const FMTMaskFilter filter,
const std::vector< FMTTheme > &  presolvedthemes 
) const

Presolve the actual development using the FMTDevelopment preSolve function.

Parameters
[in]filterthe mask filter.
[in]presolvedthemesthe presolved themes.
Returns
the presolved actual development.

◆ reduceLockToDeath()

FMTActualDevelopment Core::FMTActualDevelopment::reduceLockToDeath ( const FMTLifespans lifespans) const

Reduce the lock of the actual development to its lifespan if the lifespan is shorter than the lock.

Raises FMTdeathwithlock; if the error is set to warning, returns an actual development with the lock reduced accordingly, otherwise returns a copy of itself. Mainly used in FMTModel::setArea.

Parameters
[in]lifespansthe lifespans.
Returns
the actual development with the lock reduced to death.

◆ setArea()

void Core::FMTActualDevelopment::setArea ( const double &  newarea)

Set the area of the actual development.

Parameters
[in]newareathe area to set.

Friends And Related Function Documentation

◆ boost::serialization::access

friend class boost::serialization::access
friend

Serialize the FMTActualDevelopment through its base FMTDevelopment for multiprocessing across multiple cpus (pickle in Python).

Template Parameters
Archivethe archive type.
Parameters
[in,out]arthe archive to serialize to or from.
[in]versionthe serialization version.

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