FMT 0.9.8
Forest management tools for forest planning
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
Spatial::FMTspatialschedule Class Reference

#include <FMTspatialschedule.hpp>

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

Public Types

typedef std::vector< std::vector< Spatial::FMTbindingspatialaction > > actionbindings
 
- Public Types inherited from Spatial::FMTlayer< Graph::FMTlinegraph >
typedef std::map< FMTcoordinate, Graph::FMTlinegraph >::value_type value_type
 Value typedef of the FMTlayer.
 
typedef std::map< FMTcoordinate, Graph::FMTlinegraph >::iterator iterator
 Iterator typedef of the FMTlayer.
 
typedef std::map< FMTcoordinate, Graph::FMTlinegraph >::const_iterator const_iterator
 Const_Iterator typedef of the FMTlist.
 

Public Member Functions

 FMTspatialschedule (FMTspatialschedule &&rhs) noexcept
 
 FMTspatialschedule ()
 
 FMTspatialschedule (const FMTforest &initialmap)
 
virtual ~FMTspatialschedule ()=default
 
 FMTspatialschedule (const FMTspatialschedule &other)
 
 FMTspatialschedule (const FMTspatialschedule &other, const std::vector< FMTcoordinate >::const_iterator &firstcoord, const std::vector< FMTcoordinate >::const_iterator &endcoord)
 
FMTspatialscheduleoperator= (const FMTspatialschedule &rhs)
 
bool operator== (const FMTspatialschedule &rhs) const
 
bool operator!= (const FMTspatialschedule &rhs) const
 
bool empty () const
 
int actperiod () const
 
bool copyfromselected (const FMTspatialschedule &rhs, const std::vector< size_t > &selected)
 
bool swapfromselected (FMTspatialschedule &rhs, const std::vector< size_t > &selected)
 
FMTforest getforestperiod (const int &period, bool periodstart=false) const
 
bool allow_action (const int &targetaction, const std::vector< Spatial::FMTbindingspatialaction > &bindingactions, const FMTcoordinate &location, const int &period) const
 
std::vector< std::set< Spatial::FMTcoordinate > > getupdatedscheduling (const Models::FMTmodel &model, const std::vector< int > &actiontargets, boost::unordered_map< Core::FMTdevelopment, std::vector< bool > > &cachedaction, const std::vector< boost::unordered_set< Core::FMTdevelopment > > &scheduleoperabilities, bool schedule_only=true, std::vector< std::set< Spatial::FMTcoordinate > > original=std::vector< std::set< Spatial::FMTcoordinate > >(), std::vector< FMTcoordinate > updatedcoordinate=std::vector< FMTcoordinate >()) const
 
double evaluatespatialconstraint (const Core::FMTconstraint &spatialconstraint, const Models::FMTmodel &model) const
 
std::set< FMTcoordinateverifyspatialfeasability (const int &targetaction, const std::vector< Spatial::FMTbindingspatialaction > &bindingactions, const int &period, const std::set< FMTcoordinate > &operables) const
 
FMTeventcontainer buildharvest (const double &target, const Spatial::FMTbindingspatialaction &targetaction, std::default_random_engine &generator, std::set< FMTcoordinate > mapping_pass, const int &previousperiod, const int &actionid, std::vector< FMTcoordinate > &operated) const
 
double operateevents (const FMTeventcontainer &cuts, const Core::FMTaction &action, const int &action_id, const Core::FMTtransition &Transition, const Core::FMTyields &ylds, const std::vector< Core::FMTtheme > &themes)
 
void operatecoord (const FMTcoordinate &coord, const Core::FMTaction &action, const int &action_id, const FMTbindingspatialaction &bindingspaction, const Core::FMTtransition &Transition, const Core::FMTyields &ylds, const std::vector< Core::FMTtheme > &themes)
 
void grow ()
 
std::vector< Core::FMTschedulegetschedules (const std::vector< Core::FMTaction > &modelactions, bool withlock=false) const
 
std::vector< double > getgraphsoutputs (const Models::FMTmodel &model, const Core::FMTconstraint &constraint, const FMTspatialschedule *friendlysolution=nullptr) const
 
std::vector< int > isbetterthan (const FMTspatialschedule &newsolution, const Models::FMTmodel &model) const
 
double getconstraintevaluation (const Core::FMTconstraint &constraint, const Models::FMTmodel &model, const FMTspatialschedule *friendlysolution=nullptr) const
 
std::vector< double > getconstraintsvalues (const Models::FMTmodel &model, const FMTspatialschedule *friendlysolution=nullptr) const
 
std::vector< double > getweightedfactors (const Models::FMTmodel &model, const FMTspatialschedule *friendlysolution=nullptr) const
 
double getprimalinfeasibility (const std::vector< const Core::FMTconstraint * > &constraints, const Models::FMTmodel &model, const FMTspatialschedule *friendlysolution=nullptr, bool withfactorization=false) const
 
void logsolutionstatus (const size_t &iteration, const double &objective, const double &primalinfeasibility) const
 
void getsolutionstatus (double &objective, double &primalinfeasibility, const Models::FMTmodel &model, const FMTspatialschedule *friendlysolution=nullptr, bool withsense=true, bool withfactorization=false, bool withspatial=true) const
 
double getglobalobjective (const Models::FMTmodel &model, const FMTspatialschedule *friendlysolution=nullptr) const
 
double getobjectivevalue (const Core::FMTconstraint &constraint, const Models::FMTmodel &model, const FMTspatialschedule *friendlysolution=nullptr, bool withsense=true) const
 
void setgraphfromcache (const Graph::FMTlinegraph &graph, const Models::FMTmodel &model, const int &startingperiod, bool remove=true)
 
std::string getpatchstats (const std::vector< Core::FMTaction > &actions) const
 
FMTlayer< std::string > lastdistlayer (const std::vector< Core::FMTaction > &modelactions, const int &period) const
 
std::vector< Core::FMTGCBMtransitiongetGCBMtransitions (FMTlayer< std::string > &stackedactions, const std::vector< Core::FMTaction > &modelactions, const std::vector< Core::FMTtheme > &classifiers, const int &period) const
 
std::vector< std::vector< Graph::FMTpredictor > > getpredictors (FMTlayer< int > &predictorids, const Models::FMTmodel &model, const std::vector< std::string > &yieldnames, const int &period, bool periodonevalues=false, bool withGCBMid=true) const
 
void eraselastperiod ()
 
std::vector< Spatial::FMTbindingspatialactiongetbindingactions (const Models::FMTmodel &model, const int &period) const
 
actionbindings getbindingactionsbyperiod (const Models::FMTmodel &model) const
 
std::map< std::string, double > referencebuild (const Core::FMTschedule &schedule, const Models::FMTmodel &model, const std::vector< boost::unordered_set< Core::FMTdevelopment > > &scheduleoperabilities, bool schedule_only=true, bool scheduleatfirstpass=true, unsigned int seed=0)
 
std::map< std::string, double > greedyreferencebuild (const Core::FMTschedule &schedule, const Models::FMTmodel &model, const size_t &randomiterations, unsigned int seed=0, double tolerance=FMT_DBL_TOLERANCE, bool log=true)
 
Graph::FMTgraphstats randombuild (const Models::FMTmodel &model, std::default_random_engine &generator)
 
void perturbgraph (const FMTcoordinate &coordinate, const int &period, const Models::FMTmodel &model, std::default_random_engine &generator, const actionbindings &bindings)
 
bool isbetterbygroup (const FMTspatialschedule &rhs, const Models::FMTmodel &model) const
 
void swap (FMTspatialschedule &rhs)
 
std::vector< Spatial::FMTcoordinategetmovablecoordinates (const Models::FMTmodel &model, const int &period, const std::vector< Spatial::FMTcoordinate > *statics, boost::unordered_map< Core::FMTdevelopment, bool > *operability=nullptr) const
 
int getperiodwithmaximalevents (const std::vector< bool > &actions) const
 
std::vector< std::vector< Spatial::FMTcoordinate > > getareaconflictcoordinates (const actionbindings &bindingactions, const int &period, bool conflictonly=true) const
 
std::vector< std::vector< Spatial::FMTcoordinate > > getadjacencyconflictcoordinates (const actionbindings &bindingactions, const int &period, bool conflictonly=true) const
 
std::vector< Spatial::FMTcoordinategetstaticsmovablecoordinates (const Models::FMTmodel &model) const
 
bool ispartial () const
 
bool emptyevents () const
 
void copyfrompartial (const FMTspatialschedule &rhs)
 
void copyfrompartial (FMTspatialschedule &rhs)
 
void setconstraintsfactor (const Models::FMTmodel &model, const std::vector< double > &factors)
 
bool needsrefactortorization (const Models::FMTmodel &model) const
 
void dorefactortorization (const Models::FMTmodel &model)
 
std::vector< double > getconstraintsfactor () const
 
std::map< std::string, std::vector< double > > getoutput (const Models::FMTmodel &model, const Core::FMToutput &output, const int &periodstart, const int &periodstop, Core::FMToutputlevel level=Core::FMToutputlevel::totalonly) const
 
FMTlayer< double > getoutput (const Models::FMTmodel &model, const Core::FMToutput &output, const int &period) const
 
std::vector< std::pair< FMTcoordinate, double > > getoutputbycoordinate (const Models::FMTmodel &model, const Core::FMToutput &output, const int &period) const
 
void postsolve (const Core::FMTmaskfilter &filter, const std::vector< Core::FMTaction > &presolveactions, const Models::FMTmodel &originalbasemodel)
 
- Public Member Functions inherited from Spatial::FMTlayer< Graph::FMTlinegraph >
Graph::FMTlinegraphoperator[] (const FMTcoordinate &coordinate)
 
const Graph::FMTlinegraphat (const FMTcoordinate &coordinate) const
 
bool empty () const
 
iterator begin ()
 
const_iterator begin () const
 
iterator end ()
 
const_iterator end () const
 
const_iterator find (const FMTcoordinate &coordinate) const
 
iterator find (const FMTcoordinate &coordinate)
 
 FMTlayer ()
 
 FMTlayer (FMTlayer &&rhs) noexcept
 
 FMTlayer (const std::vector< double > &lgeotransform, const unsigned int &lmaxx, const unsigned int &lmaxy, const std::string &lSRS_WKT, const double &lcellsize)
 
 FMTlayer (const std::map< FMTcoordinate, Graph::FMTlinegraph > &lmapping, const std::vector< double > &lgeotransform, const unsigned int &lmaxx, const unsigned int &lmaxy, const std::string &lSRS_WKT, const double &lcellsize)
 
 FMTlayer (const FMTlayer &rhs)
 
virtual ~FMTlayer ()=default
 
FMTlayer< Graph::FMTlinegraph > & operator= (const FMTlayer< Graph::FMTlinegraph > &rhs)
 
void swap (FMTlayer< Graph::FMTlinegraph > &rhs)
 
void setextentfrom (const FMTlayer< Graph::FMTlinegraph > &rhs)
 
FMTlayer< newtype > copyextent () const
 
FMTlayer< Graph::FMTlinegraph > & operator+= (const FMTlayer< Graph::FMTlinegraph > &rhs)
 
FMTlayer< std::string > & operator+= (const FMTlayer< std::string > &rhs)
 
unsigned int GetXSize () const
 
unsigned int GetYSize () const
 
std::vector< double > getgeotransform () const
 
std::string getprojection () const
 
std::map< FMTcoordinate, Graph::FMTlinegraphgetmapping () const
 
double area () const
 
double getcellsize () const
 
std::vector< Graph::FMTlinegraphgetattributes () const
 
size_t size () const
 
void replace (typename std::map< FMTcoordinate, Graph::FMTlinegraph >::const_iterator first, typename std::map< FMTcoordinate, Graph::FMTlinegraph >::const_iterator last)
 
- 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)
 

Protected Member Functions

std::vector< const Graph::FMTlinegraph * > getfromevents (const Core::FMTconstraint &constraint, const std::vector< Core::FMTaction > &actions, const int &start, const int &stop) const
 
std::vector< FMTcoordinategetfromevents (const Core::FMToutputnode &node, const std::vector< Core::FMTaction > &actions, const int &period) const
 
std::map< std::string, double > getoutputfromgraph (const Graph::FMTlinegraph &linegraph, const Models::FMTmodel &model, const Core::FMToutputnode &node, const double *solution, const int &period, const Core::FMTmask &nodemask, boost::unordered_map< Core::FMTmask, double > &nodecache, Core::FMToutputlevel level=Core::FMToutputlevel::totalonly) const
 
void setgraphcachebystatic (const std::vector< FMTcoordinate > &coordinates, const Core::FMToutputnode &node) const
 
bool inscheduleoperabilities (const std::vector< boost::unordered_set< Core::FMTdevelopment > > &scheduleoperabilities, Core::FMTdevelopment const *dev, const int &actionid, const Core::FMTaction &action) const
 
std::vector< FMTlayer< Graph::FMTlinegraph >::const_iteratorgetoutputfromnode (const Models::FMTmodel &model, const Core::FMToutputnode &node, const int &period) const
 
- 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 ()
 

Protected Attributes

FMTeventcontainer events
 
- Protected Attributes inherited from Spatial::FMTlayer< Graph::FMTlinegraph >
std::vector< double > geotransform
 Geotransform of the map (see GDAL for more information about Geotransform)
 
unsigned int maxx
 Maximal x value in the map.
 
unsigned int maxy
 Maximal y value in the map.
 
std::string SRS_WKT
 Projection string of the raster (see GDAL for more information about Geotransform)
 
double cellsize
 Size of the pixel in the unit used by the map (SRS_WKT)
 
std::map< FMTcoordinate, Graph::FMTlinegraphmapping
 std::map keeping the information of each pixel.
 

Additional Inherited Members

- Static Public Member Functions inherited from Core::FMTobject
static std::string getruntimelocation ()
 
static unsigned long long getavailablememory ()
 
- 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

This class is a map containing a linear graph for each cell. The graph represent the stand, the action and the transition at each each period for the cell. Can be build randomly or with a schedule.

Member Typedef Documentation

◆ actionbindings

Constructor & Destructor Documentation

◆ FMTspatialschedule() [1/5]

Spatial::FMTspatialschedule::FMTspatialschedule ( FMTspatialschedule &&  rhs)
noexcept

Default move constructor for FMTspatialschedule.

◆ FMTspatialschedule() [2/5]

Spatial::FMTspatialschedule::FMTspatialschedule ( )

Default constructor of FMTspatialschedule

◆ FMTspatialschedule() [3/5]

Spatial::FMTspatialschedule::FMTspatialschedule ( const FMTforest initialmap)

Constructor of FMTspatialschedule based on FMTforest. It's initializing every graph in the map base on developments types in each cell.

◆ ~FMTspatialschedule()

virtual Spatial::FMTspatialschedule::~FMTspatialschedule ( )
virtualdefault

Default destructor of FMTspatialschedule

◆ FMTspatialschedule() [4/5]

Spatial::FMTspatialschedule::FMTspatialschedule ( const FMTspatialschedule other)

Copy constructor of FMTspatialschedule

◆ FMTspatialschedule() [5/5]

Spatial::FMTspatialschedule::FMTspatialschedule ( const FMTspatialschedule other,
const std::vector< FMTcoordinate >::const_iterator firstcoord,
const std::vector< FMTcoordinate >::const_iterator endcoord 
)

Create a partial copy of the complete solution base on coordinates.

Member Function Documentation

◆ actperiod()

int Spatial::FMTspatialschedule::actperiod ( ) const

Return the last period in the graph which is the active one.

◆ allow_action()

bool Spatial::FMTspatialschedule::allow_action ( const int &  targetaction,
const std::vector< Spatial::FMTbindingspatialaction > &  bindingactions,
const FMTcoordinate location,
const int &  period 
) const

Check in all events around the location during periods corresponding to green up delay if an action present in neighbors is in the adjacency limit.

◆ buildharvest()

FMTeventcontainer Spatial::FMTspatialschedule::buildharvest ( const double &  target,
const Spatial::FMTbindingspatialaction targetaction,
std::default_random_engine &  generator,
std::set< FMTcoordinate mapping_pass,
const int &  previousperiod,
const int &  actionid,
std::vector< FMTcoordinate > &  operated 
) const

◆ copyfrompartial() [1/2]

void Spatial::FMTspatialschedule::copyfrompartial ( const FMTspatialschedule rhs)

Copy elements from a partial solution.

◆ copyfrompartial() [2/2]

void Spatial::FMTspatialschedule::copyfrompartial ( FMTspatialschedule rhs)

Copy elements from a partial solution but also allow swap.

◆ copyfromselected()

bool Spatial::FMTspatialschedule::copyfromselected ( const FMTspatialschedule rhs,
const std::vector< size_t > &  selected 
)

◆ dorefactortorization()

void Spatial::FMTspatialschedule::dorefactortorization ( const Models::FMTmodel model)

Return true if the solution looks unscaled and need new factors

◆ empty()

bool Spatial::FMTspatialschedule::empty ( ) const
inline

Test whether the map is empty.

◆ emptyevents()

bool Spatial::FMTspatialschedule::emptyevents ( ) const

Return true if there's no events

◆ eraselastperiod()

void Spatial::FMTspatialschedule::eraselastperiod ( )

This function erase the last period of the FMTspatialschedule.

◆ evaluatespatialconstraint()

double Spatial::FMTspatialschedule::evaluatespatialconstraint ( const Core::FMTconstraint spatialconstraint,
const Models::FMTmodel model 
) const

Return the constraint evaluation value of a spatial constraint. If the subset is not a nullptr the

◆ getadjacencyconflictcoordinates()

std::vector< std::vector< Spatial::FMTcoordinate > > Spatial::FMTspatialschedule::getadjacencyconflictcoordinates ( const actionbindings bindingactions,
const int &  period,
bool  conflictonly = true 
) const

Returns adjacency conflicts coordinate that need to be destroyed

◆ getareaconflictcoordinates()

std::vector< std::vector< Spatial::FMTcoordinate > > Spatial::FMTspatialschedule::getareaconflictcoordinates ( const actionbindings bindingactions,
const int &  period,
bool  conflictonly = true 
) const

Returns the coordinates of events that does not have the right area in the worst period... and set the worst period

◆ getbindingactions()

std::vector< Spatial::FMTbindingspatialaction > Spatial::FMTspatialschedule::getbindingactions ( const Models::FMTmodel model,
const int &  period 
) const

Get the binding actions based on model constraints.

◆ getbindingactionsbyperiod()

actionbindings Spatial::FMTspatialschedule::getbindingactionsbyperiod ( const Models::FMTmodel model) const

Get the binding actions based on model constraints in a vector by period.

◆ getconstraintevaluation()

double Spatial::FMTspatialschedule::getconstraintevaluation ( const Core::FMTconstraint constraint,
const Models::FMTmodel model,
const FMTspatialschedule friendlysolution = nullptr 
) const

Returns the double value of the evaluated solution constraint.

◆ getconstraintsfactor()

std::vector< double > Spatial::FMTspatialschedule::getconstraintsfactor ( ) const

Get the constraints factors for nomalization

◆ getconstraintsvalues()

std::vector< double > Spatial::FMTspatialschedule::getconstraintsvalues ( const Models::FMTmodel model,
const FMTspatialschedule friendlysolution = nullptr 
) const

Fill up a vector of values for for each contraints (used for normalization)

◆ getforestperiod()

FMTforest Spatial::FMTspatialschedule::getforestperiod ( const int &  period,
bool  periodstart = false 
) const

Return the FMTforest corresponding to the period asked. If periodstart, the forest pass wil be the one before the actions as been set otherwise, it will be the forest after the actions as been set.

◆ getfromevents() [1/2]

std::vector< const Graph::FMTlinegraph * > Spatial::FMTspatialschedule::getfromevents ( const Core::FMTconstraint constraint,
const std::vector< Core::FMTaction > &  actions,
const int &  start,
const int &  stop 
) const
protected

Get theline graph using the eventcontainer

◆ getfromevents() [2/2]

std::vector< FMTcoordinate > Spatial::FMTspatialschedule::getfromevents ( const Core::FMToutputnode node,
const std::vector< Core::FMTaction > &  actions,
const int &  period 
) const
protected

Get the coordinate presents in the events for the outputnode, the action and the period asked.

◆ getGCBMtransitions()

std::vector< Core::FMTGCBMtransition > Spatial::FMTspatialschedule::getGCBMtransitions ( FMTlayer< std::string > &  stackedactions,
const std::vector< Core::FMTaction > &  modelactions,
const std::vector< Core::FMTtheme > &  classifiers,
const int &  period 
) const

◆ getglobalobjective()

double Spatial::FMTspatialschedule::getglobalobjective ( const Models::FMTmodel model,
const FMTspatialschedule friendlysolution = nullptr 
) const

Usefull to evaluate the quality of the solution it mixes objective to infeasibility and return it has double the lower the returned value is better is the solution. You can get a negative global objective.

◆ getgraphsoutputs()

std::vector< double > Spatial::FMTspatialschedule::getgraphsoutputs ( const Models::FMTmodel model,
const Core::FMTconstraint constraint,
const FMTspatialschedule friendlysolution = nullptr 
) const

Return sum of all graphs outputs related to constraint.

◆ getmovablecoordinates()

std::vector< Spatial::FMTcoordinate > Spatial::FMTspatialschedule::getmovablecoordinates ( const Models::FMTmodel model,
const int &  period,
const std::vector< Spatial::FMTcoordinate > *  statics,
boost::unordered_map< Core::FMTdevelopment, bool > *  operability = nullptr 
) const

◆ getobjectivevalue()

double Spatial::FMTspatialschedule::getobjectivevalue ( const Core::FMTconstraint constraint,
const Models::FMTmodel model,
const FMTspatialschedule friendlysolution = nullptr,
bool  withsense = true 
) const

Returns the objective value of the spatialschedule

◆ getoutput() [1/2]

FMTlayer< double > Spatial::FMTspatialschedule::getoutput ( const Models::FMTmodel model,
const Core::FMToutput output,
const int &  period 
) const

Get the output value for the whole layer for a given period and output.

◆ getoutput() [2/2]

std::map< std::string, std::vector< double > > Spatial::FMTspatialschedule::getoutput ( const Models::FMTmodel model,
const Core::FMToutput output,
const int &  periodstart,
const int &  periodstop,
Core::FMToutputlevel  level = Core::FMToutputlevel::totalonly 
) const

Get the output value of a output for a given period using the solution.. the map key returned consist of output name if level == FMToutputlevel::standard || level == FMToutputlevel::totalonly, or developement name if level == FMToutputlevel::developpement

◆ getoutputbycoordinate()

std::vector< std::pair< FMTcoordinate, double > > Spatial::FMTspatialschedule::getoutputbycoordinate ( const Models::FMTmodel model,
const Core::FMToutput output,
const int &  period 
) const

Return the output value by coordinate for a given output/model/period.

◆ getoutputfromgraph()

std::map< std::string, double > Spatial::FMTspatialschedule::getoutputfromgraph ( const Graph::FMTlinegraph linegraph,
const Models::FMTmodel model,
const Core::FMToutputnode node,
const double *  solution,
const int &  period,
const Core::FMTmask nodemask,
boost::unordered_map< Core::FMTmask, double > &  nodecache,
Core::FMToutputlevel  level = Core::FMToutputlevel::totalonly 
) const
protected

Get the output requested from a given linegraph into periods_values

◆ getoutputfromnode()

std::vector< FMTlayer< Graph::FMTlinegraph >::const_iterator > Spatial::FMTspatialschedule::getoutputfromnode ( const Models::FMTmodel model,
const Core::FMToutputnode node,
const int &  period 
) const
protected

Return the value of a given node at different linegraph const iterator

◆ getpatchstats()

std::string Spatial::FMTspatialschedule::getpatchstats ( const std::vector< Core::FMTaction > &  actions) const

◆ getperiodwithmaximalevents()

int Spatial::FMTspatialschedule::getperiodwithmaximalevents ( const std::vector< bool > &  actions) const

Get the period at with you got the maximal number of periods.

◆ getpredictors()

std::vector< std::vector< Graph::FMTpredictor > > Spatial::FMTspatialschedule::getpredictors ( FMTlayer< int > &  predictorids,
const Models::FMTmodel model,
const std::vector< std::string > &  yieldnames,
const int &  period,
bool  periodonevalues = false,
bool  withGCBMid = true 
) const

Get the predictors for the whole solution and write down the predictorsids into a layer.

◆ getprimalinfeasibility()

double Spatial::FMTspatialschedule::getprimalinfeasibility ( const std::vector< const Core::FMTconstraint * > &  constraints,
const Models::FMTmodel model,
const FMTspatialschedule friendlysolution = nullptr,
bool  withfactorization = false 
) const

Returns dual infeasibility of a set of constraints.

◆ getschedules()

std::vector< Core::FMTschedule > Spatial::FMTspatialschedule::getschedules ( const std::vector< Core::FMTaction > &  modelactions,
bool  withlock = false 
) const

Return operated schedules from linegraph.

◆ getsolutionstatus()

void Spatial::FMTspatialschedule::getsolutionstatus ( double &  objective,
double &  primalinfeasibility,
const Models::FMTmodel model,
const FMTspatialschedule friendlysolution = nullptr,
bool  withsense = true,
bool  withfactorization = false,
bool  withspatial = true 
) const

Get the primal infeasibility and objective value

◆ getstaticsmovablecoordinates()

std::vector< Spatial::FMTcoordinate > Spatial::FMTspatialschedule::getstaticsmovablecoordinates ( const Models::FMTmodel model) const

Returns a vector of coordinate that are considered movable

◆ getupdatedscheduling()

std::vector< std::set< Spatial::FMTcoordinate > > Spatial::FMTspatialschedule::getupdatedscheduling ( const Models::FMTmodel model,
const std::vector< int > &  actiontargets,
boost::unordered_map< Core::FMTdevelopment, std::vector< bool > > &  cachedaction,
const std::vector< boost::unordered_set< Core::FMTdevelopment > > &  scheduleoperabilities,
bool  schedule_only = true,
std::vector< std::set< Spatial::FMTcoordinate > >  original = std::vector< std::set< Spatial::FMTcoordinate > >(),
std::vector< FMTcoordinate updatedcoordinate = std::vector< FMTcoordinate >() 
) const

Return for all actions the FMTcoordinate with operable developments at the end of the graph.

◆ getweightedfactors()

std::vector< double > Spatial::FMTspatialschedule::getweightedfactors ( const Models::FMTmodel model,
const FMTspatialschedule friendlysolution = nullptr 
) const

Generates factors based on the actual solution.

◆ greedyreferencebuild()

std::map< std::string, double > Spatial::FMTspatialschedule::greedyreferencebuild ( const Core::FMTschedule schedule,
const Models::FMTmodel model,
const size_t &  randomiterations,
unsigned int  seed = 0,
double  tolerance = FMT_DBL_TOLERANCE,
bool  log = true 
)

This function call multiple time the simulate function to find the best possible spatialisation for a given schedule using random draw. It uses a schedule of actions (schedule) on the actual spatialy explicit forest. If the (schedule_only) switch is turned on the simulator wont try to find some operable developements (not present in the potential schedule) even if the area harvested target for that action is not reach. The user can also set the seed to get different solutions from the simulator.

◆ grow()

void Spatial::FMTspatialschedule::grow ( )

◆ inscheduleoperabilities()

bool Spatial::FMTspatialschedule::inscheduleoperabilities ( const std::vector< boost::unordered_set< Core::FMTdevelopment > > &  scheduleoperabilities,
Core::FMTdevelopment const *  dev,
const int &  actionid,
const Core::FMTaction action 
) const
protected

Return the maximal patch size of a vector of spatialactions.

◆ isbetterbygroup()

bool Spatial::FMTspatialschedule::isbetterbygroup ( const FMTspatialschedule rhs,
const Models::FMTmodel model 
) const

Compare solution by constraint group.

◆ isbetterthan()

std::vector< int > Spatial::FMTspatialschedule::isbetterthan ( const FMTspatialschedule newsolution,
const Models::FMTmodel model 
) const

Compare two spatialschedule and return a vector of bool with true if the constraint group has a better value then the compared solution else false.

◆ ispartial()

bool Spatial::FMTspatialschedule::ispartial ( ) const

return true if solution is partial.

◆ lastdistlayer()

FMTlayer< std::string > Spatial::FMTspatialschedule::lastdistlayer ( const std::vector< Core::FMTaction > &  modelactions,
const int &  period 
) const

Return sum of all graphs outputs related to constraint.

◆ logsolutionstatus()

void Spatial::FMTspatialschedule::logsolutionstatus ( const size_t &  iteration,
const double &  objective,
const double &  primalinfeasibility 
) const

Log the status of the solution

◆ needsrefactortorization()

bool Spatial::FMTspatialschedule::needsrefactortorization ( const Models::FMTmodel model) const

Return true if the solution looks unscaled and need new factors

◆ operatecoord()

void Spatial::FMTspatialschedule::operatecoord ( const FMTcoordinate coord,
const Core::FMTaction action,
const int &  action_id,
const FMTbindingspatialaction bindingspaction,
const Core::FMTtransition Transition,
const Core::FMTyields ylds,
const std::vector< Core::FMTtheme > &  themes 
)

Operate a coordinate and add it to the events ... That's why the FMTbindingspatialaction is needed

◆ operateevents()

double Spatial::FMTspatialschedule::operateevents ( const FMTeventcontainer cuts,
const Core::FMTaction action,
const int &  action_id,
const Core::FMTtransition Transition,
const Core::FMTyields ylds,
const std::vector< Core::FMTtheme > &  themes 
)

◆ operator!=()

bool Spatial::FMTspatialschedule::operator!= ( const FMTspatialschedule rhs) const

Comparison operator different than

◆ operator=()

FMTspatialschedule & Spatial::FMTspatialschedule::operator= ( const FMTspatialschedule rhs)

Copy assignment of FMTspatialschedule

◆ operator==()

bool Spatial::FMTspatialschedule::operator== ( const FMTspatialschedule rhs) const

Comparison operator equal to

◆ perturbgraph()

void Spatial::FMTspatialschedule::perturbgraph ( const FMTcoordinate coordinate,
const int &  period,
const Models::FMTmodel model,
std::default_random_engine &  generator,
const actionbindings bindings 
)

Change one graph in the solution remove it's contribution to objective and add contribution to the newly generated to the objective.

◆ postsolve()

void Spatial::FMTspatialschedule::postsolve ( const Core::FMTmaskfilter filter,
const std::vector< Core::FMTaction > &  presolveactions,
const Models::FMTmodel originalbasemodel 
)

postsolve the spatial solution.

◆ randombuild()

Graph::FMTgraphstats Spatial::FMTspatialschedule::randombuild ( const Models::FMTmodel model,
std::default_random_engine &  generator 
)

With a generator randomly create a solution for one period.

◆ referencebuild()

std::map< std::string, double > Spatial::FMTspatialschedule::referencebuild ( const Core::FMTschedule schedule,
const Models::FMTmodel model,
const std::vector< boost::unordered_set< Core::FMTdevelopment > > &  scheduleoperabilities,
bool  schedule_only = true,
bool  scheduleatfirstpass = true,
unsigned int  seed = 0 
)

This is the main function to simulate a schedule of actions (schedule) on the actual spatialy explicit forest. If the (schedule_only) switch is turned on the simulator wont try to find some operable developements (not present in the potential schedule) even if the area harvested target for that action is not reach. The user can also set the seed to get different solutions from the simulator.

◆ setconstraintsfactor()

void Spatial::FMTspatialschedule::setconstraintsfactor ( const Models::FMTmodel model,
const std::vector< double > &  factors 
)

Set the constraints factors for nomalization

◆ setgraphcachebystatic()

void Spatial::FMTspatialschedule::setgraphcachebystatic ( const std::vector< FMTcoordinate > &  coordinates,
const Core::FMToutputnode node 
) const
protected

◆ setgraphfromcache()

void Spatial::FMTspatialschedule::setgraphfromcache ( const Graph::FMTlinegraph graph,
const Models::FMTmodel model,
const int &  startingperiod,
bool  remove = true 
)

Removes the cached values for every nodes of the model of a given graph.If remove = false it add values to cache

◆ swap()

void Spatial::FMTspatialschedule::swap ( FMTspatialschedule rhs)

Swap operator for FMTspatialschedule.

◆ swapfromselected()

bool Spatial::FMTspatialschedule::swapfromselected ( FMTspatialschedule rhs,
const std::vector< size_t > &  selected 
)

◆ verifyspatialfeasability()

std::set< FMTcoordinate > Spatial::FMTspatialschedule::verifyspatialfeasability ( const int &  targetaction,
const std::vector< Spatial::FMTbindingspatialaction > &  bindingactions,
const int &  period,
const std::set< FMTcoordinate > &  operables 
) const

Return the constraint evaluation value of a spatial constraint. For the target action, return a set of FMTcoordinate corresponding to the cells that are spatially allowable from coordinates that are operables. Mainly only check for coord respecting the greenup constraint.

Member Data Documentation

◆ events

FMTeventcontainer Spatial::FMTspatialschedule::events
protected

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