frepple::Demand Class Reference
Represents the (independent) demand in the system. It can represent a customer order or a forecast. More...
#include <model.h>

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, CommandList *=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 |
Problem::List & | getConstraints () |
const Problem::List & | getConstraints () const |
Customer * | getCustomer () const |
const OperationPlan_list & | getDelivery () const |
Operation * | getDeliveryOperation () const |
const Date & | getDue () const |
OperationPlan * | getEarliestDelivery () const |
bool | getHidden () const |
Item * | getItem () const |
OperationPlan * | getLatestDelivery () const |
TimePeriod | getMaxLateness () const |
double | getMinShipment () const |
Operation * | getOperation () const |
double | getPlannedQuantity () const |
int | getPriority () const |
double | getQuantity () const |
virtual const MetaClass & | getType () 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 () |
Static Public Member Functions | |
static int | initialize () |
Static Public Attributes | |
static const MetaCategory * | metadata |
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 4571 of file model.h.
Member Typedef Documentation
typedef slist<OperationPlan*> frepple::Demand::OperationPlan_list |
Constructor & Destructor Documentation
frepple::Demand::Demand | ( | const string & | str | ) | [inline, explicit] |
virtual frepple::Demand::~Demand | ( | ) | [inline, virtual] |
Member Function Documentation
void frepple::Demand::addDelivery | ( | OperationPlan * | o | ) |
Adds a delivery operationplan for this demand.
Definition at line 183 of file demand.cpp.
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 >.
Reimplemented in module_forecast::Forecast.
Definition at line 291 of file demand.cpp.
void frepple::Demand::deleteOperationPlans | ( | bool | deleteLockedOpplans = false , |
|
CommandList * | 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 75 of file demand.cpp.
void frepple::Demand::endElement | ( | XMLInput & | pIn, | |
const Attribute & | pAttr, | |||
const DataElement & | pElement | |||
) | [virtual] |
Reimplemented from frepple::Plannable.
Reimplemented in module_forecast::Forecast.
Definition at line 306 of file demand.cpp.
size_t frepple::Demand::extrasize | ( | ) | const [inline] |
Returns the memory size in bytes.
Reimplemented from frepple::utils::HasDescription.
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.
Reimplemented in module_forecast::Forecast, and module_forecast::ForecastBucket.
Definition at line 352 of file demand.cpp.
int frepple::Demand::getCluster | ( | ) | const [inline] |
Problem::List& frepple::Demand::getConstraints | ( | ) | [inline] |
const Problem::List& frepple::Demand::getConstraints | ( | ) | const [inline] |
Customer* frepple::Demand::getCustomer | ( | ) | const [inline] |
const Demand::OperationPlan_list & frepple::Demand::getDelivery | ( | ) | const |
Returns the delivery operationplan list.
Definition at line 134 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 220 of file demand.cpp.
const Date& frepple::Demand::getDue | ( | ) | const [inline] |
OperationPlan * frepple::Demand::getEarliestDelivery | ( | ) | const |
Returns the earliest delivery operationplan.
Definition at line 173 of file demand.cpp.
bool frepple::Demand::getHidden | ( | ) | const [inline, virtual] |
Returns true if this demand is to be hidden from serialization.
Reimplemented from frepple::utils::Object.
Item* frepple::Demand::getItem | ( | ) | const [inline] |
OperationPlan * frepple::Demand::getLatestDelivery | ( | ) | const |
Returns the latest delivery operationplan.
Definition at line 166 of file demand.cpp.
TimePeriod frepple::Demand::getMaxLateness | ( | ) | const [inline] |
double frepple::Demand::getMinShipment | ( | ) | const [inline] |
Operation* frepple::Demand::getOperation | ( | ) | const [inline] |
double frepple::Demand::getPlannedQuantity | ( | ) | const |
Returns the total amount that has been planned.
Definition at line 231 of file demand.cpp.
int frepple::Demand::getPriority | ( | ) | const [inline] |
double frepple::Demand::getQuantity | ( | ) | const [inline] |
virtual const MetaClass& frepple::Demand::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::DemandDefault, module_forecast::Forecast, and module_forecast::ForecastBucket.
int frepple::Demand::initialize | ( | ) | [static] |
Reimplemented in frepple::DemandDefault, module_forecast::Forecast, and module_forecast::ForecastBucket.
Definition at line 39 of file demand.cpp.
void frepple::Demand::removeDelivery | ( | OperationPlan * | o | ) |
Removes a delivery operationplan for this demand.
Definition at line 104 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.
Reimplemented in module_forecast::Forecast, and module_forecast::ForecastBucket.
Definition at line 392 of file demand.cpp.
virtual void frepple::Demand::setCustomer | ( | Customer * | c | ) | [inline, virtual] |
Updates the customer.
Reimplemented in module_forecast::Forecast.
virtual void frepple::Demand::setDue | ( | Date | d | ) | [inline, virtual] |
void frepple::Demand::setHidden | ( | bool | b | ) | [inline, virtual] |
Specifies whether of not this demand is to be hidden from serialization. The default value is false.
Reimplemented from frepple::utils::Object.
virtual void frepple::Demand::setItem | ( | Item * | i | ) | [inline, virtual] |
Updates the item/product being requested.
Reimplemented in module_forecast::Forecast.
virtual void frepple::Demand::setMaxLateness | ( | TimePeriod | m | ) | [inline, virtual] |
Updates the maximum allowed lateness for this demand.
The default value is infinite.
The argument must be a positive time period.
Reimplemented in module_forecast::Forecast.
virtual void frepple::Demand::setMinShipment | ( | double | m | ) | [inline, virtual] |
Updates the maximum allowed lateness for this demand.
The default value is infinite.
The argument must be a positive time period.
Reimplemented in module_forecast::Forecast.
virtual void frepple::Demand::setOperation | ( | Operation * | o | ) | [inline, virtual] |
Updates the operation being used to plan the demand.
Reimplemented in module_forecast::Forecast.
virtual void frepple::Demand::setPriority | ( | int | i | ) | [inline, virtual] |
Updates the due date of the demand.
Lower numbers indicate a higher priority level.
Reimplemented in module_forecast::Forecast.
void frepple::Demand::setQuantity | ( | double | f | ) | [virtual] |
Updates the quantity of the demand. The quantity must be be greater than or equal to 0.
Reimplemented in module_forecast::Forecast.
Definition at line 62 of file demand.cpp.
virtual void frepple::Demand::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.
void frepple::Demand::updateProblems | ( | ) | [virtual] |
Recompute the problems.
Implements frepple::HasProblems.
Definition at line 35 of file problems_demand.cpp.
void frepple::Demand::writeElement | ( | XMLOutput * | o, | |
const Keyword & | tag, | |||
mode | m = DEFAULT | |||
) | const [virtual] |
Reimplemented from frepple::Plannable.
Reimplemented in module_forecast::Forecast.
Definition at line 240 of file demand.cpp.
Member Data Documentation
const MetaCategory * frepple::Demand::metadata [static] |
Reimplemented in frepple::DemandDefault, module_forecast::Forecast, and module_forecast::ForecastBucket.
The documentation for this class was generated from the following files:
Documentation generated for frePPLe by
