![]() |
FMT 1.2.0
Forest management tools for forest planning
|
Operating area scheme giving information about its opening time, green up and return time. More...
#include <FMTOperatingAreaScheme.h>
Public Member Functions | |
| void | setReturnTime (const size_t &minimalreturntime, const size_t &maximalreturntime) |
| Set the minimal and maximal return time. | |
| double | getThreshold () const |
| Get the threshold. | |
| size_t | getOpeningTime () const |
| Get the opening time. | |
| size_t | getMinimalReturnTime () const |
| Get the minimal return time. | |
| size_t | getRepetition () const |
| Get the repetition of the pattern. | |
| size_t | getMaximalReturnTime () const |
| Get the maximal return time. | |
| bool | empty () const |
| Check if the operating area is empty, which is possible if there is no potential development to operate. | |
| const std::vector< int > & | getOpeningBinaries () const |
| Return the variable indexes of the binaries of all the potential schemes of the operating area. | |
| size_t | getStartingPeriod () const |
| Return the starting period at which all the schemes of the operating area start. | |
| double | getBinariesSum (const double *primalsolution) const |
| Summarize the value of all the binary variables for all the potential schemes from the primal solution. | |
| double | getActivitySum (const double *dualsolution) const |
| Summarize the value of all the constraints for all the potential schemes from the dual solution. | |
| bool | isThresholdActivity (const double *dualsolution) const |
| Return true if every constraint activity is above the threshold. | |
| std::map< int, std::vector< int > > | getCommonBinaries (const FMTOperatingAreaScheme &neighbor) const |
| Return a map with the binary indexes of this operating area as keys and the binary indexes of the neighbor as elements, using the green up members. | |
| size_t | getPrimalSolutionIndex (const double *primalsolution) const |
| Return the index of the scheme the operating area is bounded to, from the primal solution. | |
| bool | getDualSolutionIndex (const double *upperbound, size_t &locid) const |
| Return the index of the scheme used by the operating area from the rows upper bounds. | |
| bool | havePotentialSolution (const double *primalsolution) const |
| Check if a scheme binary has a value greater than 0 in the primal solution, indicating a potential scheme to choose. | |
| bool | haveActivitySolution (const double *dualsolution) const |
| Check if a set of scheme constraints has an activity value greater than 0 in the dual solution, indicating a potential scheme to choose. | |
| bool | isAllPrimalBounded (const double *lowerbounds, const double *upperbounds) const |
| Return false if any binary lower or upper bound is not set to 1. | |
| bool | isAllDualBounded (const double *upperbounds) const |
| Return false if any constraint upper bound is different from 0. | |
| bool | isPrimalBounded (const double *lowerbounds, const double *upperbounds) const |
| Return true if any binary lower or upper bound is set to 1. | |
| bool | isDualBounded (const double *upperbounds) const |
| Return true if any constraint upper bound is set to 0. | |
| std::vector< size_t > | getPotentialPrimalSchemes (const double *p_primalsolution, const double *p_lowerbounds, const double *p_upperbounds, const std::vector< FMTOperatingAreaScheme > &p_neighbors) const |
| Return the potential scheme indexes from the primal solution, its bounds and the neighboring operating areas, ordered from the most to the least area used but greater than 0. | |
| std::vector< size_t > | getPotentialDualSchemes (const double *p_dualsolution, const double *p_upperbound, const std::vector< FMTOperatingAreaScheme > &p_neighbors) const |
| Return the potential scheme indexes from the dual solution, the rows upper bounds and the neighboring operating areas, ordered from the most to the least area used but greater than 0. | |
| void | getRessourcesToDelete (std::vector< int > &colstodelete, std::vector< int > &rowstodelete) const |
| Push all the variables and constraints of the operating area into the columns and rows to delete vectors. | |
| void | pushBinaries (std::vector< int > &targets) const |
| Push all the binaries into a targets vector. | |
| size_t | unboundAllPrimalSchemes (std::vector< int > &targets, std::vector< double > &bounds) const |
| Push the binary indexes into the targets vector and push 0 and 1 into the bounds. | |
| size_t | unboundAllDualSchemes (std::vector< int > &targets, std::vector< double > &bounds) const |
| Push the constraint indexes into the targets vector, push -inf and the area into the bounds, and return the id of the unbounded scheme. | |
| size_t | boundAllPrimalSchemes (std::vector< int > &targets, std::vector< double > &bounds, double boundvalue=1.0) const |
| Push the variable indexes into the targets vector and push the bound value into the bounds. | |
| size_t | boundAllDualSchemes (std::vector< int > &targets, std::vector< double > &bounds) const |
| Push the constraint indexes into the targets vector and push the bound value into the bounds. | |
| bool | boundPrimalScheme (std::vector< int > &targets, std::vector< double > &bounds, const size_t &schemeid) const |
| Push the variable index of a scheme binary into the targets vector and push 1 and 1 into the bounds. | |
| bool | unboundDualScheme (const double *rowactivities, std::vector< int > &targets, std::vector< double > &bounds, const size_t &schemeid, bool looseset=true) const |
| Push the constraints of a scheme into the targets vector with -inf and the area bounds, and push the constraints of the other schemes with 0 and 0 bounds. | |
| std::vector< double > | getPrimalSolution (const double *primalsolution) const |
| Return the yield solution of the primal problem by summing up all the binary variables into a single vector. | |
| std::vector< double > | getDualSolution (const double *upperbounds, const double *dualsolution, bool &canbreakneighboring) const |
| Return the yield solution of the dual problem by setting the selected scheme solution into a vector. | |
| std::vector< double > | getDualLowerBounds (const double *lowerbounds, const double *upperbounds) const |
| Return the lower bounds of the solution for bounding the minimal harvested area. | |
| void | setConstraints (const std::vector< std::vector< Graph::FMTGraph< Graph::FMTVertexProperties, Graph::FMTEdgeProperties >::FMTvertex_descriptor > > &vertices, const std::vector< Graph::FMTGraph< Graph::FMTVertexProperties, Graph::FMTEdgeProperties >::FMTvertex_descriptor > &totalareavertices, const Graph::FMTGraph< Graph::FMTVertexProperties, Graph::FMTEdgeProperties > &graph, Models::FMTLpSolver &solver, const double *primalsolution, const std::vector< int > &actionIDS) |
| Set up the constraints and variables using a matrix build and a primal solution, filling all the matrix element members. | |
| FMTOperatingAreaScheme (const FMTOperatingArea &oparea, const size_t &lopeningtime, const size_t &lreturntime, const size_t &lmaxreturntime, const size_t &lrepetition, const size_t &lgreenup, const size_t &lstartingperiod, double minimalarearatio=0.0) | |
| Main constructor for FMTOperatingAreaScheme. | |
| FMTOperatingAreaScheme ()=default | |
| Default constructor for FMTOperatingAreaScheme. | |
| FMTOperatingAreaScheme (const FMTOperatingAreaScheme &rhs)=default | |
| Copy constructor for FMTOperatingAreaScheme. | |
| FMTOperatingAreaScheme & | operator= (const FMTOperatingAreaScheme &rhs)=default |
| Copy assignment operator for FMTOperatingAreaScheme. | |
| void | fillBoundsNVariables (const double *lowerb, const double *upperb, std::vector< int > &constraintstargets, std::vector< double > &bounds) const |
| For each scheme constraint, take the constraint bounds of the actual model. | |
| bool | operator== (const FMTOperatingAreaScheme &rhs) const |
| Comparison operator for FMTOperatingAreaScheme. | |
| bool | operator!= (const FMTOperatingAreaScheme &rhs) const |
| Comparison operator for FMTOperatingAreaScheme. | |
| ~FMTOperatingAreaScheme ()=default | |
| Default destructor for FMTOperatingAreaScheme. | |
| FMTOperatingAreaScheme | preSolve (const Core::FMTMask &selectedmask, const std::vector< Core::FMTTheme > &presolvedthemes) const |
| Return a presolved FMTOperatingAreaScheme using a mask and a subset of the original themes. | |
| size_t | getNumberOfScheme () const |
| Return the number of schemes of the operating area, only usable after schemesToLp has been called. | |
| size_t | getNumberOfSimpleScheme () const |
| Return the number of simple schemes with a fixed return time and opening time. | |
| const int & | getRejectedNodesCid () const |
| Return the constraint id of the rejected nodes. | |
| const std::vector< std::vector< int > > & | getOpeningConstraints () const |
| Return the opening constraints of the operating area. | |
| const int & | getMaximalSchemesConstraint () const |
| Return the constraint id ensuring that only one scheme is chosen. | |
| const size_t & | getGreenUp () const |
| Return the green up. | |
Public Member Functions inherited from Heuristics::FMTOperatingArea | |
| FMTOperatingArea & | operator+= (const double &value) |
| Add area to the operating area. | |
| std::vector< Core::FMTMask > | getNeighbors () const |
| Return a copy of the neighbors masks of the operating area. | |
| double | getArea () const |
| Get the area of the operating area. | |
| double | getNeighborsPerimeter () const |
| Return the percentage of perimeter the operating area needs to share with another operating area to be considered a neighbor. | |
| Core::FMTMask | getMask () const |
| Return the mask of the operating area. | |
| void | setNeighbors (const std::vector< Core::FMTMask > &lneighbors) |
| Set the neighbors masks of the operating area. | |
| FMTOperatingArea (const Core::FMTMask &lmask, const double &lneighborsperimeter) | |
| Main constructor for FMTOperatingArea from a mask and a neighbors perimeter. | |
| void | setArea (const double &newarea) |
| Set the area of the operating area. | |
| FMTOperatingArea ()=default | |
| Default constructor for FMTOperatingArea. | |
| FMTOperatingArea (const FMTOperatingArea &rhs)=default | |
| Copy constructor for FMTOperatingArea. | |
| FMTOperatingArea & | operator= (const FMTOperatingArea &rhs)=default |
| Copy assignment operator for FMTOperatingArea. | |
| bool | operator== (const FMTOperatingArea &rhs) const |
| Comparison operator for FMTOperatingArea. | |
| bool | operator!= (const FMTOperatingArea &rhs) const |
| Comparison operator for FMTOperatingArea. | |
| virtual | ~FMTOperatingArea ()=default |
| Default destructor for FMTOperatingArea. | |
| FMTOperatingArea | preSolveOperatingArea (const Core::FMTMaskFilter &filter, const std::vector< Core::FMTTheme > &presolvedthemes) const |
| Return a presolved FMTOperatingArea using a mask filter and a subset of the original themes. | |
| FMTOperatingArea | postSolveOperatingArea (const Core::FMTMaskFilter &filter, const std::vector< Core::FMTTheme > &basethemes) const |
| Return a postsolved FMTOperatingArea using a mask filter and the original themes. | |
Public Member Functions inherited from Core::FMTObject | |
| FMTObject () | |
| Default constructor for FMTObject. | |
| virtual | ~FMTObject () |
| Default virtual destructor for FMTObject. | |
| FMTObject (const std::unique_ptr< Exception::FMTExceptionHandler > exhandler) | |
| Construct a FMTObject passing in the exception handler of another FMTObject. | |
| FMTObject (const FMTObject &rhs) | |
| Copy constructor for FMTObject. | |
| FMTObject & | operator= (const FMTObject &rhs) |
| Copy assignment operator for FMTObject. | |
| virtual void | passInLogger (const std::unique_ptr< Logging::FMTLogger > &logger) |
| Pass in the logger of another FMTObject. | |
| void | passInExceptionHandler (const std::unique_ptr< Exception::FMTExceptionHandler > &exhandler) |
| Pass in the exception handler of another FMTObject. | |
| void | redirectLogToFile (const std::string &location) |
| Redirect the log to a specific file, appending to it. | |
| virtual void | setDefaultLogger () |
| Create and set a default logger to the FMTObject. | |
| virtual void | setQuietLogger () |
| Create and set a quiet logger to the FMTObject. | |
| virtual void | setTaskLogger () |
| Create and set a task logger to the FMTObject. | |
| virtual void | setDebugLogger () |
| Create and set a debug logger to the FMTObject. | |
| void | setDefaultExceptionHandler () |
| Create and set a default exception handler to the FMTObject. | |
| void | setQuietExceptionHandler () |
| Create and set a quiet exception handler to the FMTObject. | |
| void | setDebugExceptionHandler () |
| Create and set a debug exception handler to the FMTObject. | |
| void | setFreeExceptionHandler () |
| Create and set a free exception handler to the FMTObject. | |
| void | disableNestedExceptions () |
| Disable the nested exception throw of the exception handler. | |
| void | enableNestedExceptions () |
| Enable the nested exception throw of the exception handler. | |
| void | setErrorsToWarnings (const std::vector< Exception::FMTexc > &errors) |
| Set a list of errors to be cast to warnings on the exception handler. | |
| void | setMaxWarningsBeforeSilenced (const size_t &maxwarningcount) |
| Set the number of warnings raised before being silenced. | |
| template<class Archive > | |
| void | serialize (Archive &ar, const unsigned int version) |
Friends | |
| class | boost::serialization::access |
| Serialize the FMTOperatingAreaScheme for multiprocessing across multiple cpus (pickle in Python). | |
Additional Inherited Members | |
Static Public Member Functions inherited from Core::FMTObject | |
| static Logging::FMTLogger * | getLogger () |
| get a pointer to the actual logger. | |
| static Exception::FMTExceptionHandler * | getExceptionHandler () |
| get a pointer to the actual exception handler. | |
| static std::string | getRuntimeLocation () |
| Return the location of the FMT shared library. | |
| static unsigned long long | getAvailableMemory () |
| Return the available memory in bytes. | |
| static void | setTerminateStack () |
| will write the stack in the log when terminate called and raise a function failed. | |
| static void | setAbortStack () |
| will write the stack in the log when abort called with SIGABRT and raise a function failed. | |
Protected Member Functions inherited from Core::FMTObject | |
| template<class Archive > | |
| void | forceSave (Archive &ar, const unsigned int version) const |
| Force the serialization to save useful information, which the default FMTObject serialization does not. | |
| template<class Archive > | |
| void | forceLoad (Archive &ar, const unsigned int version) |
| Force the serialization to load useful information, which the default FMTObject serialization does not. | |
| void | checkSignals () const |
| Check if the user has sent a ctrl-c signal using boost::python to FMT. | |
| void | setCplHandler () |
| Pass the FMT exception handler to the GDAL exception handler (GDAL only). | |
Static Protected Member Functions inherited from Core::FMTObject | |
| static std::chrono::time_point< std::chrono::high_resolution_clock > | getClock () |
| Return a clock of the current time. | |
| template<class chrono > | |
| static double | getDuration (const std::chrono::time_point< std::chrono::high_resolution_clock > &startclock) |
| Return the time elapsed since a start clock as a double. | |
| static std::string | getDurationInSeconds (const std::chrono::time_point< std::chrono::high_resolution_clock > &startclock) |
| Return the time elapsed since a start clock in seconds as a string. | |
| static void | _logStack () |
| Log the stack trace... | |
| static void | _terminate () |
| Raise an error with the boost stacktrace. | |
| static void | _abort (int p_signal) |
| Raise an error with the boost stacktrace on abort. | |
Protected Attributes inherited from Heuristics::FMTOperatingArea | |
| Core::FMTMask | m_mask |
| The mask describing the operating area. | |
| std::vector< Core::FMTMask > | m_neighbors |
| Neighbors mask of the operating area. | |
| double | m_neighborsperimeter |
| neighborsperimeter is the ratio a operatingarea needs to share to a other operatingarea to be considered neighbor. | |
| double | m_area |
| The initial area of the operating area used as big M for the MIP. | |
Static Protected Attributes inherited from Core::FMTObject | |
| static std::unique_ptr< Exception::FMTExceptionHandler > | _exhandler |
| A shared pointer to the exception handler. | |
| static std::unique_ptr< Logging::FMTLogger > | _logger |
| A shared pointer to the logger. | |
Operating area scheme giving information about its opening time, green up and return time.
The operating area scheme has to be based on static themes not used within transitions. Multiple potential schedules are generated for the FMTOperatingArea formulated as a heuristic and/or MIP.
| Heuristics::FMTOperatingAreaScheme::FMTOperatingAreaScheme | ( | const FMTOperatingArea & | oparea, |
| const size_t & | lopeningtime, | ||
| const size_t & | lreturntime, | ||
| const size_t & | lmaxreturntime, | ||
| const size_t & | lrepetition, | ||
| const size_t & | lgreenup, | ||
| const size_t & | lstartingperiod, | ||
| double | minimalarearatio = 0.0 |
||
| ) |
Main constructor for FMTOperatingAreaScheme.
Before synchronizing to the solver interface, the user has to provide the green up, return time and other parameters for each operating area.
| [in] | oparea | the operating area. |
| [in] | lopeningtime | the opening time. |
| [in] | lreturntime | the return time. |
| [in] | lmaxreturntime | the maximal return time. |
| [in] | lrepetition | the repetition. |
| [in] | lgreenup | the green up. |
| [in] | lstartingperiod | the starting period. |
| [in] | minimalarearatio | the minimal area ratio needed to open the operating area. |
|
default |
Default constructor for FMTOperatingAreaScheme.
|
default |
Copy constructor for FMTOperatingAreaScheme.
| [in] | rhs | the FMTOperatingAreaScheme to copy. |
|
default |
Default destructor for FMTOperatingAreaScheme.
| size_t Heuristics::FMTOperatingAreaScheme::boundAllDualSchemes | ( | std::vector< int > & | targets, |
| std::vector< double > & | bounds | ||
| ) | const |
Push the constraint indexes into the targets vector and push the bound value into the bounds.
| [in,out] | targets | the targets. |
| [in,out] | bounds | the bounds. |
| size_t Heuristics::FMTOperatingAreaScheme::boundAllPrimalSchemes | ( | std::vector< int > & | targets, |
| std::vector< double > & | bounds, | ||
| double | boundvalue = 1.0 |
||
| ) | const |
Push the variable indexes into the targets vector and push the bound value into the bounds.
| [in,out] | targets | the targets. |
| [in,out] | bounds | the bounds. |
| [in] | boundvalue | the bound value. |
| bool Heuristics::FMTOperatingAreaScheme::boundPrimalScheme | ( | std::vector< int > & | targets, |
| std::vector< double > & | bounds, | ||
| const size_t & | schemeid | ||
| ) | const |
Push the variable index of a scheme binary into the targets vector and push 1 and 1 into the bounds.
| [in,out] | targets | the targets. |
| [in,out] | bounds | the bounds. |
| [in] | schemeid | the scheme id. |
| bool Heuristics::FMTOperatingAreaScheme::empty | ( | ) | const |
Check if the operating area is empty, which is possible if there is no potential development to operate.
| void Heuristics::FMTOperatingAreaScheme::fillBoundsNVariables | ( | const double * | lowerb, |
| const double * | upperb, | ||
| std::vector< int > & | constraintstargets, | ||
| std::vector< double > & | bounds | ||
| ) | const |
For each scheme constraint, take the constraint bounds of the actual model.
| [in] | lowerb | the lower bounds. |
| [in] | upperb | the upper bounds. |
| [in,out] | constraintstargets | the constraints targets. |
| [in,out] | bounds | the bounds. |
| double Heuristics::FMTOperatingAreaScheme::getActivitySum | ( | const double * | dualsolution | ) | const |
Summarize the value of all the constraints for all the potential schemes from the dual solution.
| [in] | dualsolution | the dual solution. |
| double Heuristics::FMTOperatingAreaScheme::getBinariesSum | ( | const double * | primalsolution | ) | const |
Summarize the value of all the binary variables for all the potential schemes from the primal solution.
| [in] | primalsolution | the primal solution. |
| std::map< int, std::vector< int > > Heuristics::FMTOperatingAreaScheme::getCommonBinaries | ( | const FMTOperatingAreaScheme & | neighbor | ) | const |
Return a map with the binary indexes of this operating area as keys and the binary indexes of the neighbor as elements, using the green up members.
Used to validate which schemes of an operating area constrain the usage of the schemes of a neighbor.
| [in] | neighbor | the neighbor operating area. |
| std::vector< double > Heuristics::FMTOperatingAreaScheme::getDualLowerBounds | ( | const double * | lowerbounds, |
| const double * | upperbounds | ||
| ) | const |
Return the lower bounds of the solution for bounding the minimal harvested area.
| [in] | lowerbounds | the lower bounds. |
| [in] | upperbounds | the upper bounds. |
| std::vector< double > Heuristics::FMTOperatingAreaScheme::getDualSolution | ( | const double * | upperbounds, |
| const double * | dualsolution, | ||
| bool & | canbreakneighboring | ||
| ) | const |
Return the yield solution of the dual problem by setting the selected scheme solution into a vector.
| [in] | upperbounds | the upper bounds. |
| [in] | dualsolution | the dual solution. |
| [out] | canbreakneighboring | true if the neighboring can be broken. |
| bool Heuristics::FMTOperatingAreaScheme::getDualSolutionIndex | ( | const double * | upperbound, |
| size_t & | locid | ||
| ) | const |
Return the index of the scheme used by the operating area from the rows upper bounds.
| [in] | upperbound | the rows upper bounds. |
| [out] | locid | the scheme index. |
|
inline |
Return the green up.
| size_t Heuristics::FMTOperatingAreaScheme::getMaximalReturnTime | ( | ) | const |
Get the maximal return time.
| const int & Heuristics::FMTOperatingAreaScheme::getMaximalSchemesConstraint | ( | ) | const |
Return the constraint id ensuring that only one scheme is chosen.
| size_t Heuristics::FMTOperatingAreaScheme::getMinimalReturnTime | ( | ) | const |
Get the minimal return time.
| size_t Heuristics::FMTOperatingAreaScheme::getNumberOfScheme | ( | ) | const |
Return the number of schemes of the operating area, only usable after schemesToLp has been called.
| size_t Heuristics::FMTOperatingAreaScheme::getNumberOfSimpleScheme | ( | ) | const |
Return the number of simple schemes with a fixed return time and opening time.
| const std::vector< int > & Heuristics::FMTOperatingAreaScheme::getOpeningBinaries | ( | ) | const |
Return the variable indexes of the binaries of all the potential schemes of the operating area.
| const std::vector< std::vector< int > > & Heuristics::FMTOperatingAreaScheme::getOpeningConstraints | ( | ) | const |
Return the opening constraints of the operating area.
| size_t Heuristics::FMTOperatingAreaScheme::getOpeningTime | ( | ) | const |
Get the opening time.
| std::vector< size_t > Heuristics::FMTOperatingAreaScheme::getPotentialDualSchemes | ( | const double * | p_dualsolution, |
| const double * | p_upperbound, | ||
| const std::vector< FMTOperatingAreaScheme > & | p_neighbors | ||
| ) | const |
Return the potential scheme indexes from the dual solution, the rows upper bounds and the neighboring operating areas, ordered from the most to the least area used but greater than 0.
| [in] | p_dualsolution | the dual solution. |
| [in] | p_upperbound | the rows upper bounds. |
| [in] | p_neighbors | the neighboring operating areas. |
| std::vector< size_t > Heuristics::FMTOperatingAreaScheme::getPotentialPrimalSchemes | ( | const double * | p_primalsolution, |
| const double * | p_lowerbounds, | ||
| const double * | p_upperbounds, | ||
| const std::vector< FMTOperatingAreaScheme > & | p_neighbors | ||
| ) | const |
Return the potential scheme indexes from the primal solution, its bounds and the neighboring operating areas, ordered from the most to the least area used but greater than 0.
| [in] | p_primalsolution | the primal solution. |
| [in] | p_lowerbounds | the lower bounds. |
| [in] | p_upperbounds | the upper bounds. |
| [in] | p_neighbors | the neighboring operating areas. |
| std::vector< double > Heuristics::FMTOperatingAreaScheme::getPrimalSolution | ( | const double * | primalsolution | ) | const |
Return the yield solution of the primal problem by summing up all the binary variables into a single vector.
| [in] | primalsolution | the primal solution. |
| size_t Heuristics::FMTOperatingAreaScheme::getPrimalSolutionIndex | ( | const double * | primalsolution | ) | const |
Return the index of the scheme the operating area is bounded to, from the primal solution.
| [in] | primalsolution | the primal solution. |
| const int & Heuristics::FMTOperatingAreaScheme::getRejectedNodesCid | ( | ) | const |
Return the constraint id of the rejected nodes.
| size_t Heuristics::FMTOperatingAreaScheme::getRepetition | ( | ) | const |
Get the repetition of the pattern.
| void Heuristics::FMTOperatingAreaScheme::getRessourcesToDelete | ( | std::vector< int > & | colstodelete, |
| std::vector< int > & | rowstodelete | ||
| ) | const |
Push all the variables and constraints of the operating area into the columns and rows to delete vectors.
| [in,out] | colstodelete | the columns to delete. |
| [in,out] | rowstodelete | the rows to delete. |
| size_t Heuristics::FMTOperatingAreaScheme::getStartingPeriod | ( | ) | const |
Return the starting period at which all the schemes of the operating area start.
| double Heuristics::FMTOperatingAreaScheme::getThreshold | ( | ) | const |
Get the threshold.
| bool Heuristics::FMTOperatingAreaScheme::haveActivitySolution | ( | const double * | dualsolution | ) | const |
Check if a set of scheme constraints has an activity value greater than 0 in the dual solution, indicating a potential scheme to choose.
| [in] | dualsolution | the dual solution. |
| bool Heuristics::FMTOperatingAreaScheme::havePotentialSolution | ( | const double * | primalsolution | ) | const |
Check if a scheme binary has a value greater than 0 in the primal solution, indicating a potential scheme to choose.
| [in] | primalsolution | the primal solution. |
| bool Heuristics::FMTOperatingAreaScheme::isAllDualBounded | ( | const double * | upperbounds | ) | const |
Return false if any constraint upper bound is different from 0.
| [in] | upperbounds | the upper bounds. |
| bool Heuristics::FMTOperatingAreaScheme::isAllPrimalBounded | ( | const double * | lowerbounds, |
| const double * | upperbounds | ||
| ) | const |
Return false if any binary lower or upper bound is not set to 1.
| [in] | lowerbounds | the lower bounds. |
| [in] | upperbounds | the upper bounds. |
| bool Heuristics::FMTOperatingAreaScheme::isDualBounded | ( | const double * | upperbounds | ) | const |
Return true if any constraint upper bound is set to 0.
| [in] | upperbounds | the upper bounds. |
| bool Heuristics::FMTOperatingAreaScheme::isPrimalBounded | ( | const double * | lowerbounds, |
| const double * | upperbounds | ||
| ) | const |
Return true if any binary lower or upper bound is set to 1.
| [in] | lowerbounds | the lower bounds. |
| [in] | upperbounds | the upper bounds. |
| bool Heuristics::FMTOperatingAreaScheme::isThresholdActivity | ( | const double * | dualsolution | ) | const |
Return true if every constraint activity is above the threshold.
| [in] | dualsolution | the dual solution. |
| bool Heuristics::FMTOperatingAreaScheme::operator!= | ( | const FMTOperatingAreaScheme & | rhs | ) | const |
Comparison operator for FMTOperatingAreaScheme.
| [in] | rhs | the FMTOperatingAreaScheme to compare to. |
|
default |
Copy assignment operator for FMTOperatingAreaScheme.
| [in] | rhs | the FMTOperatingAreaScheme to copy. |
| bool Heuristics::FMTOperatingAreaScheme::operator== | ( | const FMTOperatingAreaScheme & | rhs | ) | const |
Comparison operator for FMTOperatingAreaScheme.
| [in] | rhs | the FMTOperatingAreaScheme to compare to. |
| FMTOperatingAreaScheme Heuristics::FMTOperatingAreaScheme::preSolve | ( | const Core::FMTMask & | selectedmask, |
| const std::vector< Core::FMTTheme > & | presolvedthemes | ||
| ) | const |
Return a presolved FMTOperatingAreaScheme using a mask and a subset of the original themes.
| [in] | selectedmask | the selected mask. |
| [in] | presolvedthemes | the presolved themes. |
| void Heuristics::FMTOperatingAreaScheme::pushBinaries | ( | std::vector< int > & | targets | ) | const |
Push all the binaries into a targets vector.
| [in,out] | targets | the targets. |
| void Heuristics::FMTOperatingAreaScheme::setConstraints | ( | const std::vector< std::vector< Graph::FMTGraph< Graph::FMTVertexProperties, Graph::FMTEdgeProperties >::FMTvertex_descriptor > > & | vertices, |
| const std::vector< Graph::FMTGraph< Graph::FMTVertexProperties, Graph::FMTEdgeProperties >::FMTvertex_descriptor > & | totalareavertices, | ||
| const Graph::FMTGraph< Graph::FMTVertexProperties, Graph::FMTEdgeProperties > & | graph, | ||
| Models::FMTLpSolver & | solver, | ||
| const double * | primalsolution, | ||
| const std::vector< int > & | actionIDS | ||
| ) |
Set up the constraints and variables using a matrix build and a primal solution, filling all the matrix element members.
The user has to synchronize the matrix build to the matrix after iterating on all the operating areas.
| [in] | vertices | the vertices. |
| [in] | totalareavertices | the initial vertices. |
| [in] | graph | the graph. |
| [in,out] | solver | the solver. |
| [in] | primalsolution | the primal solution. |
| [in] | actionIDS | the action ids. |
| void Heuristics::FMTOperatingAreaScheme::setReturnTime | ( | const size_t & | minimalreturntime, |
| const size_t & | maximalreturntime | ||
| ) |
Set the minimal and maximal return time.
| [in] | minimalreturntime | the minimal return time. |
| [in] | maximalreturntime | the maximal return time. |
| size_t Heuristics::FMTOperatingAreaScheme::unboundAllDualSchemes | ( | std::vector< int > & | targets, |
| std::vector< double > & | bounds | ||
| ) | const |
Push the constraint indexes into the targets vector, push -inf and the area into the bounds, and return the id of the unbounded scheme.
| [in,out] | targets | the targets. |
| [in,out] | bounds | the bounds. |
| size_t Heuristics::FMTOperatingAreaScheme::unboundAllPrimalSchemes | ( | std::vector< int > & | targets, |
| std::vector< double > & | bounds | ||
| ) | const |
Push the binary indexes into the targets vector and push 0 and 1 into the bounds.
| [in,out] | targets | the targets. |
| [in,out] | bounds | the bounds. |
| bool Heuristics::FMTOperatingAreaScheme::unboundDualScheme | ( | const double * | rowactivities, |
| std::vector< int > & | targets, | ||
| std::vector< double > & | bounds, | ||
| const size_t & | schemeid, | ||
| bool | looseset = true |
||
| ) | const |
Push the constraints of a scheme into the targets vector with -inf and the area bounds, and push the constraints of the other schemes with 0 and 0 bounds.
| [in] | rowactivities | the row activities. |
| [in,out] | targets | the targets. |
| [in,out] | bounds | the bounds. |
| [in] | schemeid | the scheme id. |
| [in] | looseset | if true uses a loose set. |
|
friend |
Serialize the FMTOperatingAreaScheme for multiprocessing across multiple cpus (pickle in Python).
| Archive | the archive type. |
| [in,out] | ar | the archive to serialize to or from. |
| [in] | version | the serialization version. |