FMT 0.9.8
Forest management tools for forest planning
Loading...
Searching...
No Matches
Classes | Public Member Functions | Protected Member Functions | Friends | List of all members
Models::FMTsamodel Class Referencefinal

#include <FMTsamodel.hpp>

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

Public Member Functions

void LogMovesReport () const
 
bool isProvenOptimal () const
 
bool initialsolve ()
 
virtual bool build (std::vector< Core::FMTschedule > schedules=std::vector< Core::FMTschedule >())
 
virtual bool solve ()
 
virtual std::unique_ptr< FMTmodelpresolve (std::vector< Core::FMTactualdevelopment > optionaldevelopments=std::vector< Core::FMTactualdevelopment >()) const
 
virtual std::unique_ptr< FMTmodelgetcopy (int period=0) const
 
 FMTsamodel ()
 Constructor.
 
 ~FMTsamodel ()
 Destructor.
 
 FMTsamodel (const FMTsamodel &rhs)
 Copy constructor.
 
 FMTsamodel (const FMTmodel &rhs)
 Copy constructor to use parent as argument in constructor.
 
 FMTsamodel (const FMTmodel &rhs, const Spatial::FMTforest &forest)
 Copy constructor to use parent as argument in constructor.
 
FMTsamodeloperator= (const FMTsamodel &rhs)
 Copy assignment operator.
 
virtual std::unique_ptr< FMTmodelclone () const final
 
Graph::FMTgraphstats buildperiod ()
 
- Public Member Functions inherited from Models::FMTsemodel
 FMTsemodel ()
 
virtual ~FMTsemodel ()=default
 
 FMTsemodel (const FMTsemodel &rhs)
 
 FMTsemodel (const FMTmodel &rhs, const Spatial::FMTforest &forest)
 
 FMTsemodel (const FMTmodel &rhs)
 
FMTsemodeloperator= (const FMTsemodel &rhs)
 
 FMTsemodel (FMTsemodel &&rhs)=default
 
FMTsemodeloperator= (FMTsemodel &&rhs)=default
 
Spatial::FMTforest getmapping () const
 
Spatial::FMTspatialschedule getspschedule () const
 
std::string getdisturbancestats () const
 
std::vector< Core::FMTschedulegetschedule (bool withlock=false) const
 
bool setinitialmapping (Spatial::FMTforest forest)
 
void LogConstraintsInfeasibilities () const
 
void LogConstraintsFactors () const
 
virtual std::unique_ptr< FMTmodelpresolve (std::vector< Core::FMTactualdevelopment > optionaldevelopments=std::vector< Core::FMTactualdevelopment >()) const
 
virtual void postsolve (const FMTmodel &originalbasemodel)
 
virtual std::map< std::string, double > getoutput (const Core::FMToutput &output, int period, Core::FMToutputlevel level=Core::FMToutputlevel::standard) const
 
virtual Spatial::FMTlayer< double > getspatialoutput (const Core::FMToutput &output, int period) const
 
virtual Core::FMTschedule getsolution (int period, bool withlock=false) const
 
virtual std::unique_ptr< FMTmodelclone () const
 
virtual std::vector< Core::FMTactualdevelopmentgetarea (int period=0, bool beforegrowanddeath=false) const
 
virtual std::unique_ptr< FMTmodelgetcopy (int period=0) const
 
virtual double getobjectivevalue () 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)
 

Protected Member Functions

std::vector< bool > GetFromBindings (const Spatial::FMTspatialschedule::actionbindings &bindingactions) const
 
size_t GetCycleMoves () const
 
size_t GetAcceptedCycleMoves () const
 
bool AllowDestruction (const Spatial::FMTspatialschedule &actual, const Spatial::FMTspatialschedule::actionbindings &bindings) const
 
bool AllowMove (const FMTsamove &move) const
 
bool AllowAnyMove () const
 
FMTsamove GetAMove (const Spatial::FMTspatialschedule &actual, const Spatial::FMTspatialschedule::actionbindings &bindings) const
 
bool IsBetter (const Spatial::FMTspatialschedule &actual, const Spatial::FMTspatialschedule &candidat) const
 
Spatial::FMTspatialschedule DoLocalMove (const Spatial::FMTspatialschedule &actual, const Spatial::FMTspatialschedule::actionbindings &bindings, const std::vector< Spatial::FMTcoordinate > *movable, boost::unordered_map< Core::FMTdevelopment, bool > *operability) const
 
Spatial::FMTspatialschedule DoConflictDestruction (const Spatial::FMTspatialschedule &actual, const Spatial::FMTspatialschedule::actionbindings &bindings, std::vector< std::vector< Spatial::FMTcoordinate > > selectionpool, const int &period) const
 
Spatial::FMTspatialschedule DoEventsAreaConflictDestrutorMove (const Spatial::FMTspatialschedule &actual, const Spatial::FMTspatialschedule::actionbindings &bindings) const
 
Spatial::FMTspatialschedule DoEventsAdjacencyConflictDestrutorMove (const Spatial::FMTspatialschedule &actual, const Spatial::FMTspatialschedule::actionbindings &bindings) const
 
Spatial::FMTspatialschedule Move (const Spatial::FMTspatialschedule &actual, const Spatial::FMTspatialschedule::actionbindings &bindings, const std::vector< Spatial::FMTcoordinate > *movable=nullptr, boost::unordered_map< Core::FMTdevelopment, bool > *operability=nullptr) const
 
double Warmup (const Spatial::FMTspatialschedule &actual, const Spatial::FMTspatialschedule::actionbindings &bindings, const std::vector< Spatial::FMTcoordinate > *movable=nullptr, boost::unordered_map< Core::FMTdevelopment, bool > *operability=nullptr, double initprobability=0.5, size_t iterations=10)
 
void InitialGrow ()
 
void RandomBuild ()
 
void SchedulesBuild (const std::vector< Core::FMTschedule > &schedules)
 
virtual void swap_ptr (const std::unique_ptr< FMTmodel > &rhs)
 
size_t GetLocalMoveSize () const
 
Spatial::FMTspatialschedule GetRebuild (const Spatial::FMTspatialschedule &actual) const
 
bool isCycleProvenOptimal () const
 
void DoFactorization ()
 
void LogSolutionStatus () const
 
void LogCycleStatus () const
 
void CoolDown ()
 
void UpdateFailedMoveCount ()
 
- 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 ()
 

Friends

class boost::serialization::access
 

Additional Inherited Members

- 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 ()
 
- 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)
 
- Protected Attributes inherited from Models::FMTsemodel
Spatial::FMTspatialschedule solution
 Contains the builded spatialsolution latest or best one.
 
- 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.
 
- 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 model is an area restricted model (ARM) using the simulated annealing meta-heuristic to solve the spatial optimization problem. Constraints must be goals with weight and the objective function must maximize or minimize those constraints. Only the functions needed to build a simulated annealing algorithm are implemented in this class, the algorithm must be written by the user using the functions exposed in this class.

An FMTforest is needed to set the initial map. An FMTsaschedule is needed as cooling schedule and FMTspatialaction must be set for the model.

Constructor & Destructor Documentation

◆ FMTsamodel() [1/4]

Models::FMTsamodel::FMTsamodel ( )

Constructor.

◆ ~FMTsamodel()

Models::FMTsamodel::~FMTsamodel ( )

Destructor.

◆ FMTsamodel() [2/4]

Models::FMTsamodel::FMTsamodel ( const FMTsamodel rhs)

Copy constructor.

◆ FMTsamodel() [3/4]

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

Copy constructor to use parent as argument in constructor.

◆ FMTsamodel() [4/4]

Models::FMTsamodel::FMTsamodel ( const FMTmodel rhs,
const Spatial::FMTforest forest 
)

Copy constructor to use parent as argument in constructor.

Member Function Documentation

◆ AllowAnyMove()

bool Models::FMTsamodel::AllowAnyMove ( ) const
protected

Return true if you can do a move

◆ AllowDestruction()

bool Models::FMTsamodel::AllowDestruction ( const Spatial::FMTspatialschedule actual,
const Spatial::FMTspatialschedule::actionbindings bindings 
) const
protected

Returns true if the bindings allow to destroy some events

◆ AllowMove()

bool Models::FMTsamodel::AllowMove ( const FMTsamove &  move) const
protected

Check If you can allow the move

◆ build()

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

This function TRY to build the solution FMTschedule to spatialschedule if there's a schedule if not it will randomly build the model to be ready to solve.

Reimplemented from Models::FMTmodel.

◆ buildperiod()

Graph::FMTgraphstats Models::FMTsamodel::buildperiod ( )

◆ clone()

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

Get a clone of the FMTsamodel

Reimplemented from Models::FMTsemodel.

◆ CoolDown()

void Models::FMTsamodel::CoolDown ( )
protected

Cool down the annealer temp

◆ DoConflictDestruction()

Spatial::FMTspatialschedule Models::FMTsamodel::DoConflictDestruction ( const Spatial::FMTspatialschedule actual,
const Spatial::FMTspatialschedule::actionbindings bindings,
std::vector< std::vector< Spatial::FMTcoordinate > >  selectionpool,
const int &  period 
) const
protected

Destroy the conflicts for a given periods and coordinates

◆ DoEventsAdjacencyConflictDestrutorMove()

Spatial::FMTspatialschedule Models::FMTsamodel::DoEventsAdjacencyConflictDestrutorMove ( const Spatial::FMTspatialschedule actual,
const Spatial::FMTspatialschedule::actionbindings bindings 
) const
protected

Destroy events that have adjacency conflict

◆ DoEventsAreaConflictDestrutorMove()

Spatial::FMTspatialschedule Models::FMTsamodel::DoEventsAreaConflictDestrutorMove ( const Spatial::FMTspatialschedule actual,
const Spatial::FMTspatialschedule::actionbindings bindings 
) const
protected

Destroy events that have some area conflict

◆ DoFactorization()

void Models::FMTsamodel::DoFactorization ( )
protected

Do the constraint factorization

◆ DoLocalMove()

Spatial::FMTspatialschedule Models::FMTsamodel::DoLocalMove ( const Spatial::FMTspatialschedule actual,
const Spatial::FMTspatialschedule::actionbindings bindings,
const std::vector< Spatial::FMTcoordinate > *  movable,
boost::unordered_map< Core::FMTdevelopment, bool > *  operability 
) const
protected

Do a loval move and disturb a random number of graph at a random period

◆ GetAcceptedCycleMoves()

size_t Models::FMTsamodel::GetAcceptedCycleMoves ( ) const
protected

Get the number of accepted move of the last cycle

◆ GetAMove()

FMTsamove Models::FMTsamodel::GetAMove ( const Spatial::FMTspatialschedule actual,
const Spatial::FMTspatialschedule::actionbindings bindings 
) const
protected

Will return coordinates that might be good candidat to disturb

◆ getcopy()

virtual std::unique_ptr< FMTmodel > Models::FMTsamodel::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::FMTsemodel.

◆ GetCycleMoves()

size_t Models::FMTsamodel::GetCycleMoves ( ) const
protected

Get the total number of moves of the last cycle

◆ GetFromBindings()

std::vector< bool > Models::FMTsamodel::GetFromBindings ( const Spatial::FMTspatialschedule::actionbindings bindingactions) const
protected

Get the selected action from the bindings

◆ GetLocalMoveSize()

size_t Models::FMTsamodel::GetLocalMoveSize ( ) const
protected

Generate the size of the local move.

◆ GetRebuild()

Spatial::FMTspatialschedule Models::FMTsamodel::GetRebuild ( const Spatial::FMTspatialschedule actual) const
protected

Take the actual non spatial solution of the actual solution and then Rebuild the solution using greedyreferencebuild

◆ InitialGrow()

void Models::FMTsamodel::InitialGrow ( )
protected

Do an initial grow till you reach the length of the model with the actual solution

◆ initialsolve()

bool Models::FMTsamodel::initialsolve ( )

Try to solve the model from a coldstart.

◆ IsBetter()

bool Models::FMTsamodel::IsBetter ( const Spatial::FMTspatialschedule actual,
const Spatial::FMTspatialschedule candidat 
) const
protected

Evaluate the actual and a candidat solution and return true if the candidat solution is choose to replace the actual solution.Based on a temp.

◆ isCycleProvenOptimal()

bool Models::FMTsamodel::isCycleProvenOptimal ( ) const
protected

Return true if is optimal based on the termination criteria of the actual temp level

◆ isProvenOptimal()

bool Models::FMTsamodel::isProvenOptimal ( ) const

Return true if is optimal based on the termination criteria

◆ LogCycleStatus()

void Models::FMTsamodel::LogCycleStatus ( ) const
protected

Log The temperature status and other usefull informations

◆ LogMovesReport()

void Models::FMTsamodel::LogMovesReport ( ) const

Log the Moves report

◆ LogSolutionStatus()

void Models::FMTsamodel::LogSolutionStatus ( ) const
protected

Log the status of the best solution

◆ Move()

Spatial::FMTspatialschedule Models::FMTsamodel::Move ( const Spatial::FMTspatialschedule actual,
const Spatial::FMTspatialschedule::actionbindings bindings,
const std::vector< Spatial::FMTcoordinate > *  movable = nullptr,
boost::unordered_map< Core::FMTdevelopment, bool > *  operability = nullptr 
) const
protected

Perturb a solution and produce a new one

◆ operator=()

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

Copy assignment operator.

◆ presolve()

virtual std::unique_ptr< FMTmodel > Models::FMTsamodel::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 unique pointer to 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 from Models::FMTsemodel.

◆ RandomBuild()

void Models::FMTsamodel::RandomBuild ( )
protected

Call a random build if there's no solution

◆ SchedulesBuild()

void Models::FMTsamodel::SchedulesBuild ( const std::vector< Core::FMTschedule > &  schedules)
protected

Call schedules if there's no solution

◆ solve()

virtual bool Models::FMTsamodel::solve ( )
virtual

This function call initialsolve on the solver.

Reimplemented from Models::FMTmodel.

◆ swap_ptr()

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

Swap with an abstract FMTmodel

Reimplemented from Models::FMTsemodel.

◆ UpdateFailedMoveCount()

void Models::FMTsamodel::UpdateFailedMoveCount ( )
protected

Update failed move count using NotAcceptedMovesCount and the move stats

◆ Warmup()

double Models::FMTsamodel::Warmup ( const Spatial::FMTspatialschedule actual,
const Spatial::FMTspatialschedule::actionbindings bindings,
const std::vector< Spatial::FMTcoordinate > *  movable = nullptr,
boost::unordered_map< Core::FMTdevelopment, bool > *  operability = nullptr,
double  initprobability = 0.5,
size_t  iterations = 10 
)
protected

Using an initprobability close to one, a base solution and a bunch of iterations get a initial temperature.

Friends And Related Function Documentation

◆ boost::serialization::access

friend class boost::serialization::access
friend

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


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