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) |
short | getConstraints () const |
TimePeriod | getLazyDelay () const |
int | getMaxParallel () const |
virtual size_t | getSize () const |
virtual const MetaClass & | getType () const |
bool | isCapacityConstrained () const |
bool | isConstrained () const |
bool | isFenceConstrained () const |
bool | isLeadtimeConstrained () const |
bool | isMaterialConstrained () const |
void | setConstraints (short i) |
void | setLazyDelay (TimePeriod l) |
void | setMaxParallel (int i) |
void | solve (void *v=NULL) |
SolverMRP (const string &n) | |
void | writeElement (XMLOutput *, const Keyword &, mode=DEFAULT) const |
virtual | ~SolverMRP () |
Static Public Member Functions | |
static bool | demand_comparison (const Demand *, const Demand *) |
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 | solve (const Demand *, void *=NULL) |
void | solve (const Load *, void *=NULL) |
void | solve (const ResourceInfinite *, void *=NULL) |
void | solve (const Resource *, void *=NULL) |
void | solve (const Flow *, void *=NULL) |
void | solve (const BufferProcure *, void *=NULL) |
void | solve (const Buffer *, void *=NULL) |
void | solve (const BufferInfinite *, void *=NULL) |
void | solve (const OperationAlternate *, void *=NULL) |
void | solve (const OperationRouting *, void *=NULL) |
void | solve (const Operation *, void *=NULL) |
Protected Attributes | |
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:
Definition at line 52 of file solver.h.
frepple::SolverMRP::SolverMRP | ( | const string & | n | ) | [inline] |
virtual frepple::SolverMRP::~SolverMRP | ( | ) | [inline, virtual] |
bool frepple::SolverMRP::checkOperation | ( | OperationPlan * | opplan, | |
SolverMRP::SolverMRPdata & | data | |||
) | [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 64 of file solveroperation.cpp.
void frepple::SolverMRP::checkOperationCapacity | ( | OperationPlan * | opplan, | |
SolverMRP::SolverMRPdata & | data | |||
) | [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 34 of file solveroperation.cpp.
bool frepple::SolverMRP::checkOperationLeadtime | ( | OperationPlan * | opplan, | |
SolverMRP::SolverMRPdata & | data, | |||
bool | extra | |||
) | [protected] |
Verifies whether this operationplan violates the leadtime constraints.
Definition at line 274 of file solveroperation.cpp.
This function defines the order in which the demands are being planned.
The following sorting criteria are appplied in order:
Definition at line 58 of file solverplan.cpp.
void frepple::SolverMRP::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 209 of file solverplan.cpp.
short frepple::SolverMRP::getConstraints | ( | ) | const [inline] |
TimePeriod frepple::SolverMRP::getLazyDelay | ( | ) | const [inline] |
int frepple::SolverMRP::getMaxParallel | ( | ) | const [inline] |
virtual size_t frepple::SolverMRP::getSize | ( | ) | const [inline, virtual] |
Return the memory size of the object in bytes.
Implements frepple::utils::Object.
virtual const MetaClass& frepple::SolverMRP::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.
bool frepple::SolverMRP::isCapacityConstrained | ( | ) | const [inline] |
bool frepple::SolverMRP::isConstrained | ( | ) | const [inline] |
bool frepple::SolverMRP::isFenceConstrained | ( | ) | const [inline] |
bool frepple::SolverMRP::isLeadtimeConstrained | ( | ) | const [inline] |
bool frepple::SolverMRP::isMaterialConstrained | ( | ) | const [inline] |
void frepple::SolverMRP::setConstraints | ( | short | i | ) | [inline] |
void frepple::SolverMRP::setLazyDelay | ( | TimePeriod | l | ) | [inline] |
void frepple::SolverMRP::setMaxParallel | ( | int | i | ) | [inline] |
Update the number of parallel solver threads.
The default value depends on whether the solver is run in verbose mode or not:
void frepple::SolverMRP::solve | ( | void * | v = NULL |
) | [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 144 of file solverplan.cpp.
void frepple::SolverMRP::solve | ( | const Demand * | l, | |
void * | v = NULL | |||
) | [protected, virtual] |
Behavior of this solver method:
Reimplemented from frepple::Solver.
Definition at line 35 of file solverdemand.cpp.
void frepple::SolverMRP::solve | ( | const Load * | l, | |
void * | v = NULL | |||
) | [protected, virtual] |
Behavior of this solver method:
Reimplemented from frepple::Solver.
Definition at line 34 of file solverresource.cpp.
void frepple::SolverMRP::solve | ( | const ResourceInfinite * | res, | |
void * | v = NULL | |||
) | [protected, virtual] |
Behavior of this solver method:
Reimplemented from frepple::Solver.
Definition at line 307 of file solverresource.cpp.
void frepple::SolverMRP::solve | ( | const Resource * | res, | |
void * | v = NULL | |||
) | [protected, virtual] |
Behavior of this solver method:
Reimplemented from frepple::Solver.
Definition at line 52 of file solverresource.cpp.
void frepple::SolverMRP::solve | ( | const Flow * | fl, | |
void * | v = NULL | |||
) | [protected, virtual] |
Behavior of this solver method:
Reimplemented from frepple::Solver.
Definition at line 262 of file solverbuffer.cpp.
void frepple::SolverMRP::solve | ( | const BufferProcure * | b, | |
void * | v = NULL | |||
) | [protected, virtual] |
Behavior of this solver method:
Reimplemented from frepple::Solver.
Definition at line 83 of file solverprocure.cpp.
void frepple::SolverMRP::solve | ( | const Buffer * | b, | |
void * | v = NULL | |||
) | [protected, virtual] |
Behavior of this solver method:
Reimplemented from frepple::Solver.
Definition at line 41 of file solverbuffer.cpp.
void frepple::SolverMRP::solve | ( | const BufferInfinite * | b, | |
void * | v = NULL | |||
) | [protected, virtual] |
Behavior of this solver method:
Reimplemented from frepple::Solver.
Definition at line 292 of file solverbuffer.cpp.
void frepple::SolverMRP::solve | ( | const OperationAlternate * | oper, | |
void * | v = NULL | |||
) | [protected, virtual] |
Behavior of this solver method is:
Reimplemented from frepple::Solver.
Definition at line 542 of file solveroperation.cpp.
void frepple::SolverMRP::solve | ( | const OperationRouting * | oper, | |
void * | v = NULL | |||
) | [protected, virtual] |
Behavior of this solver method is:
Reimplemented from frepple::Solver.
Definition at line 430 of file solveroperation.cpp.
void frepple::SolverMRP::solve | ( | const Operation * | oper, | |
void * | v = NULL | |||
) | [protected, virtual] |
Behavior of this solver method is:
Reimplemented from frepple::Solver.
Definition at line 348 of file solveroperation.cpp.
void frepple::SolverMRP::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 186 of file solverplan.cpp.
const short frepple::SolverMRP::CAPACITY = 4 [static] |
short frepple::SolverMRP::constrts [protected] |
const short frepple::SolverMRP::FENCE = 8 [static] |
const short frepple::SolverMRP::LEADTIME = 1 [static] |
const short frepple::SolverMRP::MATERIAL = 2 [static] |
const MetaClass * frepple::SolverMRP::metadata [static] |
Reimplemented from frepple::Solver.