frepple::Solver Class Reference

This class is an implementation of the "visitor" design pattern. It is intended as a basis for different algoritms processing the frePPLe data. More...

#include <model.h>

Inheritance diagram for frepple::Solver:
frepple::utils::HasName< Solver > frepple::utils::NonCopyable frepple::utils::Tree::TreeNode frepple::utils::Object frepple::utils::PythonExtensionBase frepple::SolverMRP module_forecast::ForecastSolver module_lp_solver::LPSolver

List of all members.

Public Member Functions

virtual void endElement (XMLInput &, const Attribute &, const DataElement &)
virtual PyObject * getattro (const Attribute &)
unsigned short getLogLevel () const
virtual const MetaClassgetType () const
virtual int setattro (const Attribute &, const PythonObject &)
void setLogLevel (unsigned short v)
virtual void solve (const Solvable *, void *=NULL)
virtual void solve (const FlowEnd *b, void *v=NULL)
virtual void solve (const Flow *b, void *v=NULL)
virtual void solve (const Load *b, void *v=NULL)
virtual void solve (const BufferProcure *b, void *v=NULL)
virtual void solve (const BufferInfinite *b, void *v=NULL)
virtual void solve (const Buffer *, void *=NULL)
virtual void solve (const ResourceInfinite *r, void *v=NULL)
virtual void solve (const Resource *, void *=NULL)
virtual void solve (const OperationAlternate *o, void *v=NULL)
virtual void solve (const OperationRouting *o, void *v=NULL)
virtual void solve (const OperationTimePer *o, void *v=NULL)
virtual void solve (const OperationFixedTime *o, void *v=NULL)
virtual void solve (const Operation *, void *=NULL)
virtual void solve (const Demand *, void *=NULL)
virtual void solve (void *=NULL)=0
 Solver (const string &n)
virtual void writeElement (XMLOutput *, const Keyword &, mode=DEFAULT) const
virtual ~Solver ()

Static Public Member Functions

static int initialize ()
static PyObject * solve (PyObject *, PyObject *)

Static Public Attributes

static const MetaCategorymetadata

Detailed Description

This class is an implementation of the "visitor" design pattern. It is intended as a basis for different algoritms processing the frePPLe data.

The goal is to decouple the solver/algorithms from the model/data representation. Different solvers can be easily be plugged in to work on the same data.

Definition at line 1065 of file model.h.


Constructor & Destructor Documentation

frepple::Solver::Solver ( const string &  n  )  [inline, explicit]

Definition at line 1068 of file model.h.

virtual frepple::Solver::~Solver (  )  [inline, virtual]

Definition at line 1069 of file model.h.


Member Function Documentation

void frepple::Solver::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::utils::HasName< Solver >.

Reimplemented in frepple::SolverMRP, and module_lp_solver::LPSolver.

Definition at line 63 of file solver.cpp.

PyObject * frepple::Solver::getattro ( const Attribute attr  )  [virtual]

Default getattro method.
Subclasses are expected to implement an override if the type supports gettattro.

Reimplemented from frepple::utils::PythonExtensionBase.

Reimplemented in frepple::SolverMRP, and module_lp_solver::LPSolver.

Definition at line 75 of file solver.cpp.

unsigned short frepple::Solver::getLogLevel (  )  const [inline]

Returns how elaborate and verbose output is requested.
As a guideline solvers should respect the following guidelines:

  • 0:
    Completely silent.
    This is the default value.
  • 1:
    Minimal and high-level messages on the progress that are sufficient for logging normal operation.
  • 2:
    Higher numbers are solver dependent. These levels are typically used for debugging and tracing, and provide more detail on the solver's progress.

Definition at line 1124 of file model.h.

virtual const MetaClass& frepple::Solver::getType (  )  const [inline, virtual]

This returns the type information on the object, a bit similar to the standard type_info information.

Implements frepple::utils::Object.

Reimplemented in frepple::SolverMRP, module_forecast::ForecastSolver, and module_lp_solver::LPSolver.

Definition at line 1129 of file model.h.

int frepple::Solver::initialize (  )  [static]

Reimplemented in frepple::SolverMRP, module_forecast::ForecastSolver, and module_lp_solver::LPSolver.

Definition at line 38 of file solver.cpp.

int frepple::Solver::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::utils::PythonExtensionBase.

Reimplemented in frepple::SolverMRP, and module_lp_solver::LPSolver.

Definition at line 85 of file solver.cpp.

void frepple::Solver::setLogLevel ( unsigned short  v  )  [inline]

Controls whether verbose output will be generated.

Definition at line 1127 of file model.h.

virtual void frepple::Solver::solve ( const Solvable ,
void *  = NULL 
) [inline, virtual]

Definition at line 1108 of file model.h.

virtual void frepple::Solver::solve ( const FlowEnd b,
void *  v = NULL 
) [inline, virtual]

Definition at line 1106 of file model.h.

virtual void frepple::Solver::solve ( const Flow b,
void *  v = NULL 
) [inline, virtual]

Reimplemented in frepple::SolverMRP.

Definition at line 1104 of file model.h.

virtual void frepple::Solver::solve ( const Load b,
void *  v = NULL 
) [inline, virtual]

Reimplemented in frepple::SolverMRP.

Definition at line 1102 of file model.h.

virtual void frepple::Solver::solve ( const BufferProcure b,
void *  v = NULL 
) [inline, virtual]

Reimplemented in frepple::SolverMRP.

Definition at line 1100 of file model.h.

virtual void frepple::Solver::solve ( const BufferInfinite b,
void *  v = NULL 
) [inline, virtual]

Reimplemented in frepple::SolverMRP.

Definition at line 1098 of file model.h.

virtual void frepple::Solver::solve ( const Buffer ,
void *  = NULL 
) [inline, virtual]

Reimplemented in frepple::SolverMRP.

Definition at line 1096 of file model.h.

virtual void frepple::Solver::solve ( const ResourceInfinite r,
void *  v = NULL 
) [inline, virtual]

Reimplemented in frepple::SolverMRP.

Definition at line 1094 of file model.h.

virtual void frepple::Solver::solve ( const Resource ,
void *  = NULL 
) [inline, virtual]

Reimplemented in frepple::SolverMRP.

Definition at line 1092 of file model.h.

virtual void frepple::Solver::solve ( const OperationAlternate o,
void *  v = NULL 
) [inline, virtual]

Reimplemented in frepple::SolverMRP.

Definition at line 1090 of file model.h.

virtual void frepple::Solver::solve ( const OperationRouting o,
void *  v = NULL 
) [inline, virtual]

Reimplemented in frepple::SolverMRP.

Definition at line 1088 of file model.h.

virtual void frepple::Solver::solve ( const OperationTimePer o,
void *  v = NULL 
) [inline, virtual]

Definition at line 1086 of file model.h.

virtual void frepple::Solver::solve ( const OperationFixedTime o,
void *  v = NULL 
) [inline, virtual]

Definition at line 1084 of file model.h.

virtual void frepple::Solver::solve ( const Operation ,
void *  = NULL 
) [inline, virtual]

Reimplemented in frepple::SolverMRP.

Definition at line 1082 of file model.h.

virtual void frepple::Solver::solve ( const Demand ,
void *  = NULL 
) [inline, virtual]

Reimplemented in frepple::SolverMRP, and module_forecast::ForecastSolver.

Definition at line 1080 of file model.h.

virtual void frepple::Solver::solve ( void *  = NULL  )  [pure virtual]
PyObject * frepple::Solver::solve ( PyObject *  self,
PyObject *  args 
) [static]

Reimplemented in frepple::SolverMRP.

Definition at line 97 of file solver.cpp.

void frepple::Solver::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::utils::Object.

Reimplemented in frepple::SolverMRP, module_forecast::ForecastSolver, and module_lp_solver::LPSolver.

Definition at line 50 of file solver.cpp.


Member Data Documentation

Reimplemented in frepple::SolverMRP, module_forecast::ForecastSolver, and module_lp_solver::LPSolver.

Definition at line 1130 of file model.h.


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

Generated on 16 Apr 2010 for frePPLe by  doxygen 1.6.1