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