CYCLUS
prog_solver.h
Go to the documentation of this file.
1 #ifndef CYCLUS_SRC_PROG_SOLVER_H_
2 #define CYCLUS_SRC_PROG_SOLVER_H_
3 
4 #include <string>
5 
6 #include "OsiSolverInterface.hpp"
7 
8 #include "exchange_graph.h"
9 #include "exchange_solver.h"
10 
11 namespace cyclus {
12 
13 class ExchangeGraph;
14 
15 /// @brief The ProgSolver provides the implementation for a mathematical
16 /// programming solution to a resource exchange graph.
17 class ProgSolver: public ExchangeSolver {
18  public:
19  static const int kDefaultTimeout = 5 * 60; // 5 * 60 s/min == 5 minutes
20 
21  /// @param solver_t the solver type, either "cbc" or "clp"
22  /// @param tmax the maximum solution time, default kDefaultTimeout
23  /// @param exclusive_orders whether all orders must be exclusive or not,
24  /// default false
25  /// @param verbose print out a lot to stdout, default false
26  /// @param mps dump mps files for every solve, default false
27  /// @{
28  ProgSolver(std::string solver_t);
29  ProgSolver(std::string solver_t, double tmax);
30  ProgSolver(std::string solver_t, bool exclusive_orders);
31  ProgSolver(std::string solver_t, double tmax, bool exclusive_orders,
32  bool verbose, bool mps);
33  /// @}
34  virtual ~ProgSolver();
35 
36  protected:
37  /// @brief the ProgSolver solves an ExchangeGraph...
38  virtual double SolveGraph();
39 
40  private:
41  void WriteMPS();
42 
43  std::string solver_t_;
44  double tmax_;
45  bool verbose_, mps_;
46  OsiSolverInterface* iface_;
47 };
48 
49 } // namespace cyclus
50 
51 #endif // CYCLUS_SRC_PROG_SOLVER_H_
virtual double SolveGraph()
the ProgSolver solves an ExchangeGraph...
Definition: prog_solver.cc:55
void verbose()
tell the solver to be verbose
The ProgSolver provides the implementation for a mathematical programming solution to a resource exch...
Definition: prog_solver.h:17
ProgSolver(std::string solver_t)
Definition: prog_solver.cc:18
virtual ~ProgSolver()
Definition: prog_solver.cc:47
static const int kDefaultTimeout
Definition: prog_solver.h:19
taken directly from OsiSolverInterface.cpp on 2/17/14 from https://projects.coin-or.org/Osi/browser/trunk.
Definition: agent.cc:14
a very simple interface for solving translated resource exchanges