A buffer represents a combination of a item and location.
It is the entity for keeping modeling inventory. More...

#include <model.h>

Inheritance diagram for frepple::Buffer:

Public Types

typedef Association< Operation,
Buffer, Flow >::ListB 
flowlist
 
typedef TimeLine< FlowPlanflowplanlist
 

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
 
FlowfindFlow (const Operation *o, Date d) const
 
virtual void followPegging (PeggingIterator &, FlowPlan *, short, double, double)
 
virtual PyObject * getattro (const Attribute &)
 
double getCarryingCost () const
 
const flowplanlistgetFlowPlans () const
 
flowplanlistgetFlowPlans ()
 
const flowlistgetFlows () const
 
bool getHidden () const
 
ItemgetItem () const
 
LocationgetLocation () const
 
double getMaximum () const
 
CalendarDoublegetMaximumCalendar () const
 
double getMinimum () const
 
CalendarDoublegetMinimumCalendar () const
 
double getOnHand (Date d=Date::infinitePast) const
 
double getOnHand (Date, Date, bool min=true) const
 
OperationgetProducingOperation () const
 
virtual const MetaClassgetType () const
 
virtual int setattro (const Attribute &, const PythonObject &)
 
void setCarryingCost (const double c)
 
void setHidden (bool b)
 
void setItem (Item *i)
 
void setLocation (Location *i)
 
void setMaximum (double)
 
void setMaximumCalendar (CalendarDouble *)
 
void setMinimum (double)
 
void setMinimumCalendar (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 ()
 
- Public Member Functions inherited from frepple::utils::HasHierarchy< Buffer >
void beginElement (XMLInput &, const Attribute &)
 
memberIterator beginMember () const
 
void endElement (XMLInput &, const Attribute &, const DataElement &)
 
unsigned short getHierarchyLevel () const
 
BuffergetOwner () const
 
 HasHierarchy (const string &n)
 
bool hasOwner () const
 
bool isGroup () const
 
void setOwner (Buffer *f)
 
void writeElement (XMLOutput *, const Keyword &, mode=DEFAULT) const
 
 ~HasHierarchy ()
 
- Public Member Functions inherited from frepple::utils::HasName< Buffer >
int compare (const PyObject *other) const
 
 HasName (const string &n)
 
 HasName (const char *n)
 
void setName (const string &newname)
 
virtual PyObject * str () const
 
 ~HasName ()
 
- Public Member Functions inherited from frepple::utils::Tree::TreeNode
TreeNodedecrement () const
 
const string & getName () const
 
TreeNodeincrement () const
 
bool operator< (const TreeNode &o)
 
 TreeNode (const string &n)
 
virtual ~TreeNode ()
 
- Public Member Functions inherited from frepple::utils::Object
virtual size_t getSize () const =0
 
 Object ()
 
virtual ~Object ()
 
- Public Member Functions inherited from frepple::utils::PythonExtensionBase
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 ()
 
- Public Member Functions inherited from frepple::HasLevel
unsigned short getCluster () const
 
short getLevel () const
 
- Public Member Functions inherited from frepple::Plannable
bool getChanged () const
 
bool getDetectProblems () const
 
PlannablegetEntity () const
 
 Plannable ()
 
void setChanged (bool b=true)
 
void setDetectProblems (bool b)
 
- Public Member Functions inherited from frepple::HasProblems
 HasProblems ()
 
virtual ~HasProblems ()
 
- Public Member Functions inherited from frepple::Solvable
virtual ~Solvable ()
 
- Public Member Functions inherited from frepple::utils::HasDescription
void endElement (XMLInput &, const Attribute &, const DataElement &)
 
string getCategory () const
 
string getDescription () const
 
string getSubCategory () const
 
void setCategory (const string &f)
 
void setDescription (const string &f)
 
void setSubCategory (const string &f)
 
void writeElement (XMLOutput *, const Keyword &, mode=DEFAULT) const
 

Static Public Member Functions

static int initialize ()
 
- Static Public Member Functions inherited from frepple::HasLevel
static unsigned short getNumberOfClusters ()
 
static unsigned short getNumberOfHangingClusters ()
 
static void triggerLazyRecomputation ()
 
- Static Public Member Functions inherited from frepple::Plannable
static void computeProblems ()
 
- Static Public Member Functions inherited from frepple::HasProblems
static EntityIterator beginEntity ()
 
static EntityIterator endEntity ()
 

Static Public Attributes

static const MetaCategorymetadata
 

Friends

class Flow
 
class FlowPlan
 

Additional Inherited Members

- Protected Member Functions inherited from frepple::utils::NonCopyable
 NonCopyable ()
 
 ~NonCopyable ()
 
- Protected Member Functions inherited from frepple::HasLevel
 HasLevel ()
 
 HasLevel (const HasLevel &o)
 
 ~HasLevel ()
 
- Protected Member Functions inherited from frepple::utils::HasDescription
size_t extrasize () const
 
- Static Protected Member Functions inherited from frepple::utils::PythonExtensionBase
static PythonTyperegisterPythonType (int, const type_info *)
 
- Static Protected Member Functions inherited from frepple::HasLevel
static void computeLevels ()
 
- Static Protected Attributes inherited from frepple::utils::PythonExtensionBase
static vector< PythonType * > table
 

Detailed Description

A buffer represents a combination of a item and location.
It is the entity for keeping modeling inventory.

Definition at line 2677 of file model.h.

Member Typedef Documentation

Definition at line 2685 of file model.h.

Definition at line 2684 of file model.h.

Constructor & Destructor Documentation

frepple::Buffer::Buffer ( const string &  str)
inlineexplicit

Constructor. Implicit creation of instances is disallowed.

Definition at line 2688 of file model.h.

frepple::Buffer::~Buffer ( )
virtual

Destructor.

Definition at line 519 of file buffer.cpp.

Member Function Documentation

void frepple::Buffer::beginElement ( XMLInput ,
const Attribute  
)
virtual

Called while restoring the model from an XML-file.
This is called for each element within the "this" element, for which the "this" element is immediate parent.
It is called when the open element tag is encountered.

Reimplemented from frepple::utils::Object.

Definition at line 275 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 508 of file buffer.cpp.

void frepple::Buffer::endElement ( XMLInput pIn,
const Attribute pAttr,
const DataElement pElement 
)
virtual

Reimplemented from frepple::Plannable.

Reimplemented in frepple::BufferProcure.

Definition at line 301 of file buffer.cpp.

size_t frepple::Buffer::extrasize ( ) const
inline

Definition at line 2763 of file model.h.

Flow* frepple::Buffer::findFlow ( const Operation o,
Date  d 
) const
inline

Return the flow that is associates a given operation with this buffer.
Returns NULL is no such flow exists.

Definition at line 2800 of file model.h.

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 537 of file buffer.cpp.

PyObject * frepple::Buffer::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::BufferProcure.

Definition at line 790 of file buffer.cpp.

double frepple::Buffer::getCarryingCost ( ) const
inline

Return the carrying cost.
The cost of carrying inventory in this buffer. The value is a percentage of the item sales price, per year and per unit.

Definition at line 2744 of file model.h.

const flowplanlist& frepple::Buffer::getFlowPlans ( ) const
inline

Returns a reference to the list of all flow plans of this buffer.

Definition at line 2793 of file model.h.

flowplanlist& frepple::Buffer::getFlowPlans ( )
inline

Returns a reference to the list of all flow plans of this buffer.

Definition at line 2796 of file model.h.

const flowlist& frepple::Buffer::getFlows ( ) const
inline

Returns a reference to the list of all flows of this buffer.

Definition at line 2788 of file model.h.

bool frepple::Buffer::getHidden ( ) const
inlinevirtual

Returns whether an entity is real or dummy.

Reimplemented from frepple::utils::Object.

Definition at line 2812 of file model.h.

Item* frepple::Buffer::getItem ( ) const
inline

Returns the item stored in this buffer.

Definition at line 2703 of file model.h.

Location* frepple::Buffer::getLocation ( ) const
inline

Returns the Location of this buffer.

Definition at line 2709 of file model.h.

double frepple::Buffer::getMaximum ( ) const
inline

Returns the maximum inventory level.

Definition at line 2722 of file model.h.

CalendarDouble* frepple::Buffer::getMaximumCalendar ( ) const
inline

Returns a pointer to a calendar for storing the maximum inventory level.

Definition at line 2726 of file model.h.

double frepple::Buffer::getMinimum ( ) const
inline

Returns the minimum inventory level.

Definition at line 2715 of file model.h.

CalendarDouble* frepple::Buffer::getMinimumCalendar ( ) const
inline

Returns a pointer to a calendar for storing the minimum inventory level.

Definition at line 2719 of file model.h.

double frepple::Buffer::getOnHand ( Date  d = Date::infinitePast) const

Returns the available material on hand immediately after the given date.

Definition at line 141 of file buffer.cpp.

double frepple::Buffer::getOnHand ( Date  d1,
Date  d2,
bool  min = true 
) const

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 159 of file buffer.cpp.

Operation* frepple::Buffer::getProducingOperation ( ) const
inline

Returns the operation that is used to supply extra supply into this buffer.

Definition at line 2695 of file model.h.

virtual const MetaClass& frepple::Buffer::getType ( ) const
inlinevirtual

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

Implements frepple::utils::Object.

Reimplemented in frepple::BufferProcure, frepple::BufferInfinite, and frepple::BufferDefault.

Definition at line 2814 of file model.h.

int frepple::Buffer::initialize ( )
static

Initialize the class.

Definition at line 43 of file buffer.cpp.

int frepple::Buffer::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::BufferProcure.

Definition at line 836 of file buffer.cpp.

void frepple::Buffer::setCarryingCost ( const double  c)
inline

Return the carrying cost.
The cost of carrying inventory in this buffer. The value is a percentage of the item sales price, per year and per unit.
The default value is 0.0.

Definition at line 2751 of file model.h.

void frepple::Buffer::setHidden ( bool  b)
inlinevirtual

Mark the object as hidden or not. Hidden objects are not exported and are used only as dummy constructs.

Reimplemented from frepple::utils::Object.

Definition at line 2811 of file model.h.

void frepple::Buffer::setItem ( Item i)
inline

Updates the Item stored in this buffer.

Definition at line 2706 of file model.h.

void frepple::Buffer::setLocation ( Location i)
inline

Updates the location of this buffer.

Definition at line 2712 of file model.h.

void frepple::Buffer::setMaximum ( double  m)

Updates the minimum inventory target for the buffer.

Definition at line 438 of file buffer.cpp.

void frepple::Buffer::setMaximumCalendar ( CalendarDouble cal)

Updates the minimum inventory target for the buffer.

Definition at line 469 of file buffer.cpp.

void frepple::Buffer::setMinimum ( double  m)

Updates the minimum inventory target for the buffer.

Definition at line 368 of file buffer.cpp.

void frepple::Buffer::setMinimumCalendar ( CalendarDouble cal)

Updates the minimum inventory target for the buffer.

Definition at line 399 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 92 of file buffer.cpp.

void frepple::Buffer::setProducingOperation ( Operation o)
inline

Updates the operation that is used to supply extra supply into this buffer.

Definition at line 2699 of file model.h.

virtual void frepple::Buffer::solve ( Solver s,
void *  v = NULL 
) const
inlinevirtual

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::BufferProcure, and frepple::BufferInfinite.

Definition at line 2790 of file model.h.

void frepple::Buffer::updateProblems ( )
virtual

Called to update the list of problems. The function will only be called when:

  • the list of problems is being recomputed
  • AND, problem detection is enabled for this object
  • AND, the object has changed since the last problem computation

Implements frepple::HasProblems.

Definition at line 28 of file problems_buffer.cpp.

void frepple::Buffer::writeElement ( XMLOutput o,
const Keyword tag,
mode  m = DEFAULT 
) const
virtual

Reimplemented from frepple::Plannable.

Reimplemented in frepple::BufferProcure, and frepple::BufferInfinite.

Definition at line 204 of file buffer.cpp.

Friends And Related Function Documentation

friend class Flow
friend

Definition at line 2680 of file model.h.

friend class FlowPlan
friend

Definition at line 2681 of file model.h.

Member Data Documentation

const MetaCategory * frepple::Buffer::metadata
static

Definition at line 2815 of file model.h.


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