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

#include <FMTschedule.hpp>

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

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)
 
FMTscheduleoperator= (const FMTschedule &rhs)
 
bool operator== (const FMTschedule &rhs) const
 
bool operator!= (const FMTschedule &rhs) const
 
FMTscheduleoperator+= (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)
 
FMTobjectoperator= (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.
 

Detailed Description

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.

Member Typedef Documentation

◆ const_iterator

typedef std::map<FMTaction,std::map<FMTdevelopment,std::vector<double>>>::const_iterator Core::FMTschedule::const_iterator

◆ iterator

typedef std::map<FMTaction,std::map<FMTdevelopment,std::vector<double>>>::iterator Core::FMTschedule::iterator

◆ value_type

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

Constructor & Destructor Documentation

◆ FMTschedule() [1/6]

Core::FMTschedule::FMTschedule ( const int &  lperiod,
const FMTobject obj,
const bool &  luselock 
)

FMTschedule constructor for an empty schedule at given period

◆ FMTschedule() [2/6]

Core::FMTschedule::FMTschedule ( const int &  lperiod,
std::vector< FMTschedule > &  schedules 
)

FMTschedule constructor for a complete construction of FMTschedule with multiple FMTschedule

◆ FMTschedule() [3/6]

Core::FMTschedule::FMTschedule ( int  lperiod,
std::map< FMTaction, std::map< FMTdevelopment, std::vector< double > > >  mapping 
)

FMTschedule constructor for a complete construction of FMTschedule

◆ FMTschedule() [4/6]

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

◆ FMTschedule() [5/6]

Core::FMTschedule::FMTschedule ( )

Default FMTschedule constructor.

◆ ~FMTschedule()

Core::FMTschedule::~FMTschedule ( )
default

Default ~FMTschedule constructor.

◆ FMTschedule() [6/6]

Core::FMTschedule::FMTschedule ( const FMTschedule rhs)

Default FMTschedule copy constructor.

Member Function Documentation

◆ actionarea()

double Core::FMTschedule::actionarea ( const FMTaction action) const

Return the total harvested area of a FMTaction present in the FMTschedule.

◆ addevent()

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.

◆ area()

double Core::FMTschedule::area ( ) const

Return the total area of the schedule operated by all schedule actions.

◆ at()

const std::map< FMTdevelopment, std::vector< double > > & Core::FMTschedule::at ( const FMTaction action) const

◆ begin() [1/2]

iterator Core::FMTschedule::begin ( )

◆ begin() [2/2]

const_iterator Core::FMTschedule::begin ( ) const

◆ clean()

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.

◆ douselock()

bool Core::FMTschedule::douselock ( ) const
inline

Return true if the schedule can contains locked developement.

◆ empty()

bool Core::FMTschedule::empty ( ) const

Return true is the FMTschedule is not empty.

◆ end() [1/2]

iterator Core::FMTschedule::end ( )

◆ end() [2/2]

const_iterator Core::FMTschedule::end ( ) const

◆ find() [1/2]

iterator Core::FMTschedule::find ( const FMTaction actionkey)

◆ find() [2/2]

const_iterator Core::FMTschedule::find ( const FMTaction actionkey) const

◆ getnewschedule()

FMTschedule Core::FMTschedule::getnewschedule ( const double &  factor) const

Multiply this schedule with a factor and return it

◆ getoperabilities()

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.

◆ getperiod()

int Core::FMTschedule::getperiod ( ) const
inline

Getter for the schedule period.

◆ isfuturconstraints()

bool Core::FMTschedule::isfuturconstraints ( const std::vector< Core::FMTconstraint > &  constraints) const

Check if the schedule period will be bounded by new constraints.

◆ operated()

bool Core::FMTschedule::operated ( const FMTaction action,
const FMTdevelopment developement 
) const

Check if a given FMTdevelopment has been actioned for the this FMTschedule.

◆ operator std::string()

Core::FMTschedule::operator std::string ( ) const

Convert the FMTschedule to a string like seen in a regular scedule file.

◆ operator!=()

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

FMTschedule nonequality operator.

◆ operator+()

FMTschedule Core::FMTschedule::operator+ ( const FMTschedule rhs) const

This function append an FMTschedule to an other FMTschedule and return a new one.

◆ operator+=()

FMTschedule & Core::FMTschedule::operator+= ( const FMTschedule rhs)

This function append an FMTschedule to an other FMTschedule.

◆ operator=()

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

Default FMTschedule copy assignment.

◆ operator==()

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

FMTschedule equality operator.

◆ operator[]()

std::map< FMTdevelopment, std::vector< double > > & Core::FMTschedule::operator[] ( const FMTaction action)

◆ postsolve()

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.

◆ presolve()

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.

◆ setperiod()

void Core::FMTschedule::setperiod ( const int &  newperiod)

Setter for the period of the Schedule and the period developements of the schedule.

◆ setuselock()

void Core::FMTschedule::setuselock ( const bool &  lock)

Mark the schedule has can contains locked developement.

◆ size()

size_t Core::FMTschedule::size ( ) const

Return the size of the FMTschedule.

◆ sort()

void Core::FMTschedule::sort ( )

Sort the vector of double of the lock level per area for the FMTschedule.

Friends And Related Function Documentation

◆ boost::serialization::access

friend class boost::serialization::access
friend

serialize function is for serialization, used to do multiprocessing across multiple cpus (pickle in Pyhton)


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