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::FMTsrmodel Class Reference

#include <FMTsrmodel.hpp>

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

Public Member Functions

Graph::FMTgraphvertextoyield getGraphVertexToYield () const
 
virtual void postsolve (const FMTmodel &originalbasemodel)
 
void setparallellogger (Logging::FMTlogger &logger) override
 
 FMTsrmodel (const FMTmodel &base, FMTsolverinterface lsolvertype)
 
 FMTsrmodel ()
 
 FMTsrmodel (const FMTsrmodel &rhs)
 
 FMTsrmodel (const FMTmodel &base, const Graph::FMTgraph< Graph::FMTvertexproperties, Graph::FMTedgeproperties > &lgraph, const FMTlpsolver &lsolver)
 
FMTsrmodeloperator= (const FMTsrmodel &rhs)=default
 
 FMTsrmodel (FMTsrmodel &&rhs)=default
 
FMTsrmodeloperator= (FMTsrmodel &&rhs)=default
 
 ~FMTsrmodel ()=default
 
bool operator== (const FMTsrmodel &rhs) const
 
bool operator!= (const FMTsrmodel &rhs) const
 
bool unboundsolution (int period)
 
bool isperiodbounded (int period) const
 
void cleargraphdevelopements ()
 
void cleargraphcache ()
 
bool setsolution (int period, const Core::FMTschedule &schedule, double tolerance=FMT_DBL_TOLERANCE)
 
bool setsolutionbylp (int period, const Core::FMTschedule &schedule, double tolerance=FMT_DBL_TOLERANCE)
 
bool forcesolution (int period, const Core::FMTschedule &proportionschedulewithlock)
 
Core::FMTschedule getsolution (int period, bool withlock=false) const final
 
Core::FMTschedule getscheduleproportions (int period, bool withlock) const
 
Graph::FMTgraphstats getstats () const
 
virtual std::unique_ptr< FMTmodelgetcopy (int period=0) const
 
virtual std::map< std::string, double > getoutput (const Core::FMToutput &output, int period, Core::FMToutputlevel level=Core::FMToutputlevel::standard) const
 
Graph::FMTgraphstats buildperiod (Core::FMTschedule schedule=Core::FMTschedule(), bool forcepartialbuild=false, int compressageclassoperability=1)
 
int getfirstactiveperiod () const
 
virtual std::vector< Core::FMTactualdevelopmentgetarea (int period=0, bool beforegrowanddeath=false) const override
 
FMTlpsolvergetsolverptr ()
 
const FMTlpsolvergetconstsolverptr () const
 
virtual std::unique_ptr< FMTmodelclone () const override
 
void passinlogger (const std::shared_ptr< Logging::FMTlogger > &logger) override
 
virtual std::unique_ptr< FMTmodelpresolve (std::vector< Core::FMTactualdevelopment > optionaldevelopments=std::vector< Core::FMTactualdevelopment >()) const override
 
bool boundsolution (int period, double tolerance=FMT_DBL_TOLERANCE)
 
bool setparameter (const FMTintmodelparameters &key, const int &value) override
 
bool setparameter (const FMTboolmodelparameters &key, const bool &value) override
 
Graph::FMTgraphstats getgraphstats () const
 
std::set< Core::FMTSeriegetrorations (const Core::FMTmask &mask, const std::string &aggregate) const
 
virtual bool isoptimal () const
 
virtual double getobjectivevalue () const
 
std::vector< const Core::FMTdevelopment * > getnochoice (const Core::FMTmask &base_mask) const
 
- Public Member Functions inherited from 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.
 
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 std::vector< Models::FMTsolverinterfacegetavailablesolverinterface ()
 
- Static Public Member Functions inherited from Models::FMTmodel
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

bool summarize (const std::map< int, double > &variables, std::vector< int > &sumvariables, std::vector< double > &sumcoefficiants) const
 
Graph::FMTgraphstats initializematrix ()
 
Graph::FMTgraphstats updatematrix (const Graph::FMTgraph< Graph::FMTvertexproperties, Graph::FMTedgeproperties >::FMTvertex_pair &targets, const Graph::FMTgraphstats &newstats)
 
size_t getgraphsize () const
 
void postsolvegraph (const FMTmodel &originalbasemodel)
 
- Protected Member Functions inherited from Models::FMTmodel
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

Graph::FMTgraph< Graph::FMTvertexproperties, Graph::FMTedgepropertiesgraph
 graph holding the FMTdevelopments for all the periods.
 
FMTlpsolver solver
 The lpsolver.
 
- Protected Attributes inherited from Models::FMTmodel
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

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

FMTsrmodel hold the attributes and methods shared between the spatially referenced models(FTMlpmodel and FMTnssmodel).

Constructor & Destructor Documentation

◆ FMTsrmodel() [1/5]

Models::FMTsrmodel::FMTsrmodel ( const FMTmodel base,
FMTsolverinterface  lsolvertype 
)

Main constructor used to build FMTsrmodel using it's base class and to let the user choose the solvertype (CLP,MOSEK,GUROBI,CPLEX) see FMTsolverinterface.h for more information about the supported solvertype.

◆ FMTsrmodel() [2/5]

Models::FMTsrmodel::FMTsrmodel ( )

Default constructor of FMTsrmodel

◆ FMTsrmodel() [3/5]

Models::FMTsrmodel::FMTsrmodel ( const FMTsrmodel rhs)

Copy constructor of FMTsrmodel

◆ FMTsrmodel() [4/5]

Models::FMTsrmodel::FMTsrmodel ( const FMTmodel base,
const Graph::FMTgraph< Graph::FMTvertexproperties, Graph::FMTedgeproperties > &  lgraph,
const FMTlpsolver lsolver 
)

Constructor of FMTsrmodel mainly use in postsolve.

◆ FMTsrmodel() [5/5]

Models::FMTsrmodel::FMTsrmodel ( FMTsrmodel &&  rhs)
default

Default move constructor for FMTsrmodel.

◆ ~FMTsrmodel()

Models::FMTsrmodel::~FMTsrmodel ( )
default

Default destructor of FMTsrmodel

Member Function Documentation

◆ boundsolution()

bool Models::FMTsrmodel::boundsolution ( int  period,
double  tolerance = FMT_DBL_TOLERANCE 
)

This function bounds the primal variables to the primal solution present within the matrix for a given period and tolerance. Perfect function to update a FMTlpmodel or get ready for replanning.

◆ buildperiod()

Graph::FMTgraphstats Models::FMTsrmodel::buildperiod ( Core::FMTschedule  schedule = Core::FMTschedule(),
bool  forcepartialbuild = false,
int  compressageclassoperability = 1 
)

This function is the main function used to build the graph and the matrix. A call to that function add a period within the graph and the matrix of the FMTsrmodel. If the schedule is not empty than the model is going to be generated in partialbuild mode and not fullbuild mode. Partialbuild will only build the graph linked to the solution. make it perfect to reinterpret outputs for a given solution without rebuilding the whole graph.

◆ cleargraphcache()

void Models::FMTsrmodel::cleargraphcache ( )

Clear the node caching in the graph

◆ cleargraphdevelopements()

void Models::FMTsrmodel::cleargraphdevelopements ( )

Clear developments location by periods in the graph

◆ clone()

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

Get a clone of the FMTsrmodel

Reimplemented from Models::FMTmodel.

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

◆ forcesolution()

bool Models::FMTsrmodel::forcesolution ( int  period,
const Core::FMTschedule proportionschedulewithlock 
)

Force a solution by using a schedule based on proportions instead of area. So if there is modifications to the model, it will place only the parts of the solution that are possible considering the modifications. The schedule must be with lock indicators if locks are used in the model.

◆ getarea()

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

This function returns an area for a given period for a FMTsrmodel. If period = 0 the area is the same has FMTmodel::getarea(). For period > 0 the area returned is the FMTdevelopement of the graph that can be (actual of futur) existing at the beginning of the period. Need to have a builded graph with a solution to use this function.

Reimplemented from Models::FMTmodel.

◆ getavailablesolverinterface()

static std::vector< Models::FMTsolverinterface > Models::FMTsrmodel::getavailablesolverinterface ( )
static

Return a vector of solverinterface available

◆ getconstsolverptr()

const FMTlpsolver * Models::FMTsrmodel::getconstsolverptr ( ) const

Get a pointer to the const solver behind the model.

◆ getcopy()

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

This function returns a copy of the FMTmodel of the selected period. If period = 0 it returns the FMTmodel::getcopy if period > 0 then it returns a copy of the FMTmodel based on the developements of the FMTgraph of the FMTlpmodel. Need to have a builded graph with a solution to use this function.

Reimplemented from Models::FMTmodel.

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

◆ getfirstactiveperiod()

int Models::FMTsrmodel::getfirstactiveperiod ( ) const

Return the first active period should be always 0 in case or planning. But when eraseperiod is called the first active period is going to move to 1 and so on.

◆ getgraphsize()

size_t Models::FMTsrmodel::getgraphsize ( ) const
protected

Return the size of the graph.

◆ getgraphstats()

Graph::FMTgraphstats Models::FMTsrmodel::getgraphstats ( ) const

Return the statistics of the actual graph (number of cols,rows,edges,verticies)

◆ getGraphVertexToYield()

Graph::FMTgraphvertextoyield Models::FMTsrmodel::getGraphVertexToYield ( ) const

◆ getnochoice()

std::vector< const Core::FMTdevelopment * > Models::FMTsrmodel::getnochoice ( const Core::FMTmask base_mask) const

Giving a base_mask returns period 0 developpements that have no actions assigned for the whole planning horizon. The developpements mask have to be a subset of the base_mask.

◆ getobjectivevalue()

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

Return the value of the solver objective.

Reimplemented from Models::FMTmodel.

◆ getoutput()

virtual std::map< std::string, double > Models::FMTsrmodel::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 solution of the matrix. the map key returned consist of output name if level == FMToutputlevel::standard || level == FMToutputlevel::totalonly, or developement name if level == FMToutputlevel::developpement

Reimplemented from Models::FMTmodel.

Reimplemented in Models::FMTlpmodel.

◆ getrorations()

std::set< Core::FMTSerie > Models::FMTsrmodel::getrorations ( const Core::FMTmask mask,
const std::string &  aggregate 
) const

Based on a mask and an action get all the unique rotations (in period) taken to complete a serie of action. A serie can contain a subserie for an aggregate of actions. It will only keep series that actions are part of the aggregate. Args: mask : the FMTmask of the rotations aggregate : std::string on which the last action is considered to be in Returns: Unique FMTSerie (where the serie is in string action1-action2-action3... string is the serie and int is the number of periods taken to complete the serie.

◆ getscheduleproportions()

Core::FMTschedule Models::FMTsrmodel::getscheduleproportions ( int  period,
bool  withlock 
) const

Same as getsolution but the schedule area represent the percentage of area of the developement.

◆ getsolution()

Core::FMTschedule Models::FMTsrmodel::getsolution ( int  period,
bool  withlock = false 
) const
finalvirtual

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 from Models::FMTmodel.

◆ getsolverptr()

FMTlpsolver * Models::FMTsrmodel::getsolverptr ( )

Get a pointer to the solver behind the model.

◆ getstats()

Graph::FMTgraphstats Models::FMTsrmodel::getstats ( ) const

Get the graph stats of the graph and matrix (number of columns/rows/edges/verticies...)

◆ initializematrix()

Graph::FMTgraphstats Models::FMTsrmodel::initializematrix ( )
protected

Initialize the solverinterface called once when the FMTgraph was empty after the first call of buildperiod.

◆ isoptimal()

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

Return true if the solver consider the solution optimal.

Reimplemented from Models::FMTmodel.

◆ isperiodbounded()

bool Models::FMTsrmodel::isperiodbounded ( int  period) const

Check if FMTdevelopment area are bounded on there primal variables for a given period.

◆ operator!=()

bool Models::FMTsrmodel::operator!= ( const FMTsrmodel rhs) const

Comparison operator of FMTsrmodel

◆ operator=() [1/2]

FMTsrmodel & Models::FMTsrmodel::operator= ( const FMTsrmodel rhs)
default

Copy assignment of FMTsrmodel

◆ operator=() [2/2]

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

Default move assignment for FMTsrmodel.

◆ operator==()

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

Comparison operator of FMTsrmodel

◆ passinlogger()

void Models::FMTsrmodel::passinlogger ( const std::shared_ptr< Logging::FMTlogger > &  logger)
overridevirtual

We need to override the passinlogger for the osisolverinterface

Reimplemented from Core::FMTobject.

◆ postsolve()

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

Reimplemented from Models::FMTmodel.

◆ postsolvegraph()

void Models::FMTsrmodel::postsolvegraph ( const FMTmodel originalbasemodel)
protected

Post solve this graph and return a presolved graph for each vertex and edges based on the original model.

◆ presolve()

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

Presolve a FMTsrmodel.

Reimplemented from Models::FMTmodel.

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

◆ setparallellogger()

void Models::FMTsrmodel::setparallellogger ( Logging::FMTlogger logger)
overridevirtual

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 from Models::FMTmodel.

◆ setparameter() [1/2]

bool Models::FMTsrmodel::setparameter ( const FMTboolmodelparameters key,
const bool &  value 
)
overridevirtual

Override setter for boolmodelparameters.

Reimplemented from Models::FMTmodel.

◆ setparameter() [2/2]

bool Models::FMTsrmodel::setparameter ( const FMTintmodelparameters key,
const int &  value 
)
overridevirtual

Override setter for intmodelparameters.

Reimplemented from Models::FMTmodel.

◆ setsolution()

bool Models::FMTsrmodel::setsolution ( int  period,
const Core::FMTschedule schedule,
double  tolerance = FMT_DBL_TOLERANCE 
)

If the user wants to set a solution for a given period for warmstarting the model or prepare to bound the model to that solution.

◆ setsolutionbylp()

bool Models::FMTsrmodel::setsolutionbylp ( int  period,
const Core::FMTschedule schedule,
double  tolerance = FMT_DBL_TOLERANCE 
)

In some cases if you avec a lot of _lockexcempt actions comming from a Ws model it might be easier to use the setsolutionbylp to set the solution on a partial graph. This function will change the objective function, constraints and variables bounds so juste use it in a "Get results" context ( only valid for partial graph).

◆ summarize()

bool Models::FMTsrmodel::summarize ( const std::map< int, double > &  variables,
std::vector< int > &  sumvariables,
std::vector< double > &  sumcoefficiants 
) const
protected

Simple function to summarize constraints that are un a map structure key = variables, element = coefficiant to a array structure (vector) for osisolverinterface. map structure is easier to deal with thant two vectors.

◆ unboundsolution()

bool Models::FMTsrmodel::unboundsolution ( int  period)

Unbound the primal bounds of a given period.

◆ updatematrix()

Graph::FMTgraphstats Models::FMTsrmodel::updatematrix ( const Graph::FMTgraph< Graph::FMTvertexproperties, Graph::FMTedgeproperties >::FMTvertex_pair &  targets,
const Graph::FMTgraphstats newstats 
)
protected

During a call to build period after the graph has been updated with nes developments type the solverinterface matrix need to be updated. Variables and constraints related to each of those new developements will be added to the matrix. So area transfer row and natural growth plus action variables.

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)

Member Data Documentation

◆ graph

graph holding the FMTdevelopments for all the periods.

◆ solver

FMTlpsolver Models::FMTsrmodel::solver
protected

The lpsolver.


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