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
Spatial::FMTPatchRules Class Reference

Spatial patch rules used to evaluate and repair the size, adjacency and grouping of events in a spatial schedule. More...

#include <FMTPatchRules.h>

Inheritance diagram for Spatial::FMTPatchRules:
[legend]
Collaboration diagram for Spatial::FMTPatchRules:
[legend]

Public Member Functions

 FMTPatchRules ()=default
 Default constructor for FMTPatchRules.
 
 FMTPatchRules (const FMTPatchRules &rhs)=default
 Copy constructor for FMTPatchRules.
 
FMTPatchRulesoperator= (const FMTPatchRules &rhs)=default
 Copy assignment operator for FMTPatchRules.
 
double evaluate (const FMTEventContainer &p_events, const FMTSpatialGraphs &p_SpatialGraphs) const
 Evaluate the cost of the patch rules on a container of events.
 
void fillTooSmallEvents (std::vector< std::set< FMTEvent >::iterator > &p_SmallEvents, FMTEventContainer &p_events) const
 Fill a vector with the events that are too small.
 
void fillTooBigEvents (std::vector< std::set< FMTEvent >::iterator > &p_BigEvents, FMTEventContainer &p_events) const
 Fill a vector with the events that are too big.
 
void fillDispersionEvents (std::vector< std::set< FMTEvent >::iterator > &p_Dispersion, FMTEventContainer &p_events, const FMTSpatialGraphs &p_SpatialGraphs) const
 Fill a vector with the events that break the dispersion (adjacency) rules.
 
- 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::vector< FMTPatchRulesgetRules (const std::vector< Core::FMTConstraint > &p_constraints, const std::vector< Core::FMTAction > &p_actions)
 Build the patch rules from the spatial constraints and the actions.
 
- 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.
 
- 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

Spatial patch rules used to evaluate and repair the size, adjacency and grouping of events in a spatial schedule.

Constructor & Destructor Documentation

◆ FMTPatchRules() [1/2]

Spatial::FMTPatchRules::FMTPatchRules ( )
default

Default constructor for FMTPatchRules.

◆ FMTPatchRules() [2/2]

Spatial::FMTPatchRules::FMTPatchRules ( const FMTPatchRules rhs)
default

Copy constructor for FMTPatchRules.

Parameters
[in]rhsthe FMTPatchRules to copy.

Member Function Documentation

◆ evaluate()

double Spatial::FMTPatchRules::evaluate ( const FMTEventContainer p_events,
const FMTSpatialGraphs p_SpatialGraphs 
) const

Evaluate the cost of the patch rules on a container of events.

Parameters
[in]p_eventsthe events.
[in]p_SpatialGraphsthe spatial graphs.
Returns
the evaluation cost.

◆ fillDispersionEvents()

void Spatial::FMTPatchRules::fillDispersionEvents ( std::vector< std::set< FMTEvent >::iterator > &  p_Dispersion,
FMTEventContainer p_events,
const FMTSpatialGraphs p_SpatialGraphs 
) const

Fill a vector with the events that break the dispersion (adjacency) rules.

Parameters
[in,out]p_Dispersionthe dispersion events.
[in]p_eventsthe events.
[in]p_SpatialGraphsthe spatial graphs.

◆ fillTooBigEvents()

void Spatial::FMTPatchRules::fillTooBigEvents ( std::vector< std::set< FMTEvent >::iterator > &  p_BigEvents,
FMTEventContainer p_events 
) const

Fill a vector with the events that are too big.

Parameters
[in,out]p_BigEventsthe too big events.
[in]p_eventsthe events.

◆ fillTooSmallEvents()

void Spatial::FMTPatchRules::fillTooSmallEvents ( std::vector< std::set< FMTEvent >::iterator > &  p_SmallEvents,
FMTEventContainer p_events 
) const

Fill a vector with the events that are too small.

Parameters
[in,out]p_SmallEventsthe too small events.
[in]p_eventsthe events.

◆ getRules()

static std::vector< FMTPatchRules > Spatial::FMTPatchRules::getRules ( const std::vector< Core::FMTConstraint > &  p_constraints,
const std::vector< Core::FMTAction > &  p_actions 
)
static

Build the patch rules from the spatial constraints and the actions.

Parameters
[in]p_constraintsthe constraints.
[in]p_actionsthe actions.
Returns
the patch rules.

◆ operator=()

FMTPatchRules & Spatial::FMTPatchRules::operator= ( const FMTPatchRules rhs)
default

Copy assignment operator for FMTPatchRules.

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

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