FMT 0.9.8
Forest management tools for forest planning
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | Friends | List of all members
Models::FMTmodel Class Reference

#include <FMTmodel.hpp>

Inheritance diagram for Models::FMTmodel:
[legend]
Collaboration diagram for Models::FMTmodel:
[legend]

Public Member Functions

Models::FMTmodel aggregateAllActions (const std::vector< std::string > &p_Aggregates) const
 Aggregate actions together and create en enterly new model with new -actions,transitions,outputs,constraints,yields,lifespan.
 
std::vector< Core::FMTscheduleaggregateSchedules (const std::vector< Core::FMTschedule > &p_schedules) const
 Build new schedule based on p_schedules with the corresponding aggregated actions.
 
virtual void setparallellogger (Logging::FMTlogger &logger)
 
virtual void clearcache ()
 
 FMTmodel (const std::vector< Core::FMTactualdevelopment > &larea, const std::vector< Core::FMTtheme > &lthemes, const std::vector< Core::FMTaction > &lactions, const std::vector< Core::FMTtransition > &ltransitions, const Core::FMTyields &lyields, const Core::FMTlifespans &llifespan, const std::string &lname, const std::vector< Core::FMToutput > &loutputs, std::vector< Core::FMTconstraint > lconstraints=std::vector< Core::FMTconstraint >(), FMTmodelparameters lparameters=FMTmodelparameters())
 
 FMTmodel ()
 
virtual ~FMTmodel ()=default
 
 FMTmodel (FMTmodel &&rhs)=default
 
FMTmodeloperator= (FMTmodel &&rhs)=default
 
virtual std::vector< Core::FMTactualdevelopmentgetarea (int period=0, bool beforegrowanddeath=false) const
 
virtual std::unique_ptr< FMTmodelgetcopy (int period=0) const
 
FMTmodel basepresolve () const
 
Core::FMTmaskfilter getpresolvefilter (const std::vector< Core::FMTtheme > &originalthemes) const
 
Core::FMTmaskfilter getpostsolvefilter (const std::vector< Core::FMTtheme > &originalthemes, const Core::FMTmask &devmask) const
 
Core::FMTmask getselectedmask (const std::vector< Core::FMTtheme > &originalthemes) const
 
virtual std::unique_ptr< FMTmodelpresolve (std::vector< Core::FMTactualdevelopment > optionaldevelopments=std::vector< Core::FMTactualdevelopment >()) const
 
virtual void postsolve (const FMTmodel &originalbasemodel)
 
Core::FMTschedule presolveschedule (const Core::FMTschedule &originalbaseschedule, const FMTmodel &originalbasemodel) const
 
FMTmodelstats getmodelstats () const
 
void cleanactionsntransitions ()
 
std::string getname () const
 
std::vector< Core::FMTthemegetthemes () const
 
std::vector< Core::FMTactiongetactions () const
 
std::vector< Core::FMTtransitiongettransitions () const
 
Core::FMTyields getyields () const
 
Core::FMTlifespans getlifespan () const
 
std::vector< Core::FMToutputgetoutputs () const
 
std::vector< Core::FMTconstraintgetconstraints () const
 
void addoutput (const std::string &name, const std::string &maskstring, Core::FMTotar outputtarget, std::string action=std::string(), std::string yield=std::string(), std::string description=std::string(), int targettheme=-1)
 
template<typename T >
void addyieldhandlers (const std::vector< T > &yieldhandlers)
 
void addyieldhandlersfromptr (const std::vector< std::unique_ptr< Core::FMTyieldhandler > > &yieldhandlers)
 
bool operator== (const FMTmodel &rhs) const
 
bool operator< (const FMTmodel &rhs) const
 
void setarea (const std::vector< Core::FMTactualdevelopment > &ldevs)
 
void setthemes (const std::vector< Core::FMTtheme > &lthemes)
 
void setactions (const std::vector< Core::FMTaction > &lactions)
 
void settransitions (const std::vector< Core::FMTtransition > &ltransitions)
 
void setconstraints (const std::vector< Core::FMTconstraint > &lconstraint)
 
void setyields (const Core::FMTyields &lylds)
 
void setlifespan (const Core::FMTlifespans &llifespan)
 
void setname (const std::string &newname)
 
void setoutputs (const std::vector< Core::FMToutput > &newoutputs)
 
bool isvalid ()
 
std::vector< Core::FMTthemelocatestaticthemes (const Core::FMToutput &output, bool ignoreoutputvariables=false) const
 
std::vector< Core::FMTthemelocatestaticthemes (const Core::FMToutputnode &output, bool ignoreoutputvariables=false) const
 
std::vector< Core::FMTthemelocatedynamicthemes (const Core::FMToutput &outpu, bool ignoreoutputvariables=false) const
 
Core::FMTmask getdynamicmask (const Core::FMToutput &output, bool ignoreoutputvariables=false) const
 
Core::FMTmask getdynamicmask (const Core::FMToutputnode &node, bool ignoreoutputvariables=false) const
 
Core::FMTmask getstaticmask (const Core::FMToutputnode &node, bool ignoreoutputvariables=false) const
 
bool isstaticnode (const Core::FMToutputnode &node, double ratioofset=0.1) const
 
std::vector< Core::FMTthemelocatestatictransitionsthemes () const
 
std::vector< Core::FMTthemelocatenodestaticthemes (const Core::FMToutputnode &node, bool ignoreoutputvariables=false, std::vector< Core::FMTtheme > basethemes=std::vector< Core::FMTtheme >()) const
 
 FMTmodel (const FMTmodel &rhs)
 
FMTmodeloperator= (const FMTmodel &rhs)
 
bool empty () const
 
void push_back (const FMTmodel &rhs)
 
double getinitialarea () const
 
void setareaperiod (const int &period)
 
Core::FMTschedule getpotentialschedule (std::vector< Core::FMTactualdevelopment > toremove, std::vector< Core::FMTactualdevelopment > selection, bool withlock=true) const
 
virtual std::vector< Core::FMTconstraintgetreplanningconstraints (const std::string &modeltype, const std::vector< Core::FMTconstraint > &localconstraints, const int &period) const
 
virtual bool doplanning (const bool &solve, std::vector< Core::FMTschedule > schedules=std::vector< Core::FMTschedule >())
 
virtual std::map< std::string, double > getoutput (const Core::FMToutput &output, int period, Core::FMToutputlevel level=Core::FMToutputlevel::standard) const
 
virtual Core::FMTschedule getsolution (int period, bool withlock=false) const
 
virtual std::map< std::string, std::vector< std::vector< double > > > getoutputsfromperiods (const std::vector< Core::FMToutput > &theoutputs, const int &firstperiod, const int &lastperiod, Core::FMToutputlevel level=Core::FMToutputlevel::standard) const
 
virtual std::unique_ptr< FMTmodelclone () const
 
virtual bool setparameter (const FMTintmodelparameters &key, const int &value)
 
virtual bool setparameter (const FMTdblmodelparameters &key, const double &value)
 
virtual bool setparameter (const FMTboolmodelparameters &key, const bool &value)
 
int getparameter (const FMTintmodelparameters &key) const
 
double getparameter (const FMTdblmodelparameters &key) const
 
bool getparameter (const FMTboolmodelparameters &key) const
 
bool setcompresstime (const int &periodstart, const int &periodstop, const int &value)
 
std::vector< int > getcompresstime () const
 
std::vector< Core::FMTconstraintgoalconstraints (double penalty=999999) const
 
std::vector< Core::FMTconstraintgettacticalconstraints (double penalty=999999, double scheduleweight=999999, double objective=0, double objectivefactor=1.0) const
 
virtual void showparameters (const bool &showhelp=false) const
 
virtual bool build (std::vector< Core::FMTschedule > schedules=std::vector< Core::FMTschedule >())
 
virtual bool solve ()
 
virtual bool isoptimal () const
 
virtual double getobjectivevalue () 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)
 

Static Public Member Functions

static Core::FMTaction defaultdeathaction (const Core::FMTlifespans &llifespan, const std::vector< Core::FMTtheme > &lthemes)
 
static Core::FMTtransition defaultdeathtransition (const Core::FMTlifespans &llifespan, const std::vector< Core::FMTtheme > &lthemes)
 
- Static Public Member Functions inherited from Core::FMTobject
static std::string getruntimelocation ()
 
static unsigned long long getavailablememory ()
 

Protected Member Functions

void setdefaultobjects ()
 
Core::FMTmask getbasemask (std::vector< Core::FMTactualdevelopment > optionaldevelopments) const
 
std::vector< size_t > getstatictransitionthemes () const
 
std::vector< Core::FMTthemegetstaticpresolvethemes () const
 
void clearactionscache ()
 
void clearyieldcache ()
 
void cleartransitioncache ()
 
virtual void swap_ptr (const std::unique_ptr< FMTmodel > &rhs)
 
std::vector< Core::FMTschedulesetupschedulesforbuild (const std::vector< Core::FMTschedule > &schedules) const
 
bool useactionserie () const
 
size_t getseriesmaxsize () 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

FMTmodelparameters parameters
 
std::vector< Core::FMTactualdevelopmentarea
 Actualdevelopments for period 0, seen in the area section or the shapefile/raster.
 
std::vector< Core::FMTthemethemes
 Model themes of the landscape section file.
 
std::vector< Core::FMTactionactions
 Model actions from the action file and also the _death action.
 
std::vector< Core::FMTtransitiontransitions
 Model transitions from the transition file and also the _death transition.
 
Core::FMTyields yields
 Yields data comming from the yield file.
 
Core::FMTlifespans lifespan
 lifespan data comming from the lifespan file
 
std::vector< Core::FMToutputoutputs
 Outputs comming from the ouput file.
 
std::vector< Core::FMTconstraintconstraints
 Outputs comming from the optimization file.
 
std::string name
 The name of the Model (name of the .pri file without extension)
 
std::vector< size_t > statictransitionthemes
 The location of the themes static from transitions.
 

Friends

template<class T1 , class T2 >
class Graph::FMTgraph
 
class Graph::FMTlinegraph
 
class Spatial::FMTspatialschedule
 
class Spatial::FMTspatialnodescache
 
class Parser::FMTmodelparser
 
class Graph::FMTgraphvertextoyield
 
class boost::serialization::access
 

Additional Inherited Members

- 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

FMTmodel is the base class of multiple models in FMT It' is the formulation has seen in the Woodstock files of a forest planning problem. FMTlpmodel / FMTsamodel / FMTsesmodel use the FMTmodel protected member to generate the problem based on LP/SA or to simply simulate the FMTmodel.

Constructor & Destructor Documentation

◆ FMTmodel() [1/4]

Models::FMTmodel::FMTmodel ( const std::vector< Core::FMTactualdevelopment > &  larea,
const std::vector< Core::FMTtheme > &  lthemes,
const std::vector< Core::FMTaction > &  lactions,
const std::vector< Core::FMTtransition > &  ltransitions,
const Core::FMTyields lyields,
const Core::FMTlifespans llifespan,
const std::string &  lname,
const std::vector< Core::FMToutput > &  loutputs,
std::vector< Core::FMTconstraint lconstraints = std::vector< Core::FMTconstraint >(),
FMTmodelparameters  lparameters = FMTmodelparameters() 
)

Main constructor for FMTmodel used in Parser::FMTmodelparser, the constraints and parameters are optional. For the FMTsesmodel no constraints are needed.

◆ FMTmodel() [2/4]

Models::FMTmodel::FMTmodel ( )

Default constructor of FMTmodel.

◆ ~FMTmodel()

virtual Models::FMTmodel::~FMTmodel ( )
virtualdefault

Default virtual desctructor of FMTmodel.

◆ FMTmodel() [3/4]

Models::FMTmodel::FMTmodel ( FMTmodel &&  rhs)
default

Default move constructor for FMTmodel.

◆ FMTmodel() [4/4]

Models::FMTmodel::FMTmodel ( const FMTmodel rhs)

Copy constructor of FMTmodel

Member Function Documentation

◆ addoutput()

void Models::FMTmodel::addoutput ( const std::string &  name,
const std::string &  maskstring,
Core::FMTotar  outputtarget,
std::string  action = std::string(),
std::string  yield = std::string(),
std::string  description = std::string(),
int  targettheme = -1 
)

Change the function to accept a FMTouptut******** Adds one output to the model base only on strings. name = output name maskstring = string of the mask "? ? ?" outputtarget = type of ouput created action = action string targeted yield = yield string targeted description = description of the output

◆ addyieldhandlers()

template<typename T >
void Models::FMTmodel::addyieldhandlers ( const std::vector< T > &  yieldhandlers)
inline

Add FMTyieldhandler from vector (yieldhandlers) to yields. Can only be use for FMTageyieldhandler and FMTtimeyieldhandler. If you want to add FMTmodelyieldhandler or FMTcomplexyieldhander it must be added in the .yld file to parse with the model.

◆ addyieldhandlersfromptr()

void Models::FMTmodel::addyieldhandlersfromptr ( const std::vector< std::unique_ptr< Core::FMTyieldhandler > > &  yieldhandlers)

Add unique pointer of FMTyieldhandler from vector (yieldhandlers) to yields.

◆ aggregateAllActions()

Models::FMTmodel Models::FMTmodel::aggregateAllActions ( const std::vector< std::string > &  p_Aggregates) const

Aggregate actions together and create en enterly new model with new -actions,transitions,outputs,constraints,yields,lifespan.

Parameters
p_Aggregatesthe actions aggregate we want to merge together
Returns
newly created model with aggregated actions.

◆ aggregateSchedules()

std::vector< Core::FMTschedule > Models::FMTmodel::aggregateSchedules ( const std::vector< Core::FMTschedule > &  p_schedules) const

Build new schedule based on p_schedules with the corresponding aggregated actions.

Parameters
p_schedulesthe schedules of the original model.
Returns
newly created schedules with aggregated actions.

◆ basepresolve()

FMTmodel Models::FMTmodel::basepresolve ( ) const

This function use the existin area and call the presolve function The function can reduce the number of global themes/actions/transitions/yields/lifespans/outputs/constraints data if the model is badly formulated.

◆ build()

virtual bool Models::FMTmodel::build ( std::vector< Core::FMTschedule schedules = std::vector<Core::FMTschedule>())
inlinevirtual

Virtual function overrided all type of models. In child class, this function is use to build the elements needed to solve the model.

Reimplemented in Models::FMTlpmodel, Models::FMTnssmodel, Models::FMTsamodel, and Models::FMTsesmodel.

◆ cleanactionsntransitions()

void Models::FMTmodel::cleanactionsntransitions ( )

Function do delete action that have no defined transition and to delete transition that have no defined action. Actions and transitions are then sorted.

◆ clearactionscache()

void Models::FMTmodel::clearactionscache ( )
protected

◆ clearcache()

virtual void Models::FMTmodel::clearcache ( )
virtual

Clear caching element to reduce memory usage.

Reimplemented in Models::FMTlpmodel.

◆ cleartransitioncache()

void Models::FMTmodel::cleartransitioncache ( )
protected

◆ clearyieldcache()

void Models::FMTmodel::clearyieldcache ( )
protected

◆ clone()

virtual std::unique_ptr< FMTmodel > Models::FMTmodel::clone ( ) const
virtual

◆ defaultdeathaction()

static Core::FMTaction Models::FMTmodel::defaultdeathaction ( const Core::FMTlifespans llifespan,
const std::vector< Core::FMTtheme > &  lthemes 
)
static

Returns the default death action when not specified by the user, base on specific lifespan and themes.

◆ defaultdeathtransition()

static Core::FMTtransition Models::FMTmodel::defaultdeathtransition ( const Core::FMTlifespans llifespan,
const std::vector< Core::FMTtheme > &  lthemes 
)
static

Returns the default death transition when not specified by the user, base on specific lifespan and themes.

◆ doplanning()

virtual bool Models::FMTmodel::doplanning ( const bool &  solve,
std::vector< Core::FMTschedule schedules = std::vector< Core::FMTschedule >() 
)
virtual

Build the model and do the initialsolve or simulate. This function use the build and solve overrided functions of the differents model type.

◆ empty()

bool Models::FMTmodel::empty ( ) const

Returns true if the FMTmodel is empty.

◆ getactions()

std::vector< Core::FMTaction > Models::FMTmodel::getactions ( ) const
inline

Getter returning a copy of the FMTactions vector<> of the model.

◆ getarea()

virtual std::vector< Core::FMTactualdevelopment > Models::FMTmodel::getarea ( int  period = 0,
bool  beforegrowanddeath = false 
) const
virtual

Virtual function to get the area of a given period into actualdevelopement. If before grow = true it will returns the developement before it grow and death to the next period.

Reimplemented in Models::FMTsemodel, and Models::FMTsrmodel.

◆ getbasemask()

Core::FMTmask Models::FMTmodel::getbasemask ( std::vector< Core::FMTactualdevelopment optionaldevelopments) const
protected

Return a mask covering the actual bits used by the FMTmodel and the optionaldevelopements.

◆ getcompresstime()

std::vector< int > Models::FMTmodel::getcompresstime ( ) const

Return avec vector with compresstime value for each periods. First period is the index 0 in the vector. See FMTmodelparameters.h.

◆ getconstraints()

std::vector< Core::FMTconstraint > Models::FMTmodel::getconstraints ( ) const
inline

Getter returning a copy of the FMTconstraints vector<> of the model.

◆ getcopy()

virtual std::unique_ptr< FMTmodel > Models::FMTmodel::getcopy ( int  period = 0) const
virtual

This function returns a copy of the FMTmodel of the selected period. The function is going to clean the FMTconstraints and keep the objective.

Reimplemented in Models::FMTlpmodel, Models::FMTnssmodel, Models::FMTsamodel, Models::FMTsemodel, Models::FMTsesmodel, and Models::FMTsrmodel.

◆ getdynamicmask() [1/2]

Core::FMTmask Models::FMTmodel::getdynamicmask ( const Core::FMToutput output,
bool  ignoreoutputvariables = false 
) const

Based on static and dynamic themes will return a mask where the static attributes will have a value of 0 and dynamic value a value of 1.

◆ getdynamicmask() [2/2]

Core::FMTmask Models::FMTmodel::getdynamicmask ( const Core::FMToutputnode node,
bool  ignoreoutputvariables = false 
) const

Based on static and dynamic themes will return a mask where the static attributes will have a value of 0 and dynamic value a value of 1.

◆ getinitialarea()

double Models::FMTmodel::getinitialarea ( ) const

Returns the sum of the area of the area vector.

◆ getlifespan()

Core::FMTlifespans Models::FMTmodel::getlifespan ( ) const
inline

Getter returning a copy of the FMTlifespan data of the model.

◆ getmodelstats()

FMTmodelstats Models::FMTmodel::getmodelstats ( ) const

Return the statistics of the model, the number of themes, yields, actions, transitions etc...

◆ getname()

std::string Models::FMTmodel::getname ( ) const
inline

Returns the name of the FMTmodel

◆ getobjectivevalue()

virtual double Models::FMTmodel::getobjectivevalue ( ) const
virtual

Return the value of the globalobjective

Reimplemented in Models::FMTsemodel, and Models::FMTsrmodel.

◆ getoutput()

virtual std::map< std::string, double > Models::FMTmodel::getoutput ( const Core::FMToutput output,
int  period,
Core::FMToutputlevel  level = Core::FMToutputlevel::standard 
) const
virtual

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

Reimplemented in Models::FMTlpmodel, Models::FMTsemodel, and Models::FMTsrmodel.

◆ getoutputs()

std::vector< Core::FMToutput > Models::FMTmodel::getoutputs ( ) const
inline

Getter returning a copy of the FMToutputs vector<> of the model.

◆ getoutputsfromperiods()

virtual std::map< std::string, std::vector< std::vector< double > > > Models::FMTmodel::getoutputsfromperiods ( const std::vector< Core::FMToutput > &  theoutputs,
const int &  firstperiod,
const int &  lastperiod,
Core::FMToutputlevel  level = Core::FMToutputlevel::standard 
) const
virtual

For each output get a vector of outputs values starting for first period to last period.

◆ getparameter() [1/3]

bool Models::FMTmodel::getparameter ( const FMTboolmodelparameters key) const

Getter for bool model parameters. Return the parameters value. See FMTmodelparameters.h.

◆ getparameter() [2/3]

double Models::FMTmodel::getparameter ( const FMTdblmodelparameters key) const

Getter for double model parameters. Return the parameters value. See FMTmodelparameters.h.

◆ getparameter() [3/3]

int Models::FMTmodel::getparameter ( const FMTintmodelparameters key) const

Getter for int model parameters. Return the parameters value. See FMTmodelparameters.h.

◆ getpostsolvefilter()

Core::FMTmaskfilter Models::FMTmodel::getpostsolvefilter ( const std::vector< Core::FMTtheme > &  originalthemes,
const Core::FMTmask devmask 
) const

Get the postsolve filter used by the presolve (in case you want to turn presolved mask into postsolve mask).

◆ getpotentialschedule()

Core::FMTschedule Models::FMTmodel::getpotentialschedule ( std::vector< Core::FMTactualdevelopment toremove,
std::vector< Core::FMTactualdevelopment selection,
bool  withlock = true 
) const

The function will remove (toremove) developments from a selected vector (selection). Test operability of the difference and return a schedule containing an area of 1.0 if the developement is operable to this actions.

◆ getpresolvefilter()

Core::FMTmaskfilter Models::FMTmodel::getpresolvefilter ( const std::vector< Core::FMTtheme > &  originalthemes) const

Get the presolve filter.

◆ getreplanningconstraints()

virtual std::vector< Core::FMTconstraint > Models::FMTmodel::getreplanningconstraints ( const std::string &  modeltype,
const std::vector< Core::FMTconstraint > &  localconstraints,
const int &  period 
) const
virtual

Ajust constraints that need to be set to a value (getoutput) of the global or local model and return all constraint.

Reimplemented in Models::FMTlpmodel.

◆ getselectedmask()

Core::FMTmask Models::FMTmodel::getselectedmask ( const std::vector< Core::FMTtheme > &  originalthemes) const

If the model is presolved you can call this function to get the selection mask that you need to use to presolve a FMTmask.

◆ getseriesmaxsize()

size_t Models::FMTmodel::getseriesmaxsize ( ) const
protected

Get the maximal serie size for the whole model.

◆ getsolution()

virtual Core::FMTschedule Models::FMTmodel::getsolution ( int  period,
bool  withlock = false 
) const
virtual

Get the standard solution for a given period (FMTschedule dont have natural growth solution included). If with lock is true then the schedule will contain locked developement.

Reimplemented in Models::FMTsemodel, and Models::FMTsrmodel.

◆ getstaticmask()

Core::FMTmask Models::FMTmodel::getstaticmask ( const Core::FMToutputnode node,
bool  ignoreoutputvariables = false 
) const

Based on static and dynamic themes will return a mask where the static attributes will have a value of 1 and dynamic value a value of 0.

◆ getstaticpresolvethemes()

std::vector< Core::FMTtheme > Models::FMTmodel::getstaticpresolvethemes ( ) const
protected

Using the transition themes look at constraints and actions or yields actions to return only themes that are not part of the model.

◆ getstatictransitionthemes()

std::vector< size_t > Models::FMTmodel::getstatictransitionthemes ( ) const
protected

locate the static transition themes.

◆ gettacticalconstraints()

std::vector< Core::FMTconstraint > Models::FMTmodel::gettacticalconstraints ( double  penalty = 999999,
double  scheduleweight = 999999,
double  objective = 0,
double  objectivefactor = 1.0 
) const

Get the constraints adapted for a tactical model.

◆ getthemes()

std::vector< Core::FMTtheme > Models::FMTmodel::getthemes ( ) const
inline

Getter returning a copy of the FMTthemes vector<> of the model.

◆ gettransitions()

std::vector< Core::FMTtransition > Models::FMTmodel::gettransitions ( ) const
inline

Getter returning a copy of the FMTtransitions vector<> of the model.

◆ getyields()

Core::FMTyields Models::FMTmodel::getyields ( ) const
inline

Getter returning a copy of the FMTyields data of the model.

◆ goalconstraints()

std::vector< Core::FMTconstraint > Models::FMTmodel::goalconstraints ( double  penalty = 999999) const

Return all constraints and objective with goals and penalty

◆ isoptimal()

virtual bool Models::FMTmodel::isoptimal ( ) const
virtual

Return true if the FMTmodel is optimal

Reimplemented in Models::FMTsrmodel.

◆ isstaticnode()

bool Models::FMTmodel::isstaticnode ( const Core::FMToutputnode node,
double  ratioofset = 0.1 
) const

Based on static and dynamic themes will return true if the node can be used in staticmask fonctions. More that ratio of set is high the more you will get true from this fonction.

◆ isvalid()

bool Models::FMTmodel::isvalid ( )

This function validate all the FMTmodel FMTtheme ->FMTactualdevelopements-> FMTyields -> FMTaction -> FMTtransition -> FMToutput -> FMTconstraint return true if the model is valid.

◆ locatedynamicthemes()

std::vector< Core::FMTtheme > Models::FMTmodel::locatedynamicthemes ( const Core::FMToutput outpu,
bool  ignoreoutputvariables = false 
) const

Returns themes used in the transition scheme.

◆ locatenodestaticthemes()

std::vector< Core::FMTtheme > Models::FMTmodel::locatenodestaticthemes ( const Core::FMToutputnode node,
bool  ignoreoutputvariables = false,
std::vector< Core::FMTtheme basethemes = std::vector< Core::FMTtheme >() 
) const

Returns the static themes based on model transitions.

◆ locatestaticthemes() [1/2]

std::vector< Core::FMTtheme > Models::FMTmodel::locatestaticthemes ( const Core::FMToutput output,
bool  ignoreoutputvariables = false 
) const

Based on the FMTmodel looks at every theme to located in the FMTtransitions and return themes that are not used into the transition and in a given output (staticthemes)... will return themes based on spatial units.

◆ locatestaticthemes() [2/2]

std::vector< Core::FMTtheme > Models::FMTmodel::locatestaticthemes ( const Core::FMToutputnode output,
bool  ignoreoutputvariables = false 
) const

Based on the FMTmodel looks at every theme to located in the FMTtransitions and return themes that are not used into the transition and in a given output node (staticthemes)... will return themes based on spatial units.

◆ locatestatictransitionsthemes()

std::vector< Core::FMTtheme > Models::FMTmodel::locatestatictransitionsthemes ( ) const

Returns the static themes based on model transitions.

◆ operator<()

bool Models::FMTmodel::operator< ( const FMTmodel rhs) const

less than operator of FMTlpmodel

◆ operator=() [1/2]

FMTmodel & Models::FMTmodel::operator= ( const FMTmodel rhs)

Copy assignment of FMTmodel

◆ operator=() [2/2]

FMTmodel & Models::FMTmodel::operator= ( FMTmodel &&  rhs)
default

Default move assignment for FMTmodel.

◆ operator==()

bool Models::FMTmodel::operator== ( const FMTmodel rhs) const

Comparison operator of FMTlpmodel

◆ postsolve()

virtual void Models::FMTmodel::postsolve ( const FMTmodel originalbasemodel)
virtual

Reimplemented in Models::FMTsemodel, and Models::FMTsrmodel.

◆ presolve()

virtual std::unique_ptr< FMTmodel > Models::FMTmodel::presolve ( std::vector< Core::FMTactualdevelopment optionaldevelopments = std::vector< Core::FMTactualdevelopment >()) const
virtual

This function use a vector of developments and the actual transitions of the model and return new presolved FMTmodel. The function can reduce the number of global themes/actions/transitions/yields/lifespans/outputs/constraints data if the model is badly formulated.

Reimplemented in Models::FMTlpmodel, Models::FMTnssmodel, Models::FMTsamodel, Models::FMTsemodel, Models::FMTsesmodel, and Models::FMTsrmodel.

◆ presolveschedule()

Core::FMTschedule Models::FMTmodel::presolveschedule ( const Core::FMTschedule originalbaseschedule,
const FMTmodel originalbasemodel 
) const

Using the original schedule (not presolved) and the original model (not presolved) it returns a new schedule with presolved FMTdevelopements masks and actions.

◆ push_back()

void Models::FMTmodel::push_back ( const FMTmodel rhs)

This function append a FMTmodel to an FMTmodel. it does not override the objective of the base FMTmodel.

◆ setactions()

void Models::FMTmodel::setactions ( const std::vector< Core::FMTaction > &  lactions)

Setter for the FMTactions of the model will replace the originals.

◆ setarea()

void Models::FMTmodel::setarea ( const std::vector< Core::FMTactualdevelopment > &  ldevs)

Setter for initial FMTactualdevelopment (area section) will replace the originals. This function also check if the actualdevelopement lifespan is shorter than the lock. If not so, it raise the error FMTdeathwithlock and if the error is set to warning, the locks of the FMTactualdevelpement will be reduced accordingly.

◆ setareaperiod()

void Models::FMTmodel::setareaperiod ( const int &  period)

Change to initial area period to the new targeted period.

◆ setcompresstime()

bool Models::FMTmodel::setcompresstime ( const int &  periodstart,
const int &  periodstop,
const int &  value 
)

Set compresstime value for a range of periods (periodstart,periodstop). See FMTmodelparameters.h.

◆ setconstraints()

void Models::FMTmodel::setconstraints ( const std::vector< Core::FMTconstraint > &  lconstraint)

Setter for the FMTconstraints of the model will replace the original.

◆ setdefaultobjects()

void Models::FMTmodel::setdefaultobjects ( )
protected

If the user has not defined the _DEATH action and/or the _DEATH transition default _DEATH action and transition are going to be defined when the FMTmodel class is constructed.

◆ setlifespan()

void Models::FMTmodel::setlifespan ( const Core::FMTlifespans llifespan)

Setter for the FMTlifespans data of the model will replace the original.

◆ setname()

void Models::FMTmodel::setname ( const std::string &  newname)

Set the names of the FMTmodel

◆ setoutputs()

void Models::FMTmodel::setoutputs ( const std::vector< Core::FMToutput > &  newoutputs)

Setter for the model's outputs.

◆ setparallellogger()

virtual void Models::FMTmodel::setparallellogger ( Logging::FMTlogger logger)
virtual

Solver's logger cannot work in parallel so you need to pass a logger owned by the thead to the solver to make sure it does not work in concurrency.

Reimplemented in Models::FMTsrmodel.

◆ setparameter() [1/3]

virtual bool Models::FMTmodel::setparameter ( const FMTboolmodelparameters key,
const bool &  value 
)
virtual

Setter for bool model parameters. See FMTmodelparameters.h.

Reimplemented in Models::FMTnssmodel, and Models::FMTsrmodel.

◆ setparameter() [2/3]

virtual bool Models::FMTmodel::setparameter ( const FMTdblmodelparameters key,
const double &  value 
)
virtual

Setter for double model parameters. See FMTmodelparameters.h.

◆ setparameter() [3/3]

virtual bool Models::FMTmodel::setparameter ( const FMTintmodelparameters key,
const int &  value 
)
virtual

Setter for int model parameters. See FMTmodelparameters.h.

Reimplemented in Models::FMTnssmodel, and Models::FMTsrmodel.

◆ setthemes()

void Models::FMTmodel::setthemes ( const std::vector< Core::FMTtheme > &  lthemes)

Setter for the FMTthemes of the model will replace the originals.

◆ settransitions()

void Models::FMTmodel::settransitions ( const std::vector< Core::FMTtransition > &  ltransitions)

Setter for the FMTtransitions of the model will replace the originals.

◆ setupschedulesforbuild()

std::vector< Core::FMTschedule > Models::FMTmodel::setupschedulesforbuild ( const std::vector< Core::FMTschedule > &  schedules) const
protected

Base on the FORCE_PARTIAL_BUILD it will prepare the pass in schedules for building. Will make sure that the length is covered with a schedule or an empty one. It will always return a filled vector.

◆ setyields()

void Models::FMTmodel::setyields ( const Core::FMTyields lylds)

Setter for the FMTyields data of the model will replace the original.

◆ showparameters()

virtual void Models::FMTmodel::showparameters ( const bool &  showhelp = false) const
virtual

Show parameters values. If (showhelp) a brief description of each parameters will appear.

◆ solve()

virtual bool Models::FMTmodel::solve ( )
inlinevirtual

Virtual function overrided all type of models. In child class, this function is use to solve the model.

Reimplemented in Models::FMTlpmodel, Models::FMTnssmodel, Models::FMTsamodel, and Models::FMTsesmodel.

◆ swap_ptr()

virtual void Models::FMTmodel::swap_ptr ( const std::unique_ptr< FMTmodel > &  rhs)
protectedvirtual

Swap *this for the element at the end of the rhs unique_ptr.

Reimplemented in Models::FMTsamodel.

◆ useactionserie()

bool Models::FMTmodel::useactionserie ( ) const
protected

Returns true if the model make use of action series.

Friends And Related Function Documentation

◆ boost::serialization::access

friend class boost::serialization::access
friend

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

◆ Graph::FMTgraph

template<class T1 , class T2 >
friend class Graph::FMTgraph
friend

◆ Graph::FMTgraphvertextoyield

friend class Graph::FMTgraphvertextoyield
friend

◆ Graph::FMTlinegraph

friend class Graph::FMTlinegraph
friend

◆ Parser::FMTmodelparser

friend class Parser::FMTmodelparser
friend

◆ Spatial::FMTspatialnodescache

friend class Spatial::FMTspatialnodescache
friend

◆ Spatial::FMTspatialschedule

friend class Spatial::FMTspatialschedule
friend

Member Data Documentation

◆ actions

std::vector<Core::FMTaction> Models::FMTmodel::actions
protected

Model actions from the action file and also the _death action.

◆ area

std::vector<Core::FMTactualdevelopment> Models::FMTmodel::area
protected

Actualdevelopments for period 0, seen in the area section or the shapefile/raster.

◆ constraints

std::vector<Core::FMTconstraint> Models::FMTmodel::constraints
protected

Outputs comming from the optimization file.

◆ lifespan

Core::FMTlifespans Models::FMTmodel::lifespan
protected

lifespan data comming from the lifespan file

◆ name

std::string Models::FMTmodel::name
protected

The name of the Model (name of the .pri file without extension)

◆ outputs

std::vector<Core::FMToutput> Models::FMTmodel::outputs
protected

Outputs comming from the ouput file.

◆ parameters

FMTmodelparameters Models::FMTmodel::parameters
protected

Parameters needed for the function doplanning by the different types of FMTmodel. See FMTmodelparameters for detail description or use FMTmodel::showparameters(true) to see your parameters and a brief description.

◆ statictransitionthemes

std::vector<size_t> Models::FMTmodel::statictransitionthemes
protected

The location of the themes static from transitions.

◆ themes

std::vector<Core::FMTtheme> Models::FMTmodel::themes
protected

Model themes of the landscape section file.

◆ transitions

std::vector<Core::FMTtransition> Models::FMTmodel::transitions
protected

Model transitions from the transition file and also the _death transition.

◆ yields

Core::FMTyields Models::FMTmodel::yields
protected

Yields data comming from the yield file.


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