This class is a prototype of an Linear Programming (LP) Solver for the planning problem or a subset of it. More...

#include <lpsolver.h>

Inheritance diagram for module_lp_solver::LPSolver:

List of all members.

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 MetaClassgetType () 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 ()
- Public Member Functions inherited from frepple::Solver
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 ()
- Public Member Functions inherited from frepple::utils::HasName< Solver >
int compare (const PyObject *other) const
 HasName (const string &n)
 HasName (const char *n)
void setName (const string &newname)
virtual PyObject * str () const
 ~HasName ()
- Public Member Functions inherited from frepple::utils::Tree::TreeNode
TreeNodedecrement () const
const string & getName () const
TreeNodeincrement () const
bool operator< (const TreeNode &o)
 TreeNode (const string &n)
virtual ~TreeNode ()
- Public Member Functions inherited from frepple::utils::Object
virtual void beginElement (XMLInput &, const Attribute &)
virtual bool getHidden () const
 Object ()
virtual void setHidden (bool b)
virtual ~Object ()
- Public Member Functions inherited from frepple::utils::PythonExtensionBase
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 Public Member Functions inherited from frepple::Solver
static PyObject * solve (PyObject *, PyObject *)
- Static Public Member Functions inherited from frepple::utils::HasName< Solver >
static Solveradd (const string &k, const MetaClass &cls)
static Solveradd (Solver *t)
static Solveradd (Solver *t, Solver *hint)
static iterator begin ()
static void clear ()
static bool empty ()
static iterator end ()
static Solverfind (const string &k)
static SolverfindLowerBound (const string &k, bool *f=NULL)
static Objectreader (const MetaClass *cat, const AttributeList &in)
static size_t size ()
static void verify ()
static void writer (const MetaCategory *c, XMLOutput *o)
- Static Public Member Functions inherited from frepple::utils::Object
template<class T >
static PyObject * create (PyTypeObject *pytype, PyObject *args, PyObject *kwds)
template<class T >
static ObjectcreateDefault ()
template<class T >
static ObjectcreateString (const string &n)
static PyObject * toXML (PyObject *, PyObject *)

Static Public Attributes

static const MetaClassmetadata
- Static Public Attributes inherited from frepple::Solver

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 101 of file lpsolver.h.


Constructor & Destructor Documentation

module_lp_solver::LPSolver::LPSolver ( const string &  n)
inline

Constructor.

Definition at line 151 of file lpsolver.h.

module_lp_solver::LPSolver::~LPSolver ( )
inline

Destructor.

Definition at line 154 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 139 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 231 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 251 of file lpsolver.cpp.

string module_lp_solver::LPSolver::getDataFile ( ) const
inline

Return the name of the GNU MathProg data file.

Definition at line 117 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 133 of file lpsolver.h.

string module_lp_solver::LPSolver::getModelFile ( ) const
inline

Return the name of the GNU MathProg model file.

Definition at line 111 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 142 of file lpsolver.h.

virtual size_t module_lp_solver::LPSolver::getSize ( ) const
inlinevirtual

Return the memory size of the object in bytes.

Implements frepple::utils::Object.

Definition at line 158 of file lpsolver.h.

string module_lp_solver::LPSolver::getSolutionFile ( ) const
inline

Return the name of the solution file.

Definition at line 123 of file lpsolver.h.

virtual const MetaClass& module_lp_solver::LPSolver::getType ( ) const
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.

int module_lp_solver::LPSolver::initialize ( )
static

Reimplemented from frepple::Solver.

Definition at line 71 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 277 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 120 of file lpsolver.h.

void module_lp_solver::LPSolver::setMinimum ( bool  m)
inline

Update the solver direction: minimization or maximization.

Definition at line 136 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 114 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 128 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:
DataExceptionGenerated when no calendar has been specified.

Implements frepple::Solver.

Definition at line 121 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 203 of file lpsolver.cpp.


Member Data Documentation

const MetaClass * module_lp_solver::LPSolver::metadata
static

Reimplemented from frepple::Solver.

Definition at line 157 of file lpsolver.h.


The documentation for this class was generated from the following files: