Heuristic to solve the spatialization problem across a landscape for multiple operating areas.
More...
|
| double | generateInitialProportionOfSet () const |
| | Compute a good proportion of set for the initialSolve, defaulting to 0.25 and decreasing linearly with the scheme complexity to a minimum of 0.01.
|
| |
| bool | empty () const |
| | Return true if the operating areas are empty.
|
| |
| bool | initialSolve () final |
| | Solve the heuristic problem until an initial solution is found for each operating area.
|
| |
| bool | branchNBoundSolve () final |
| | Solve the problem using branch and bound on the primal formulation, using the heuristic solution as a starting MIP solution when initialSolve has been called.
|
| |
| bool | greedyPass (const double &initsol, const unsigned int &iteration) final |
| | Do a greedy pass to try to improve the solution.
|
| |
| void | setAsRandom () |
| | Set the randomness member to true.
|
| |
| void | setAsPrimal () |
| | Set the primal member to true.
|
| |
| void | setProportionOfSet (const double &proportion) |
| | Set the allowed proportion of operating area status change before resolving the problem.
|
| |
| std::vector< Core::FMTTimeYieldHandler > | getSolution (const std::string &yldname) const |
| | Return the actual solution as a vector of time yield handlers, one per operating area.
|
| |
| std::vector< Core::FMTOutput > | getLevelSolution (const std::string &outputname, const std::string &aggregate, int outputid) const |
| | Return the lower bounds of the solution for each operating area as two outputs: the level and the variable output to bound to.
|
| |
| | FMTOperatingAreaScheduler (const std::vector< FMTOperatingAreaScheme > &loperatingareas, const Graph::FMTGraph< Graph::FMTVertexProperties, Graph::FMTEdgeProperties > &maingraph, const Models::FMTModel &model, const Core::FMTOutputNode &target, Models::FMTLpSolver &basesolve, size_t lseed=0, double proportionofset=0.25, bool userandomness=false, bool copysolver=true) |
| | Main constructor for FMTOperatingAreaScheduler, taking the information coming from a FMTLpModel.
|
| |
| | FMTOperatingAreaScheduler ()=default |
| | Default constructor for FMTOperatingAreaScheduler.
|
| |
| | FMTOperatingAreaScheduler (const FMTOperatingAreaScheduler &rhs) |
| | Copy constructor for FMTOperatingAreaScheduler.
|
| |
| | FMTOperatingAreaScheduler (FMTOperatingAreaScheduler &&rhs)=default |
| | Move constructor for FMTOperatingAreaScheduler.
|
| |
| FMTOperatingAreaScheduler & | operator= (const FMTOperatingAreaScheduler &rhs) |
| | Copy assignment operator for FMTOperatingAreaScheduler.
|
| |
| | ~FMTOperatingAreaScheduler () |
| | Destructor for FMTOperatingAreaScheduler.
|
| |
| void | setGeneratorSeed (const size_t &lseed) |
| | Set the seed of the random generator.
|
| |
| | FMTLpHeuristic (Models::FMTLpSolver &basesolve, size_t lseed=0, bool copysolver=true) |
| | Main constructor for FMTLpHeuristic from a base solver, taking the information coming from a FMTLpModel.
|
| |
| | FMTLpHeuristic (const Models::FMTSolverInterface &interfacetype, const size_t &lseed) |
| | Construct a FMTLpHeuristic from a solver type and a seed.
|
| |
| | FMTLpHeuristic ()=default |
| | Default constructor for FMTLpHeuristic.
|
| |
| | FMTLpHeuristic (const FMTLpHeuristic &rhs) |
| | Copy constructor for FMTLpHeuristic.
|
| |
| | FMTLpHeuristic (FMTLpHeuristic &&rhs)=default |
| | Move constructor for FMTLpHeuristic.
|
| |
| FMTLpHeuristic & | operator= (const FMTLpHeuristic &rhs) |
| | Copy assignment operator for FMTLpHeuristic.
|
| |
| virtual bool | branchNBoundSolve () |
| | Solve the problem using branch and bound on the primal formulation, using the heuristic solution as a starting MIP solution when initialSolve has been called.
|
| |
| virtual bool | greedyPass (const double &initsol, const unsigned int &iteration) |
| | Do a greedy pass to try to improve the solution.
|
| |
| virtual void | parallelOptimize (const double &initbestsolution, const unsigned int &iterations, const double &maxtime, const std::chrono::steady_clock::time_point &Starttime) |
| | Optimize the heuristic in parallel until the maximum number of iterations or the maximum time is reached.
|
| |
| virtual | ~FMTLpHeuristic ()=default |
| | Default virtual destructor for FMTLpHeuristic.
|
| |
| void | swap (FMTLpSolver &rhs) |
| | Swap this FMTLpSolver with another one.
|
| |
| void | passInLogger (const std::unique_ptr< Logging::FMTLogger > &logger) override |
| | Pass in the logger, overridden for the OsiSolverInterface.
|
| |
| void | unmarkHotStart () |
| | Clear all cached data in the OsiSolverInterface.
|
| |
| bool | stockResolve () |
| | Call the plain OsiSolverInterface resolve, synchronizing the matrix first.
|
| |
| | FMTLpSolver () |
| | Default constructor for FMTLpSolver.
|
| |
| virtual | ~FMTLpSolver ()=default |
| | Default virtual destructor for FMTLpSolver.
|
| |
| | FMTLpSolver (const FMTLpSolver &rhs) |
| | Default copy constructor for FMTLpSolver.
|
| |
| | FMTLpSolver (FMTLpSolver &&rhs)=default |
| | Default move constructor for FMTLpSolver.
|
| |
| FMTLpSolver & | operator= (const FMTLpSolver &rhs) |
| | Copy assignment operator for FMTLpSolver.
|
| |
| FMTLpSolver & | operator= (FMTLpSolver &&rhs)=default |
| | Default move assignment for FMTLpSolver.
|
| |
| | FMTLpSolver (FMTSolverInterface lsolvertype, const std::string &p_ColdStartParameters, const std::string &p_WarmStartParameters, const std::string &p_problemName) |
| | Main constructor for FMTLpSolver with a solver type, cold and warm start parameters and a problem name.
|
| |
| bool | operator== (const FMTLpSolver &rhs) const |
| | Comparison operator for FMTLpSolver.
|
| |
| bool | operator!= (const FMTLpSolver &rhs) const |
| | Inequality operator for FMTLpSolver.
|
| |
| virtual bool | resolve () |
| | Call solverinterface->resolve when some changes are done to the model, avoiding a full initialSolve.
|
| |
| virtual bool | initialSolve () |
| | Cold start of the LP solve of a simple LP model.
|
| |
| void | setNumberOfThreads (const size_t &nthread) |
| | Set the maximum number of threads to be used by the solver.
|
| |
| void | setMipGapTolerance (const double &gap) |
| | Set the tolerance between the relaxed optimal and the integer optimal.
|
| |
| void | setOptimizerMaxTime (const double &time) |
| | Set the maximum amount of time the optimizer is allowed to spend on the optimization.
|
| |
| void | mipParameters () |
| | Set the mixed-integer optimizer parameters, including the way the feasibility pump heuristic is employed to improve solution quality.
|
| |
| double | getObjValue () const |
| | Get the objective value of the solved matrix.
|
| |
| int | getIterationCount () const |
| | Get the number of iterations done by the solver.
|
| |
| void | passInSolver (const FMTLpSolver &solver) |
| | Share the solver interface pointer of another solver.
|
| |
| void | passInMessageHandler (Logging::FMTLogger &logger) |
| | Pass the FMTLogger to the solver interface.
|
| |
| void | setSolverType (FMTSolverInterface &lsolvertype) const |
| | Setter of the solver type of the serializable matrix.
|
| |
| bool | gotLicense () const |
| | Return true if the license of the solver is available.
|
| |
| std::string | getSolverName () const |
| | Return the name of the solver used.
|
| |
| int | getNumCols () const |
| | Return the number of columns by looking in the solver interface and in the cache.
|
| |
| int | getNumRows () const |
| | Return the number of rows by looking in the solver interface and in the cache.
|
| |
| const double * | getObjCoefficients () const |
| | Return the objective coefficients of the matrix, synchronizing the solver interface with the cache first.
|
| |
| const double * | getColLower () const |
| | Return the column lower bounds of the matrix, synchronizing the solver interface with the cache first.
|
| |
| const double * | getColUpper () const |
| | Return the column upper bounds of the matrix, synchronizing the solver interface with the cache first.
|
| |
| const double * | getColSolution () const |
| | Return the column solution of the solver interface, without synchronizing with the cache.
|
| |
| const double * | getRowPrice () const |
| | Return the row price (dual solution) of the solver interface, without synchronizing with the cache.
|
| |
| const double * | getRowActivity () const |
| | Return the row activity of the solver interface, without synchronizing with the cache.
|
| |
| const double * | getRowUpper () const |
| | Return the row upper bounds of the solver interface, synchronizing with the cache first.
|
| |
| const double * | getRowLower () const |
| | Return the row lower bounds of the solver interface, synchronizing with the cache first.
|
| |
| int | getRow (int whichRow, double &rowLower, double &rowUpper, std::vector< int > &indices, std::vector< double > &elements) const |
| | Fill the bounds, indices and elements of a given row, trying to synchronize the matrix as little as possible.
|
| |
| int | getCol (int whichCol, double &colLower, double &colUpper, double &objectiveValue, std::vector< int > &indices, std::vector< double > &elements) const |
| | Fill the bounds, objective, indices and elements of a given column, trying to synchronize the matrix as little as possible.
|
| |
| double | getObjSense () const |
| | Return the objective sense of the solver interface, synchronizing with the cache first.
|
| |
| void | setObjective (const double *objectivevalues) |
| | Set the objective values of the columns of the matrix.
|
| |
| void | setObjSense (const double &newsense) |
| | Set the objective sense of the solver interface.
|
| |
| void | addRow (int numberInRow, const int *columns, const double *elements, double rowLower=-std::numeric_limits< double >::max(), double rowUpper=std::numeric_limits< double >::max()) |
| | Add a row with its columns, elements and bounds.
|
| |
| void | addCol (int numberInColumn, const int *rows, const double *elements, double columnLower=0.0, double columnUpper=std::numeric_limits< double >::max(), double objectiveValue=0.0) |
| | Add a column with its rows, elements, bounds and objective value.
|
| |
| void | addRows (const int numrows, const int *rowStarts, const int *columns, const double *elements, const double *rowlb, const double *rowub) |
| | Add multiple rows directly to the matrix, synchronizing the matrix with the cache first.
|
| |
| void | addCols (const int numcols, const int *columnStarts, const int *rows, const double *elements, const double *collb, const double *colub, const double *obj) |
| | Add multiple columns directly to the matrix, synchronizing the matrix with the cache first.
|
| |
| bool | isProvenOptimal () const |
| | Return true if the program is optimal, synchronizing the matrix with the cache first.
|
| |
| void | deleteRow (const int &rowindex) |
| | Delete a given row; if the cache is used it is only deleted from the cache.
|
| |
| void | deleteCol (const int &colindex) |
| | Delete a given column; if the cache is used it is only deleted from the cache.
|
| |
| void | deleteRows (int numberofrows, const int *rowindexes) |
| | Delete multiple rows; if the cache is used the matrix is synchronized before deleting the rows.
|
| |
| void | deleteCols (int numberofcols, const int *colindexes) |
| | Delete multiple columns; if the cache is used the matrix is synchronized before deleting the columns.
|
| |
| void | setColSolution (const double *newsolution) |
| | Set a solution for all columns of the solver interface, synchronizing the matrix first.
|
| |
| void | setRowPrice (const double *rowprice) |
| | Set a solution for all rows of the solver interface, synchronizing the matrix first.
|
| |
| void | setColSetBounds (const int *indexFirst, const int *indexLast, const double *boundlist) |
| | Synchronize the matrix and set the lower and upper bounds of a set of columns.
|
| |
| void | setRowSetBounds (const int *indexFirst, const int *indexLast, const double *boundlist) |
| | Synchronize the matrix and set the lower and upper bounds of a set of rows.
|
| |
| void | setInteger (const int &colindex) |
| | Synchronize the matrix and set a given column as integer.
|
| |
| void | setInteger (const int *indices, int len) |
| | Synchronize the matrix and set multiple columns as integer variables.
|
| |
| void | setColName (const std::string &name, const int &columnid) const |
| | Update the constraints and variables names.
|
| |
| void | setRowName (const std::string &name, const int &rowid) const |
| | Set a row name.
|
| |
| void | writeLp (const std::string &location) const |
| | Write the solver interface matrix to a file using the LP formulation.
|
| |
| void | writeMps (const std::string &location) const |
| | Write the solver interface matrix to a file using the MPS formulation.
|
| |
| void | branchAndBound () |
| | Synchronize the matrix cache and call the branch and bound MIP enumeration solver.
|
| |
| void | enableMatrixCaching () |
| | Enable the rows and columns caching when adding or deleting a variable to the solver interface, reducing the number of calls made to the OsiSolverInterface.
|
| |
| void | disableMatrixCaching () |
| | Synchronize the matrix cache with the solver interface and turn off the matrix caching.
|
| |
| FMTSolverInterface | getSolverType () const |
| | Return the solver type of the solver.
|
| |
| void | synchronize () |
| | Update the OsiSolverInterface using the cached matrix information (new or deleted rows and columns) when constraints or variables have been added or deleted.
|
| |
| void | sortDeletedCache () |
| | Sort and remove duplicates in the rows and columns to delete in the matrix cache.
|
| |
| const std::vector< int > & | getCacheDeletedConstraints () const |
| | Return the row ids that are in the cache and marked as deleted.
|
| |
| const std::vector< int > & | getCacheDeletedVariables () const |
| | Return the column ids that are in the cache and marked as deleted.
|
| |
| std::string | lowerNUpperToStr (const double &lower, const double &upper) const |
| | Convert double bounds to string bounds (-inf, inf).
|
| |
| std::string | getCacheElements () const |
| | Return the constraints and variables sitting in the matrix cache to be added to the solver interface, for debugging.
|
| |
| void | updateRowsAndColsNames (bool shortformat=true) |
| | Update the rows and columns names.
|
| |
| std::string | getMskErrorDesc (int error) const |
| | Return the description of an error code from Mosek.
|
| |
| bool | SupportsMultiThreading () const |
| | Return true if the solver support multithreading.
|
| |
| | 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) |
| |
|
| static std::vector< Models::FMTSolverInterface > | getAvailableSolverInterface () |
| | Return the available solver interfaces.
|
| |
| static std::string_view | toString (Models::FMTSolverInterface p_solver) |
| | return the string value of the solver
|
| |
| 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.
|
| |
| bool | canUpdateSource () const |
| | Return true if the solver interface source can be updated.
|
| |
| std::shared_ptr< OsiSolverInterface > | buildSolverInterface (const FMTSolverInterface &lsolvertype) const |
| | Build a shared pointer to a solver interface, passing the message handler to the pointer.
|
| |
| std::shared_ptr< OsiSolverInterface > | copySolverInterface (const std::shared_ptr< OsiSolverInterface > &solver_ptr, const FMTSolverInterface &lsolvertype) const |
| | Copy a shared pointer to a solver interface into another shared pointer, passing the message handler to the pointer.
|
| |
| void | clearRowCache () |
| | Clear the row caching of the OsiSolverInterface if Mosek is used.
|
| |
| const CoinPackedMatrix * | getMatrixByRow () const |
| | Return a CoinPackedMatrix by row of the problem, synchronizing the matrix first.
|
| |
| const CoinPackedMatrix * | getMatrixByCol () const |
| | Return a CoinPackedMatrix by column of the problem, synchronizing the matrix first.
|
| |
| 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 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.
|
| |
| std::default_random_engine | m_generator |
| | std random number generator of the heuristic each heuristic has it's own generator to generate different solution
|
| |
| size_t | m_seed |
| | The random engine seed need to be a data member when serializing the class.
|
| |
| bool | m_usingsolvercopy |
| | If true the heuristic will work from it's own copy of solverinterface, else it's going to work on the FMTLpModel solverinterface.
|
| |
| FMTMatrixBuild | matrixcache |
| | The matrix cache follow the constraints or variables that need to be added or removed to the problem.
|
| |
| FMTSolverInterface | solvertype |
| | Solver type used maybe usefull for initialSolve or resolve to know what solver we are using to speed-up the process.
|
| |
| 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.
|
| |