This class is a prototype of an Linear Programming (LP) Solver for the planning problem or a subset of it. More...
#include <lpsolver.h>

Public Member Functions | |
void | addObjective (const string &c) |
void | endElement (XMLInput &pIn, const Attribute &pAttr, const DataElement &pElement) |
virtual PyObject * | getattro (const Attribute &) |
string | getDataFile () const |
bool | getMinimum () const |
string | getModelFile () const |
const list< string > & | getObjectives () const |
virtual size_t | getSize () const |
string | getSolutionFile () const |
virtual const MetaClass & | getType () const |
LPSolver (const string &n) | |
virtual int | setattro (const Attribute &, const PythonObject &) |
void | setDataFile (const string &c) |
void | setMinimum (bool m) |
void | setModelFile (const string &c) |
void | setSolutionFile (const string &c) |
void | solve (void *=NULL) |
virtual void | writeElement (XMLOutput *, const Keyword &, mode=DEFAULT) const |
~LPSolver () | |
Static Public Member Functions | |
static int | initialize () |
Static Public Attributes | |
static const MetaClass * | metadata |
Detailed Description
This class is a prototype of an Linear Programming (LP) Solver for the planning problem or a subset of it.
The solver is intended primarly for prototyping purposes. Cleaner and more performant alternatives are recommended for real production use.
Definition at line 107 of file lpsolver.h.
Constructor & Destructor Documentation
module_lp_solver::LPSolver::LPSolver | ( | const string & | n | ) | [inline] |
Constructor.
Definition at line 157 of file lpsolver.h.
module_lp_solver::LPSolver::~LPSolver | ( | ) | [inline] |
Destructor.
Definition at line 160 of file lpsolver.h.
Member Function Documentation
void module_lp_solver::LPSolver::addObjective | ( | const string & | c | ) | [inline] |
Append a new objective to the list.
Definition at line 145 of file lpsolver.h.
void module_lp_solver::LPSolver::endElement | ( | XMLInput & | , |
const Attribute & | , | ||
const DataElement & | |||
) | [virtual] |
Called while restoring the model from an XML-file.
This is called when the corresponding close element tag is encountered, and the Data() member of pElement is valid.
Reimplemented from frepple::Solver.
Definition at line 237 of file lpsolver.cpp.
PyObject * module_lp_solver::LPSolver::getattro | ( | const Attribute & | attr | ) | [virtual] |
Default getattro method.
Subclasses are expected to implement an override if the type supports gettattro.
Reimplemented from frepple::Solver.
Definition at line 257 of file lpsolver.cpp.
string module_lp_solver::LPSolver::getDataFile | ( | ) | const [inline] |
Return the name of the GNU MathProg data file.
Definition at line 123 of file lpsolver.h.
bool module_lp_solver::LPSolver::getMinimum | ( | ) | const [inline] |
Returns true when the solver needs to minimize the objective(s).
Returns false when the solver needs to maximize the objective(s).
Definition at line 139 of file lpsolver.h.
string module_lp_solver::LPSolver::getModelFile | ( | ) | const [inline] |
Return the name of the GNU MathProg model file.
Definition at line 117 of file lpsolver.h.
const list<string>& module_lp_solver::LPSolver::getObjectives | ( | ) | const [inline] |
Return a reference to the list of objectives.
Definition at line 148 of file lpsolver.h.
virtual size_t module_lp_solver::LPSolver::getSize | ( | ) | const [inline, virtual] |
Return the memory size of the object in bytes.
Implements frepple::utils::Object.
Definition at line 164 of file lpsolver.h.
string module_lp_solver::LPSolver::getSolutionFile | ( | ) | const [inline] |
Return the name of the solution file.
Definition at line 129 of file lpsolver.h.
virtual const MetaClass& module_lp_solver::LPSolver::getType | ( | ) | const [inline, virtual] |
This returns the type information on the object, a bit similar to the standard type_info information.
Reimplemented from frepple::Solver.
Definition at line 162 of file lpsolver.h.
int module_lp_solver::LPSolver::initialize | ( | ) | [static] |
Reimplemented from frepple::Solver.
Definition at line 77 of file lpsolver.cpp.
int module_lp_solver::LPSolver::setattro | ( | const Attribute & | attr, |
const PythonObject & | field | ||
) | [virtual] |
Default setattro method.
Subclasses are expected to implement an override if the type supports settattro.
Reimplemented from frepple::Solver.
Definition at line 283 of file lpsolver.cpp.
void module_lp_solver::LPSolver::setDataFile | ( | const string & | c | ) | [inline] |
Update the name of the GNU MathProg data file.
Definition at line 126 of file lpsolver.h.
void module_lp_solver::LPSolver::setMinimum | ( | bool | m | ) | [inline] |
Update the solver direction: minimization or maximization.
Definition at line 142 of file lpsolver.h.
void module_lp_solver::LPSolver::setModelFile | ( | const string & | c | ) | [inline] |
Update the name of the GNU MathProg model file.
Definition at line 120 of file lpsolver.h.
void module_lp_solver::LPSolver::setSolutionFile | ( | const string & | c | ) | [inline] |
Update the name of the solution file.
After running the solver the solution is written to this flat file.
Definition at line 134 of file lpsolver.h.
void module_lp_solver::LPSolver::solve | ( | void * | v = NULL | ) | [virtual] |
This method creates a new column in the model for every demand. It's value represents the planned quantity of that demand.
- Exceptions:
-
DataException Generated when no calendar has been specified.
Implements frepple::Solver.
Definition at line 127 of file lpsolver.cpp.
void module_lp_solver::LPSolver::writeElement | ( | XMLOutput * | , |
const Keyword & | , | ||
mode | = DEFAULT |
||
) | const [virtual] |
Called while writing the model into an XML-file. The user class should write itself out, using the IOutStream members for its "simple" members and calling writeElement recursively for any contained objects. Not all classes are expected to implement this method. In instances of such a class can be created but can't be persisted. E.g. Command
Reimplemented from frepple::Solver.
Definition at line 209 of file lpsolver.cpp.
Member Data Documentation
const MetaClass * module_lp_solver::LPSolver::metadata [static] |
Reimplemented from frepple::Solver.
Definition at line 163 of file lpsolver.h.
The documentation for this class was generated from the following files:
Documentation generated for frePPLe by
