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

#include <model.h>

Inheritance diagram for frepple::Solver:

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 (void *=NULL)=0
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 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 algorithms 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 1115 of file model.h.


Constructor & Destructor Documentation

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

Definition at line 1118 of file model.h.

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

Definition at line 1119 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 1174 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 module_forecast::ForecastSolver, frepple::SolverMRP, and module_lp_solver::LPSolver.

Definition at line 1179 of file model.h.

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

Reimplemented in module_forecast::ForecastSolver, frepple::SolverMRP, 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 1177 of file model.h.

PyObject * frepple::Solver::solve ( PyObject *  self,
PyObject *  args 
) [static]

Reimplemented in frepple::SolverMRP.

Definition at line 97 of file solver.cpp.

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

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

Definition at line 1130 of file model.h.

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

Reimplemented in frepple::SolverMRP.

Definition at line 1132 of file model.h.

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

Definition at line 1134 of file model.h.

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

Definition at line 1136 of file model.h.

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

Reimplemented in frepple::SolverMRP.

Definition at line 1138 of file model.h.

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

Reimplemented in frepple::SolverMRP.

Definition at line 1140 of file model.h.

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

Reimplemented in frepple::SolverMRP.

Definition at line 1142 of file model.h.

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

Reimplemented in frepple::SolverMRP.

Definition at line 1144 of file model.h.

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

Reimplemented in frepple::SolverMRP.

Definition at line 1146 of file model.h.

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

Reimplemented in frepple::SolverMRP.

Definition at line 1148 of file model.h.

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

Reimplemented in frepple::SolverMRP.

Definition at line 1150 of file model.h.

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

Reimplemented in frepple::SolverMRP.

Definition at line 1152 of file model.h.

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

Reimplemented in frepple::SolverMRP.

Definition at line 1154 of file model.h.

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

Definition at line 1156 of file model.h.

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

Definition at line 1158 of file model.h.

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 module_forecast::ForecastSolver, frepple::SolverMRP, and module_lp_solver::LPSolver.

Definition at line 50 of file solver.cpp.


Member Data Documentation


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

Documentation generated for frePPLe by  doxygen