Represents the (independent) demand in the system. It can represent a customer order or a forecast. More...

#include <model.h>

Inheritance diagram for frepple::Demand:

List of all members.

Public Types

typedef slist< OperationPlan * > OperationPlan_list

Public Member Functions

void addDelivery (OperationPlan *o)
virtual void beginElement (XMLInput &, const Attribute &)
void deleteOperationPlans (bool deleteLockedOpplans=false, CommandManager *=NULL)
 Demand (const string &str)
virtual void endElement (XMLInput &, const Attribute &, const DataElement &)
size_t extrasize () const
virtual PyObject * getattro (const Attribute &)
int getCluster () const
const Problem::ListgetConstraints () const
Problem::ListgetConstraints ()
CustomergetCustomer () const
const OperationPlan_listgetDelivery () const
OperationgetDeliveryOperation () const
const DategetDue () const
OperationPlangetEarliestDelivery () const
bool getHidden () const
ItemgetItem () const
OperationPlangetLatestDelivery () const
TimePeriod getMaxLateness () const
double getMinShipment () const
OperationgetOperation () const
double getPlannedQuantity () const
int getPriority () const
double getQuantity () const
virtual const MetaClassgetType () const
void removeDelivery (OperationPlan *o)
virtual int setattro (const Attribute &, const PythonObject &)
virtual void setCustomer (Customer *c)
virtual void setDue (Date d)
void setHidden (bool b)
virtual void setItem (Item *i)
virtual void setMaxLateness (TimePeriod m)
virtual void setMinShipment (double m)
virtual void setOperation (Operation *o)
virtual void setPriority (int i)
virtual void setQuantity (double)
virtual void solve (Solver &s, void *v=NULL) const
virtual void updateProblems ()
virtual void writeElement (XMLOutput *, const Keyword &, mode=DEFAULT) const
virtual ~Demand ()
- Public Member Functions inherited from frepple::utils::HasHierarchy< Demand >
memberIterator beginMember () const
unsigned short getHierarchyLevel () const
DemandgetOwner () const
 HasHierarchy (const string &n)
bool hasOwner () const
bool isGroup () const
void setOwner (Demand *f)
 ~HasHierarchy ()
- Public Member Functions inherited from frepple::utils::HasName< Demand >
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::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
string getCategory () const
string getDescription () const
string getSubCategory () const
void setCategory (const string &f)
void setDescription (const string &f)
void setSubCategory (const string &f)

Static Public Member Functions

static int initialize ()
- 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

Detailed Description

Represents the (independent) demand in the system. It can represent a customer order or a forecast.

This is an abstract class.

Definition at line 4342 of file model.h.


Member Typedef Documentation

Definition at line 4346 of file model.h.


Constructor & Destructor Documentation

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

Constructor.

Definition at line 4349 of file model.h.

virtual frepple::Demand::~Demand ( )
inlinevirtual

Destructor. Deleting the demand will also delete all delivery operation plans (including locked ones).

Definition at line 4355 of file model.h.


Member Function Documentation

void frepple::Demand::addDelivery ( OperationPlan o)

Adds a delivery operationplan for this demand.

Definition at line 176 of file demand.cpp.

void frepple::Demand::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::HasHierarchy< Demand >.

Definition at line 284 of file demand.cpp.

void frepple::Demand::deleteOperationPlans ( bool  deleteLockedOpplans = false,
CommandManager cmds = NULL 
)

Deletes all delivery operationplans of this demand.
The (optional) boolean parameter controls whether we delete also locked operationplans or not.
The second (optional) argument is a command list that can be used to remove the operationplans in an undo-able way.

Definition at line 68 of file demand.cpp.

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

Reimplemented from frepple::Plannable.

Definition at line 299 of file demand.cpp.

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

Returns the memory size in bytes.

Reimplemented from frepple::utils::HasDescription.

Definition at line 4460 of file model.h.

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

Definition at line 345 of file demand.cpp.

int frepple::Demand::getCluster ( ) const
inline

Returns the cluster which this demand belongs to.

Definition at line 4399 of file model.h.

const Problem::List& frepple::Demand::getConstraints ( ) const
inline

Return a reference to the constraint list.

Definition at line 4445 of file model.h.

Problem::List& frepple::Demand::getConstraints ( )
inline

Return a reference to the constraint list.

Definition at line 4448 of file model.h.

Customer* frepple::Demand::getCustomer ( ) const
inline

Returns the customer.

Definition at line 4439 of file model.h.

const Demand::OperationPlan_list & frepple::Demand::getDelivery ( ) const

Returns the delivery operationplan list.

Definition at line 127 of file demand.cpp.

Operation * frepple::Demand::getDeliveryOperation ( ) const

This function returns the operation that is to be used to satisfy this demand. In sequence of priority this goes as follows: 1) If the "operation" field on the demand is set, use it. 2) Otherwise, use the "delivery" field of the requested item. 3) Else, return NULL. This demand can't be satisfied!

Definition at line 213 of file demand.cpp.

const Date& frepple::Demand::getDue ( ) const
inline

Returns the due date of the demand.

Definition at line 4433 of file model.h.

OperationPlan * frepple::Demand::getEarliestDelivery ( ) const

Returns the earliest delivery operationplan.

Definition at line 166 of file demand.cpp.

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

Returns true if this demand is to be hidden from serialization.

Reimplemented from frepple::utils::Object.

Definition at line 4509 of file model.h.

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

Returns the item/product being requested.

Definition at line 4378 of file model.h.

OperationPlan * frepple::Demand::getLatestDelivery ( ) const

Returns the latest delivery operationplan.

Definition at line 159 of file demand.cpp.

TimePeriod frepple::Demand::getMaxLateness ( ) const
inline

Return the maximum delay allowed in satisfying this demand.
The default value is infinite.

Definition at line 4471 of file model.h.

double frepple::Demand::getMinShipment ( ) const
inline

Return the minimum shipment quantity allowed in satisfying this demand.
The default value is 1.

Definition at line 4488 of file model.h.

Operation* frepple::Demand::getOperation ( ) const
inline

This fields points to an operation that is to be used to plan the demand. By default, the field is left to NULL and the demand will then be planned using the delivery operation of its item.

See also:
Item::getDelivery()

Definition at line 4388 of file model.h.

double frepple::Demand::getPlannedQuantity ( ) const

Returns the total amount that has been planned.

Definition at line 224 of file demand.cpp.

int frepple::Demand::getPriority ( ) const
inline

Returns the priority of the demand.
Lower numbers indicate a higher priority level.

Definition at line 4370 of file model.h.

double frepple::Demand::getQuantity ( ) const
inline

Returns the quantity of the demand.

Definition at line 4361 of file model.h.

virtual const MetaClass& frepple::Demand::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::DemandDefault.

Definition at line 4511 of file model.h.

int frepple::Demand::initialize ( )
static

Reimplemented in frepple::DemandDefault.

Definition at line 32 of file demand.cpp.

void frepple::Demand::removeDelivery ( OperationPlan o)

Removes a delivery operationplan for this demand.

Definition at line 97 of file demand.cpp.

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

Definition at line 387 of file demand.cpp.

virtual void frepple::Demand::setCustomer ( Customer c)
inlinevirtual

Updates the customer.

Definition at line 4442 of file model.h.

virtual void frepple::Demand::setDue ( Date  d)
inlinevirtual

Updates the due date of the demand.

Definition at line 4436 of file model.h.

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

Specifies whether of not this demand is to be hidden from serialization. The default value is false.

Reimplemented from frepple::utils::Object.

Definition at line 4506 of file model.h.

virtual void frepple::Demand::setItem ( Item i)
inlinevirtual

Updates the item/product being requested.

Definition at line 4381 of file model.h.

virtual void frepple::Demand::setMaxLateness ( TimePeriod  m)
inlinevirtual

Updates the maximum allowed lateness for this demand.
The default value is infinite.
The argument must be a positive time period.

Definition at line 4477 of file model.h.

virtual void frepple::Demand::setMinShipment ( double  m)
inlinevirtual

Updates the maximum allowed lateness for this demand.
The default value is infinite.
The argument must be a positive time period.

Definition at line 4494 of file model.h.

virtual void frepple::Demand::setOperation ( Operation o)
inlinevirtual

Updates the operation being used to plan the demand.

Definition at line 4406 of file model.h.

virtual void frepple::Demand::setPriority ( int  i)
inlinevirtual

Updates the due date of the demand.
Lower numbers indicate a higher priority level.

Definition at line 4375 of file model.h.

void frepple::Demand::setQuantity ( double  f)
virtual

Updates the quantity of the demand. The quantity must be be greater than or equal to 0.

Definition at line 55 of file demand.cpp.

virtual void frepple::Demand::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.

Definition at line 4466 of file model.h.

void frepple::Demand::updateProblems ( )
virtual

Recompute the problems.

Implements frepple::HasProblems.

Definition at line 28 of file problems_demand.cpp.

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

Reimplemented from frepple::Plannable.

Definition at line 233 of file demand.cpp.


Member Data Documentation

const MetaCategory * frepple::Demand::metadata
static

Reimplemented in frepple::DemandDefault.

Definition at line 4512 of file model.h.


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