FMT 0.9.8
Forest management tools for forest planning
|
#include <FMTschedule.hpp>
Public Types | |
typedef std::map< FMTaction, std::map< FMTdevelopment, std::vector< double > > >::value_type | value_type |
typedef std::map< FMTaction, std::map< FMTdevelopment, std::vector< double > > >::iterator | iterator |
typedef std::map< FMTaction, std::map< FMTdevelopment, std::vector< double > > >::const_iterator | const_iterator |
Public Member Functions | |
FMTschedule (const int &lperiod, const FMTobject &obj, const bool &luselock) | |
FMTschedule (const int &lperiod, std::vector< FMTschedule > &schedules) | |
FMTschedule (int lperiod, std::map< FMTaction, std::map< FMTdevelopment, std::vector< double > > > mapping) | |
FMTschedule (int lperiod, const std::map< FMTaction, std::map< FMTdevelopment, std::map< int, double > > > &mapping) | |
FMTschedule () | |
~FMTschedule ()=default | |
FMTschedule (const FMTschedule &rhs) | |
FMTschedule & | operator= (const FMTschedule &rhs) |
bool | operator== (const FMTschedule &rhs) const |
bool | operator!= (const FMTschedule &rhs) const |
FMTschedule & | operator+= (const FMTschedule &rhs) |
FMTschedule | operator+ (const FMTschedule &rhs) const |
operator std::string () const | |
int | getperiod () const |
bool | douselock () const |
void | setuselock (const bool &lock) |
double | actionarea (const FMTaction &action) const |
void | addevent (const Core::FMTdevelopment &dev, const double &area, const Core::FMTaction &action) |
void | clean () |
double | area () const |
bool | operated (const FMTaction &action, const FMTdevelopment &developement) const |
std::vector< boost::unordered_set< FMTdevelopment > > | getoperabilities (const std::vector< FMTaction > &actions) const |
void | sort () |
bool | empty () const |
size_t | size () const |
FMTschedule | presolve (const FMTmaskfilter &filter, const std::vector< FMTtheme > &newthemes, const std::vector< FMTaction > &presolvedaction) const |
FMTschedule | postsolve (const FMTmaskfilter &filter, const std::vector< FMTtheme > &originalbasethemes, const std::vector< FMTaction > &originalbasebaseactions) const |
void | setperiod (const int &newperiod) |
FMTschedule | getnewschedule (const double &factor) const |
bool | isfuturconstraints (const std::vector< Core::FMTconstraint > &constraints) const |
std::map< FMTdevelopment, std::vector< double > > & | operator[] (const FMTaction &action) |
const std::map< FMTdevelopment, std::vector< double > > & | at (const FMTaction &action) const |
iterator | find (const FMTaction &actionkey) |
const_iterator | find (const FMTaction &actionkey) const |
iterator | begin () |
const_iterator | begin () const |
iterator | end () |
const_iterator | end () const |
Public Member Functions inherited from Core::FMTobject | |
FMTobject () | |
virtual | ~FMTobject () |
FMTobject (const std::shared_ptr< Exception::FMTexceptionhandler > exhandler) | |
FMTobject (const FMTobject &rhs) | |
FMTobject & | operator= (const FMTobject &rhs) |
virtual void | passinlogger (const std::shared_ptr< Logging::FMTlogger > &logger) |
void | passinexceptionhandler (const std::shared_ptr< Exception::FMTexceptionhandler > &exhandler) |
void | redirectlogtofile (const std::string &location) |
virtual void | setdefaultlogger () |
virtual void | setquietlogger () |
virtual void | settasklogger () |
virtual void | setdebuglogger () |
void | setdefaultexceptionhandler () |
void | setquietexceptionhandler () |
void | setdebugexceptionhandler () |
void | setfreeexceptionhandler () |
void | disablenestedexceptions () |
void | enablenestedexceptions () |
void | seterrorstowarnings (const std::vector< Exception::FMTexc > &errors) |
void | setmaxwarningsbeforesilenced (const size_t &maxwarningcount) |
Friends | |
class | boost::serialization::access |
Additional Inherited Members | |
Static Public Member Functions inherited from Core::FMTobject | |
static std::string | getruntimelocation () |
static unsigned long long | getavailablememory () |
Protected Member Functions inherited from Core::FMTobject | |
template<class Archive > | |
void | forcesave (Archive &ar, const unsigned int version) const |
template<class Archive > | |
void | forceload (Archive &ar, const unsigned int version) |
void | checksignals () const |
void | setCPLhandler () |
Static Protected Member Functions inherited from Core::FMTobject | |
static std::chrono::time_point< std::chrono::high_resolution_clock > | getclock () |
template<class chrono > | |
static double | getduration (const std::chrono::time_point< std::chrono::high_resolution_clock > &startclock) |
static std::string | getdurationinseconds (const std::chrono::time_point< std::chrono::high_resolution_clock > &startclock) |
Static Protected Attributes inherited from Core::FMTobject | |
static std::shared_ptr< Exception::FMTexceptionhandler > | _exhandler |
A shared pointer to the exception handler. | |
static std::shared_ptr< Logging::FMTlogger > | _logger |
A shared pointer to the logger. | |
FMTschedule is the representation of a spatialy referenced schedule. It can be used by the FMTlpmodel and the FMTsesmodel. It describes the area of a given developements for which an FMTaction can be operated (key). The vector is a reprensentation of lock level at position 0 in the vector the lock level = 0 (if lock level 0 exist in the graph , at position 1 lock level = 1.
typedef std::map<FMTaction,std::map<FMTdevelopment,std::vector<double>>>::const_iterator Core::FMTschedule::const_iterator |
typedef std::map<FMTaction,std::map<FMTdevelopment,std::vector<double>>>::iterator Core::FMTschedule::iterator |
typedef std::map<FMTaction,std::map<FMTdevelopment,std::vector<double>>>::value_type Core::FMTschedule::value_type |
Functions that make sure the FMTschedule acts like a std c++ container
Core::FMTschedule::FMTschedule | ( | const int & | lperiod, |
const FMTobject & | obj, | ||
const bool & | luselock | ||
) |
FMTschedule constructor for an empty schedule at given period
Core::FMTschedule::FMTschedule | ( | const int & | lperiod, |
std::vector< FMTschedule > & | schedules | ||
) |
FMTschedule constructor for a complete construction of FMTschedule with multiple FMTschedule
Core::FMTschedule::FMTschedule | ( | int | lperiod, |
std::map< FMTaction, std::map< FMTdevelopment, std::vector< double > > > | mapping | ||
) |
FMTschedule constructor for a complete construction of FMTschedule
Core::FMTschedule::FMTschedule | ( | int | lperiod, |
const std::map< FMTaction, std::map< FMTdevelopment, std::map< int, double > > > & | mapping | ||
) |
FMTschedule constructor _lock based mapping (When a schedule is parsed).
Core::FMTschedule::FMTschedule | ( | ) |
Default FMTschedule constructor.
|
default |
Default ~FMTschedule constructor.
Core::FMTschedule::FMTschedule | ( | const FMTschedule & | rhs | ) |
Default FMTschedule copy constructor.
double Core::FMTschedule::actionarea | ( | const FMTaction & | action | ) | const |
Return the total harvested area of a FMTaction present in the FMTschedule.
void Core::FMTschedule::addevent | ( | const Core::FMTdevelopment & | dev, |
const double & | area, | ||
const Core::FMTaction & | action | ||
) |
Add a new event to the shedule based on the developement,action and area. See clean function also.
double Core::FMTschedule::area | ( | ) | const |
Return the total area of the schedule operated by all schedule actions.
const std::map< FMTdevelopment, std::vector< double > > & Core::FMTschedule::at | ( | const FMTaction & | action | ) | const |
iterator Core::FMTschedule::begin | ( | ) |
const_iterator Core::FMTschedule::begin | ( | ) | const |
void Core::FMTschedule::clean | ( | ) |
After calling multiple time addevent the schedule will end up with empty area if uselock == false. So you need to call this function to clean the schedule before using it.
|
inline |
Return true if the schedule can contains locked developement.
bool Core::FMTschedule::empty | ( | ) | const |
Return true is the FMTschedule is not empty.
iterator Core::FMTschedule::end | ( | ) |
const_iterator Core::FMTschedule::end | ( | ) | const |
const_iterator Core::FMTschedule::find | ( | const FMTaction & | actionkey | ) | const |
FMTschedule Core::FMTschedule::getnewschedule | ( | const double & | factor | ) | const |
Multiply this schedule with a factor and return it
std::vector< boost::unordered_set< FMTdevelopment > > Core::FMTschedule::getoperabilities | ( | const std::vector< FMTaction > & | actions | ) | const |
Get all operabilities of the schedules in an hash table.
|
inline |
Getter for the schedule period.
bool Core::FMTschedule::isfuturconstraints | ( | const std::vector< Core::FMTconstraint > & | constraints | ) | const |
Check if the schedule period will be bounded by new constraints.
bool Core::FMTschedule::operated | ( | const FMTaction & | action, |
const FMTdevelopment & | developement | ||
) | const |
Check if a given FMTdevelopment has been actioned for the this FMTschedule.
Core::FMTschedule::operator std::string | ( | ) | const |
Convert the FMTschedule to a string like seen in a regular scedule file.
bool Core::FMTschedule::operator!= | ( | const FMTschedule & | rhs | ) | const |
FMTschedule nonequality operator.
FMTschedule Core::FMTschedule::operator+ | ( | const FMTschedule & | rhs | ) | const |
This function append an FMTschedule to an other FMTschedule and return a new one.
FMTschedule & Core::FMTschedule::operator+= | ( | const FMTschedule & | rhs | ) |
This function append an FMTschedule to an other FMTschedule.
FMTschedule & Core::FMTschedule::operator= | ( | const FMTschedule & | rhs | ) |
Default FMTschedule copy assignment.
bool Core::FMTschedule::operator== | ( | const FMTschedule & | rhs | ) | const |
FMTschedule equality operator.
std::map< FMTdevelopment, std::vector< double > > & Core::FMTschedule::operator[] | ( | const FMTaction & | action | ) |
FMTschedule Core::FMTschedule::postsolve | ( | const FMTmaskfilter & | filter, |
const std::vector< FMTtheme > & | originalbasethemes, | ||
const std::vector< FMTaction > & | originalbasebaseactions | ||
) | const |
Postsolve all masks base on a basemask and the original themes and actions.
FMTschedule Core::FMTschedule::presolve | ( | const FMTmaskfilter & | filter, |
const std::vector< FMTtheme > & | newthemes, | ||
const std::vector< FMTaction > & | presolvedaction | ||
) | const |
Presolve all masks base on a basemask a preolved mask and presolved themes and presolved actions list. The returned schedule can also be empty.
void Core::FMTschedule::setperiod | ( | const int & | newperiod | ) |
Setter for the period of the Schedule and the period developements of the schedule.
void Core::FMTschedule::setuselock | ( | const bool & | lock | ) |
Mark the schedule has can contains locked developement.
size_t Core::FMTschedule::size | ( | ) | const |
Return the size of the FMTschedule.
void Core::FMTschedule::sort | ( | ) |
Sort the vector of double of the lock level per area for the FMTschedule.
|
friend |
serialize function is for serialization, used to do multiprocessing across multiple cpus (pickle in Pyhton)