A buffer represents a combination of a item and location.
It is the entity for keeping modeling inventory.
More...
#include <model.h>
Public Types | |
typedef Association< Operation, Buffer, Flow >::ListB | flowlist |
typedef TimeLine< FlowPlan > | flowplanlist |
Public Member Functions | |
virtual void | beginElement (XMLInput &, const Attribute &) |
Buffer (const string &str) | |
void | deleteOperationPlans (bool deleteLockedOpplans=false) |
virtual void | endElement (XMLInput &, const Attribute &, const DataElement &) |
size_t | extrasize () const |
Flow * | findFlow (const Operation *o, Date d) const |
virtual void | followPegging (PeggingIterator &, FlowPlan *, short, double, double) |
double | getCarryingCost () const |
flowplanlist & | getFlowPlans () |
const flowplanlist & | getFlowPlans () const |
const flowlist & | getFlows () const |
bool | getHidden () const |
Item * | getItem () const |
Location * | getLocation () const |
CalendarDouble * | getMaximum () const |
CalendarDouble * | getMinimum () const |
double | getOnHand (Date, Date, bool min=true) const |
double | getOnHand (Date d=Date::infinitePast) const |
Operation * | getProducingOperation () const |
virtual const MetaClass & | getType () const |
void | setCarryingCost (const double c) |
void | setHidden (bool b) |
void | setItem (Item *i) |
void | setLocation (Location *i) |
void | setMaximum (CalendarDouble *) |
void | setMinimum (CalendarDouble *) |
void | setOnHand (double f) |
void | setProducingOperation (Operation *o) |
virtual void | solve (Solver &s, void *v=NULL) const |
virtual void | updateProblems () |
virtual void | writeElement (XMLOutput *, const Keyword &, mode=DEFAULT) const |
virtual | ~Buffer () |
Static Public Attributes | |
static const MetaCategory * | metadata |
Friends | |
class | Flow |
class | FlowPlan |
A buffer represents a combination of a item and location.
It is the entity for keeping modeling inventory.
Definition at line 2706 of file model.h.
typedef Association<Operation,Buffer,Flow>::ListB frepple::Buffer::flowlist |
frepple::Buffer::Buffer | ( | const string & | str | ) | [inline, explicit] |
frepple::Buffer::~Buffer | ( | ) | [virtual] |
Destructor.
Definition at line 398 of file buffer.cpp.
Reimplemented from frepple::utils::HasHierarchy< Buffer >.
Definition at line 223 of file buffer.cpp.
void frepple::Buffer::deleteOperationPlans | ( | bool | deleteLockedOpplans = false |
) |
Deletes all operationplans consuming from or producing from this buffer. The boolean parameter controls whether we delete also locked operationplans or not.
Definition at line 387 of file buffer.cpp.
void frepple::Buffer::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::Plannable.
Reimplemented in frepple::BufferProcure.
Definition at line 248 of file buffer.cpp.
size_t frepple::Buffer::extrasize | ( | ) | const [inline] |
Returns the memory size in bytes.
Reimplemented from frepple::utils::HasDescription.
void frepple::Buffer::followPegging | ( | PeggingIterator & | iter, | |
FlowPlan * | curflowplan, | |||
short | nextlevel, | |||
double | curqty, | |||
double | curfactor | |||
) | [virtual] |
This function matches producing and consuming operationplans with each other, and updates the pegging iterator accordingly.
Definition at line 416 of file buffer.cpp.
double frepple::Buffer::getCarryingCost | ( | ) | const [inline] |
flowplanlist& frepple::Buffer::getFlowPlans | ( | ) | [inline] |
const flowplanlist& frepple::Buffer::getFlowPlans | ( | ) | const [inline] |
const flowlist& frepple::Buffer::getFlows | ( | ) | const [inline] |
bool frepple::Buffer::getHidden | ( | ) | const [inline, virtual] |
Returns whether an entity is real or dummy.
Reimplemented from frepple::utils::Object.
Item* frepple::Buffer::getItem | ( | ) | const [inline] |
Location* frepple::Buffer::getLocation | ( | ) | const [inline] |
CalendarDouble* frepple::Buffer::getMaximum | ( | ) | const [inline] |
CalendarDouble* frepple::Buffer::getMinimum | ( | ) | const [inline] |
Returns minimum or maximum available material on hand in the given daterange. The third parameter specifies whether we return the minimum (which is the default) or the maximum value. The computation is INclusive the start and end dates.
Definition at line 110 of file buffer.cpp.
double frepple::Buffer::getOnHand | ( | Date | d = Date::infinitePast |
) | const |
Returns the available material on hand immediately after the given date.
Definition at line 92 of file buffer.cpp.
Operation* frepple::Buffer::getProducingOperation | ( | ) | const [inline] |
virtual const MetaClass& frepple::Buffer::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::BufferDefault, frepple::BufferInfinite, and frepple::BufferProcure.
void frepple::Buffer::setCarryingCost | ( | const double | c | ) | [inline] |
void frepple::Buffer::setHidden | ( | bool | b | ) | [inline, virtual] |
Mark the object as hidden or not. Hidden objects are not exported and are used only as dummy constructs.
Reimplemented from frepple::utils::Object.
void frepple::Buffer::setItem | ( | Item * | i | ) | [inline] |
void frepple::Buffer::setLocation | ( | Location * | i | ) | [inline] |
void frepple::Buffer::setMaximum | ( | CalendarDouble * | cal | ) |
Updates the minimum inventory target for the buffer.
Definition at line 349 of file buffer.cpp.
void frepple::Buffer::setMinimum | ( | CalendarDouble * | cal | ) |
Updates the minimum inventory target for the buffer.
Definition at line 311 of file buffer.cpp.
void frepple::Buffer::setOnHand | ( | double | f | ) |
Update the on-hand inventory at the start of the planning horizon.
Definition at line 44 of file buffer.cpp.
void frepple::Buffer::setProducingOperation | ( | Operation * | o | ) | [inline] |
virtual void frepple::Buffer::solve | ( | Solver & | s, | |
void * | v = NULL | |||
) | const [inline, virtual] |
This method is called by solver classes. The implementation of this class simply calls the solve method on the solver class. Using the polymorphism the solver can implement seperate methods for different plannable subclasses.
Reimplemented from frepple::Solvable.
Reimplemented in frepple::BufferInfinite, and frepple::BufferProcure.
void frepple::Buffer::updateProblems | ( | ) | [virtual] |
Called to update the list of problems. The function will only be called when:
Implements frepple::HasProblems.
Definition at line 34 of file problems_buffer.cpp.
void frepple::Buffer::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::Plannable.
Reimplemented in frepple::BufferInfinite, and frepple::BufferProcure.
Definition at line 155 of file buffer.cpp.
const MetaCategory * frepple::Buffer::metadata [static] |
Reimplemented in frepple::BufferDefault, frepple::BufferInfinite, and frepple::BufferProcure.