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 () | |
![]() | |
unsigned short | getLogLevel () const |
void | setLogLevel (unsigned short v) |
virtual void | solve (const Demand *, void *=NULL) |
virtual void | solve (const Operation *, void *=NULL) |
virtual void | solve (const OperationFixedTime *o, void *v=NULL) |
virtual void | solve (const OperationTimePer *o, void *v=NULL) |
virtual void | solve (const OperationRouting *o, void *v=NULL) |
virtual void | solve (const OperationAlternate *o, void *v=NULL) |
virtual void | solve (const Resource *, void *=NULL) |
virtual void | solve (const ResourceInfinite *r, void *v=NULL) |
virtual void | solve (const Buffer *, void *=NULL) |
virtual void | solve (const BufferInfinite *b, void *v=NULL) |
virtual void | solve (const BufferProcure *b, void *v=NULL) |
virtual void | solve (const Load *b, void *v=NULL) |
virtual void | solve (const Flow *b, void *v=NULL) |
virtual void | solve (const FlowEnd *b, void *v=NULL) |
virtual void | solve (const Solvable *, void *=NULL) |
Solver (const string &n) | |
virtual | ~Solver () |
![]() | |
int | compare (const PyObject *other) const |
void | endElement (XMLInput &pIn, const Attribute &pAttr, const DataElement &pElement) |
HasName (const string &n) | |
HasName (const char *n) | |
void | setName (const string &newname) |
virtual PyObject * | str () const |
~HasName () | |
![]() | |
TreeNode * | decrement () const |
const string & | getName () const |
TreeNode * | increment () const |
bool | operator< (const TreeNode &o) |
TreeNode (const string &n) | |
virtual | ~TreeNode () |
![]() | |
virtual void | beginElement (XMLInput &, const Attribute &) |
virtual bool | getHidden () const |
Object () | |
virtual void | setHidden (bool b) |
virtual | ~Object () |
![]() | |
virtual PyObject * | call (const PythonObject &args, const PythonObject &kwds) |
Py_ssize_t | getReferenceCount () const |
void | initType (const MetaClass *t) |
void | initType (PyTypeObject *t) |
virtual PyObject * | iternext () |
PythonExtensionBase () | |
void | resetReferenceCount () |
virtual | ~PythonExtensionBase () |
Static Public Member Functions | |
static int | initialize () |
![]() | |
static int | initialize () |
static PyObject * | solve (PyObject *, PyObject *) |
![]() | |
static Solver * | add (const string &k, const MetaClass &cls) |
static Solver * | add (Solver *t) |
static Solver * | add (Solver *t, Solver *hint) |
static iterator | begin () |
static void | clear () |
static bool | empty () |
static iterator | end () |
static Solver * | find (const string &k) |
static Solver * | findLowerBound (const string &k, bool *f=NULL) |
static Object * | reader (const MetaClass *cat, const AttributeList &in) |
static size_t | size () |
static void | verify () |
static void | writer (const MetaCategory *c, XMLOutput *o) |
![]() | |
template<class T > | |
static PyObject * | create (PyTypeObject *pytype, PyObject *args, PyObject *kwds) |
template<class T > | |
static Object * | createDefault () |
template<class T > | |
static Object * | createString (const string &n) |
static PyObject * | toXML (PyObject *, PyObject *) |
Static Public Attributes | |
static const MetaClass * | metadata |
![]() | |
static const MetaCategory * | metadata |
Additional Inherited Members | |
![]() | |
NonCopyable () | |
~NonCopyable () | |
![]() | |
static PythonType * | registerPythonType (int, const type_info *) |
![]() | |
static vector< PythonType * > | table |
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 101 of file lpsolver.h.
|
inline |
Constructor.
Definition at line 151 of file lpsolver.h.
|
inline |
Destructor.
Definition at line 154 of file lpsolver.h.
|
inline |
Append a new objective to the list.
Definition at line 139 of file lpsolver.h.
|
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 231 of file lpsolver.cpp.
|
virtual |
Default getattro method.
Subclasses are expected to implement an override if the type supports gettattro.
Reimplemented from frepple::Solver.
Definition at line 251 of file lpsolver.cpp.
|
inline |
Return the name of the GNU MathProg data file.
Definition at line 117 of file lpsolver.h.
|
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 133 of file lpsolver.h.
|
inline |
Return the name of the GNU MathProg model file.
Definition at line 111 of file lpsolver.h.
|
inline |
Return a reference to the list of objectives.
Definition at line 142 of file lpsolver.h.
|
inlinevirtual |
Return the memory size of the object in bytes.
Implements frepple::utils::Object.
Definition at line 158 of file lpsolver.h.
|
inline |
Return the name of the solution file.
Definition at line 123 of file lpsolver.h.
|
inlinevirtual |
This returns the type information on the object, a bit similar to the standard type_info information.
Reimplemented from frepple::Solver.
Definition at line 156 of file lpsolver.h.
|
static |
Definition at line 71 of file lpsolver.cpp.
|
virtual |
Default setattro method.
Subclasses are expected to implement an override if the type supports settattro.
Reimplemented from frepple::Solver.
Definition at line 277 of file lpsolver.cpp.
|
inline |
Update the name of the GNU MathProg data file.
Definition at line 120 of file lpsolver.h.
|
inline |
Update the solver direction: minimization or maximization.
Definition at line 136 of file lpsolver.h.
|
inline |
Update the name of the GNU MathProg model file.
Definition at line 114 of file lpsolver.h.
|
inline |
Update the name of the solution file.
After running the solver the solution is written to this flat file.
Definition at line 128 of file lpsolver.h.
|
virtual |
This method creates a new column in the model for every demand. It's value represents the planned quantity of that demand.
DataException | Generated when no calendar has been specified. |
Implements frepple::Solver.
Definition at line 121 of file lpsolver.cpp.
|
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 203 of file lpsolver.cpp.
|
static |
Definition at line 157 of file lpsolver.h.