This solver implements a heuristic algorithm for planning demands. More...
#include <solver.h>
Classes | |
class | SolverMRPdata |
This class is a helper class of the SolverMRP class. More... | |
struct | State |
This class is used to store the solver status during the ask-reply calls of the solver. More... |
Public Member Functions | |
void | endElement (XMLInput &pIn, const Attribute &pAttr, const DataElement &pElement) |
virtual PyObject * | getattro (const Attribute &) |
bool | getAutocommit () const |
short | getConstraints () const |
double | getIterationAccuracy () const |
double | getIterationThreshold () const |
TimePeriod | getLazyDelay () const |
short | getPlanType () const |
virtual size_t | getSize () const |
virtual const MetaClass & | getType () const |
PythonFunction | getUserExitBuffer () const |
PythonFunction | getUserExitDemand () const |
PythonFunction | getUserExitFlow () const |
PythonFunction | getUserExitOperation () const |
PythonFunction | getUserExitResource () const |
bool | isCapacityConstrained () const |
bool | isConstrained () const |
bool | isFenceConstrained () const |
bool | isLeadtimeConstrained () const |
bool | isMaterialConstrained () const |
virtual int | setattro (const Attribute &, const PythonObject &) |
void | setAutocommit (const bool b) |
void | setConstraints (short i) |
void | setIterationAccuracy (double d) |
void | setIterationThreshold (double d) |
void | setLazyDelay (TimePeriod l) |
void | setPlanType (short b) |
void | setUserExitBuffer (const string &n) |
void | setUserExitBuffer (PyObject *p) |
void | setUserExitDemand (const string &n) |
void | setUserExitDemand (PyObject *p) |
void | setUserExitFlow (const string &n) |
void | setUserExitFlow (PyObject *p) |
void | setUserExitOperation (const string &n) |
void | setUserExitOperation (PyObject *p) |
void | setUserExitResource (const string &n) |
void | setUserExitResource (PyObject *p) |
void | solve (void *v=NULL) |
SolverMRP (const string &n) | |
void | writeElement (XMLOutput *, const Keyword &, mode=DEFAULT) const |
virtual | ~SolverMRP () |
![]() | |
unsigned short | getLogLevel () const |
void | setLogLevel (unsigned short v) |
virtual void | solve (const OperationFixedTime *o, void *v=NULL) |
virtual void | solve (const OperationTimePer *o, 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 |
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 PyObject * | commit (PyObject *, PyObject *) |
static bool | demand_comparison (const Demand *, const Demand *) |
static int | initialize () |
static PyObject * | rollback (PyObject *, PyObject *) |
static PyObject * | solve (PyObject *, PyObject *) |
Static Public Attributes | |
static const short | CAPACITY = 4 |
static const short | FENCE = 8 |
static const short | LEADTIME = 1 |
static const short | MATERIAL = 2 |
static const MetaClass * | metadata |
![]() |
Protected Member Functions | |
bool | checkOperation (OperationPlan *, SolverMRPdata &data) |
void | checkOperationCapacity (OperationPlan *, SolverMRPdata &) |
bool | checkOperationLeadtime (OperationPlan *, SolverMRPdata &, bool) |
void | chooseResource (const Load *, void *) |
void | scanExcess (CommandManager *) |
void | scanExcess (CommandList *) |
void | solve (const Operation *, void *=NULL) |
void | solve (const OperationRouting *, void *=NULL) |
void | solve (const OperationAlternate *, void *=NULL) |
void | solve (const BufferInfinite *, void *=NULL) |
void | solve (const Buffer *, void *=NULL) |
void | solve (const BufferProcure *, void *=NULL) |
void | solve (const Flow *, void *=NULL) |
void | solve (const Resource *, void *=NULL) |
void | solve (const ResourceInfinite *, void *=NULL) |
void | solve (const Load *, void *=NULL) |
void | solve (const Demand *, void *=NULL) |
Protected Attributes | |
SolverMRPdata | commands |
short | constrts |
This solver implements a heuristic algorithm for planning demands.
One by one the demands are processed. The demand will consume step by step any upstream materials, respecting all constraints on its path.
The solver supports all planning constraints as defined in Solver class.
See the documentation of the different solve methods to understand the functionality in more detail.
The logging levels have the following meaning:
|
inline |
|
inlinevirtual |
|
protected |
This function will check all constraints for an operationplan and propagate it upstream. The check does NOT check eventual sub operationplans.
The return value is a flag whether the operationplan is acceptable (sometimes in reduced quantity) or not.
Definition at line 100 of file solveroperation.cpp.
|
protected |
Verifies whether this operationplan violates the capacity constraint.
In case it does the operationplan is moved to an earlier or later feasible date.
Definition at line 28 of file solveroperation.cpp.
|
protected |
Verifies whether this operationplan violates the leadtime constraints.
Definition at line 337 of file solveroperation.cpp.
|
protected |
Choose a resource.
Normally the chosen resource is simply the resource specified on the load.
When the load specifies a certain skill and an aggregate resource, then we search for appropriate child resources.
Definition at line 34 of file solverload.cpp.
|
static |
Python method for commiting the plan changes.
Definition at line 369 of file solverplan.cpp.
This function defines the order in which the demands are being planned.
The following sorting criteria are appplied in order:
Definition at line 61 of file solverplan.cpp.
|
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 251 of file solverplan.cpp.
|
virtual |
Default getattro method.
Subclasses are expected to implement an override if the type supports gettattro.
Reimplemented from frepple::Solver.
Definition at line 278 of file solverplan.cpp.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
Returns the plan type:
|
inlinevirtual |
Return the memory size of the object in bytes.
Implements frepple::utils::Object.
|
inlinevirtual |
This returns the type information on the object, a bit similar to the standard type_info information.
Reimplemented from frepple::Solver.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
static |
Reimplemented from frepple::Solver.
Definition at line 47 of file solverplan.cpp.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
static |
Python method for undoing the plan changes.
Definition at line 389 of file solverplan.cpp.
|
protected |
Scan the operationplans that are about to be committed to verify that they are not creating any excess.
Definition at line 341 of file solverdemand.cpp.
|
protected |
Scan the operationplans that are about to be committed to verify that they are not creating any excess.
Definition at line 348 of file solverdemand.cpp.
|
virtual |
Default setattro method.
Subclasses are expected to implement an override if the type supports settattro.
Reimplemented from frepple::Solver.
Definition at line 304 of file solverplan.cpp.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
protectedvirtual |
Behavior of this solver method is:
Reimplemented from frepple::Solver.
Definition at line 452 of file solveroperation.cpp.
|
protectedvirtual |
Behavior of this solver method is:
Reimplemented from frepple::Solver.
Definition at line 548 of file solveroperation.cpp.
|
protectedvirtual |
Behavior of this solver method is:
Reimplemented from frepple::Solver.
Definition at line 689 of file solveroperation.cpp.
|
protectedvirtual |
Behavior of this solver method:
Reimplemented from frepple::Solver.
Definition at line 278 of file solverbuffer.cpp.
|
protectedvirtual |
Behavior of this solver method:
Reimplemented from frepple::Solver.
Definition at line 35 of file solverbuffer.cpp.
|
protectedvirtual |
Behavior of this solver method:
Reimplemented from frepple::Solver.
Definition at line 28 of file solverprocure.cpp.
|
protectedvirtual |
Behavior of this solver method:
Reimplemented from frepple::Solver.
Definition at line 33 of file solverflow.cpp.
|
protectedvirtual |
Behavior of this solver method:
Reimplemented from frepple::Solver.
Definition at line 29 of file solverresource.cpp.
|
protectedvirtual |
Behavior of this solver method:
Reimplemented from frepple::Solver.
Definition at line 476 of file solverresource.cpp.
|
protectedvirtual |
Behavior of this solver method:
Reimplemented from frepple::Solver.
Definition at line 231 of file solverload.cpp.
|
protectedvirtual |
Behavior of this solver method:
Reimplemented from frepple::Solver.
Definition at line 29 of file solverdemand.cpp.
|
virtual |
This is the main solver method that will appropriately call the other solve methods.
The demands in the model will all be sorted with the criteria defined in the demand_comparison() method. For each of demand the solve(Demand*) method is called to plan it.
Implements frepple::Solver.
Definition at line 169 of file solverplan.cpp.
|
static |
Python method for running the solver.
Reimplemented from frepple::Solver.
Definition at line 332 of file solverplan.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 213 of file solverplan.cpp.
|
static |
|
protected |
|
protected |
|
static |
|
static |
|
static |
|
static |
Reimplemented from frepple::Solver.