module_lp_solver::LPSolver Class Reference

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:
frepple::Solver frepple::utils::HasName< Solver > frepple::utils::NonCopyable frepple::utils::Tree::TreeNode frepple::utils::Object frepple::utils::PythonExtensionBase

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 ()

Static Public Member Functions

static int initialize ()

Static Public Attributes

static const MetaClassmetadata

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


Constructor & Destructor Documentation

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

Constructor.

Definition at line 158 of file lpsolver.h.

module_lp_solver::LPSolver::~LPSolver (  )  [inline]

Destructor.

Definition at line 161 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 146 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 250 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 270 of file lpsolver.cpp.

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

Return the name of the GNU MathProg data file.

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

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

Return the name of the GNU MathProg model file.

Definition at line 118 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 149 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 165 of file lpsolver.h.

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

Return the name of the solution file.

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

int module_lp_solver::LPSolver::initialize (  )  [static]

Reimplemented from frepple::Solver.

Definition at line 90 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 296 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 127 of file lpsolver.h.

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

Update the solver direction: minimization or maximization.

Definition at line 143 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 121 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 135 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 140 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 222 of file lpsolver.cpp.


Member Data Documentation

Reimplemented from frepple::Solver.

Definition at line 164 of file lpsolver.h.


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

Generated on 16 Apr 2010 for frePPLe by  doxygen 1.6.1