module_forecast::Forecast Class Reference
This class represents a bucketized demand signal. More...
#include <forecast.h>

Classes | |
class | Croston |
A class to calculate a forecast with Croston's method. More... | |
class | DoubleExponential |
A class to perform double exponential smoothing on a time series. More... | |
class | ForecastMethod |
Abstract base class for all forecasting methods. More... | |
class | MovingAverage |
A class to calculate a forecast based on a moving average. More... | |
class | Seasonal |
A class to perform seasonal forecasting on a time series. More... | |
class | SingleExponential |
A class to perform single exponential smoothing on a time series. More... | |
Public Types | |
typedef multimap< pair< const Item *, const Customer * > , Forecast * > | MapOfForecasts |
Public Member Functions | |
void | beginElement (XMLInput &pIn, const Attribute &pAttr) |
void | endElement (XMLInput &pIn, const Attribute &pAttr, const DataElement &pElement) |
Forecast (const string &nm) | |
void | generateFutureValues (const double[], unsigned int, const Date[], unsigned int, bool=false) |
virtual PyObject * | getattro (const Attribute &) |
Calendar * | getCalendar () const |
bool | getDiscrete () const |
virtual size_t | getSize () const |
virtual const MetaClass & | getType () const |
virtual int | setattro (const Attribute &, const PythonObject &) |
virtual void | setCalendar (Calendar *) |
virtual void | setCustomer (Customer *) |
void | setDiscrete (const bool b) |
virtual void | setDue (const Date &d) |
virtual void | setItem (Item *) |
void | setMaxLateness (TimePeriod) |
void | setMinShipment (double) |
virtual void | setOperation (Operation *) |
virtual void | setPriority (int) |
virtual void | setQuantity (double f) |
virtual void | setTotalQuantity (const DateRange &, double) |
void | writeElement (XMLOutput *, const Keyword &, mode=DEFAULT) const |
~Forecast () | |
Static Public Member Functions | |
static bool | callback (Calendar *, const Signal) |
static bool | getCustomerThenItemHierarchy () |
static unsigned long | getForecastIterations () |
static const MapOfForecasts & | getForecasts () |
static unsigned int | getForecastSkip () |
static double | getForecastSmapeAlfa () |
static bool | getMatchUsingDeliveryOperation () |
static TimePeriod | getNetEarly () |
static TimePeriod | getNetLate () |
static int | initialize () |
static void | setCustomerThenItemHierarchy (bool b) |
static void | setForecastIterations (unsigned long t) |
static void | setForecastSkip (unsigned int t) |
static void | setForecastSmapeAlfa (double t) |
static void | setMatchUsingDeliveryOperation (bool b) |
static void | setNetEarly (TimePeriod t) |
static void | setNetLate (TimePeriod t) |
static PyObject * | timeseries (PyObject *, PyObject *) |
Static Public Attributes | |
static const MetaClass * | metadata |
static const Keyword | tag_consumed |
static const Keyword | tag_net |
static const Keyword | tag_total |
Friends | |
class | ForecastSolver |
Detailed Description
This class represents a bucketized demand signal.
The forecast object defines the item and priority of the demands.
A calendar (of type void, double, integer or boolean) divides the time horizon in individual time buckets. The calendar value is used to assign priorities to the time buckets.
The class basically works as an interface for a hierarchy of demands, where the lower level demands represent forecasting time buckets.
Definition at line 292 of file forecast.h.
Member Typedef Documentation
typedef multimap< pair<const Item*, const Customer*>, Forecast* > module_forecast::Forecast::MapOfForecasts |
A data type to maintain a dictionary of all forecasts.
Definition at line 1034 of file forecast.h.
Constructor & Destructor Documentation
module_forecast::Forecast::Forecast | ( | const string & | nm | ) | [inline, explicit] |
Constructor.
Definition at line 871 of file forecast.h.
module_forecast::Forecast::~Forecast | ( | ) |
Destructor.
Definition at line 93 of file forecast.cpp.
Member Function Documentation
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::Demand.
Definition at line 378 of file forecast.cpp.
Callback function, used for prevent a calendar from being deleted when it is used for an uninitialized forecast.
Definition at line 79 of file forecast.cpp.
void module_forecast::Forecast::endElement | ( | XMLInput & | pIn, | |
const Attribute & | pAttr, | |||
const DataElement & | pElement | |||
) | [virtual] |
Reimplemented from frepple::Demand.
Definition at line 307 of file forecast.cpp.
void module_forecast::Forecast::generateFutureValues | ( | const double | history[], | |
unsigned int | historycount, | |||
const Date | buckets[], | |||
unsigned int | bucketcount, | |||
bool | debug = false | |||
) |
Generate a forecast value based on historical demand data.
This method will call the different forecasting methods and select the method with the lowest smape-error.
It then asks the selected forecast method to generate a value for each of the time buckets passed.
Definition at line 35 of file timeseries.cpp.
PyObject * module_forecast::Forecast::getattro | ( | const Attribute & | attr | ) | [virtual] |
Default getattro method.
Subclasses are expected to implement an override if the type supports gettattro.
Reimplemented from frepple::Demand.
Definition at line 34 of file pythonforecast.cpp.
Calendar* module_forecast::Forecast::getCalendar | ( | ) | const [inline] |
Returns a reference to the calendar used for this forecast.
Definition at line 931 of file forecast.h.
static bool module_forecast::Forecast::getCustomerThenItemHierarchy | ( | ) | [inline, static] |
Returns the value of the Customer_Then_Item_Hierarchy module parameter.
Definition at line 970 of file forecast.h.
bool module_forecast::Forecast::getDiscrete | ( | ) | const [inline] |
Returns whether fractional forecasts are allowed or not.
The default is true.
Definition at line 908 of file forecast.h.
static unsigned long module_forecast::Forecast::getForecastIterations | ( | ) | [inline, static] |
Returns the value of the Forecast_Iterations module parameter.
Definition at line 1017 of file forecast.h.
static const MapOfForecasts& module_forecast::Forecast::getForecasts | ( | ) | [inline, static] |
Return a reference to a dictionary with all forecast objects.
Definition at line 1041 of file forecast.h.
static unsigned int module_forecast::Forecast::getForecastSkip | ( | ) | [inline, static] |
Return the number of timeseries values used to initialize the algorithm. The forecast error is not counted for these buckets.
Definition at line 1031 of file forecast.h.
static double module_forecast::Forecast::getForecastSmapeAlfa | ( | ) | [inline, static] |
Returns the value of the Forecast_Iterations module parameter.
Definition at line 1005 of file forecast.h.
static bool module_forecast::Forecast::getMatchUsingDeliveryOperation | ( | ) | [inline, static] |
Returns the value of the Match_Using_Delivery_Operation module parameter.
Definition at line 980 of file forecast.h.
static TimePeriod module_forecast::Forecast::getNetEarly | ( | ) | [inline, static] |
Returns the value of the Net_Early module parameter.
Definition at line 987 of file forecast.h.
static TimePeriod module_forecast::Forecast::getNetLate | ( | ) | [inline, static] |
Returns the value of the Net_Late module parameter.
Definition at line 993 of file forecast.h.
virtual size_t module_forecast::Forecast::getSize | ( | ) | const [inline, virtual] |
Return the memory size of the object in bytes.
Implements frepple::utils::Object.
Definition at line 957 of file forecast.h.
virtual const MetaClass& module_forecast::Forecast::getType | ( | ) | const [inline, virtual] |
This returns the type information on the object, a bit similar to the standard type_info information.
Reimplemented from frepple::Demand.
Definition at line 955 of file forecast.h.
int module_forecast::Forecast::initialize | ( | ) | [static] |
Reimplemented from frepple::Demand.
Definition at line 41 of file forecast.cpp.
int module_forecast::Forecast::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::Demand.
Definition at line 44 of file pythonforecast.cpp.
void module_forecast::Forecast::setCalendar | ( | Calendar * | c | ) | [virtual] |
Specify a bucket calendar for the forecast. Once forecasted quantities have been entered for the forecast, the calendar can't be updated any more.
Definition at line 387 of file forecast.cpp.
void module_forecast::Forecast::setCustomer | ( | Customer * | i | ) | [virtual] |
Update the customer.
Reimplemented from frepple::Demand.
Definition at line 423 of file forecast.cpp.
static void module_forecast::Forecast::setCustomerThenItemHierarchy | ( | bool | b | ) | [inline, static] |
Updates the value of the Customer_Then_Item_Hierarchy module parameter.
Definition at line 965 of file forecast.h.
void module_forecast::Forecast::setDiscrete | ( | const bool | b | ) |
Updates forecast discreteness flag.
Definition at line 189 of file forecast.cpp.
virtual void module_forecast::Forecast::setDue | ( | const Date & | d | ) | [inline, virtual] |
Updates the due date of the demand.
Definition at line 952 of file forecast.h.
static void module_forecast::Forecast::setForecastIterations | ( | unsigned long | t | ) | [inline, static] |
Updates the value of the Forecast_Iterations module parameter.
Definition at line 1008 of file forecast.h.
static void module_forecast::Forecast::setForecastSkip | ( | unsigned int | t | ) | [inline, static] |
Updates the value of the Forecast_Skip module parameter.
Definition at line 1020 of file forecast.h.
static void module_forecast::Forecast::setForecastSmapeAlfa | ( | double | t | ) | [inline, static] |
Updates the value of the Forecast.smapeAlfa module parameter.
Definition at line 996 of file forecast.h.
void module_forecast::Forecast::setItem | ( | Item * | i | ) | [virtual] |
Update the item to be planned.
Reimplemented from frepple::Demand.
Definition at line 396 of file forecast.cpp.
static void module_forecast::Forecast::setMatchUsingDeliveryOperation | ( | bool | b | ) | [inline, static] |
Updates the value of the Match_Using_Delivery_Operation module parameter.
Definition at line 975 of file forecast.h.
void module_forecast::Forecast::setMaxLateness | ( | TimePeriod | m | ) | [virtual] |
Updates the maximum allowed lateness for this demand.
The default value is infinite.
The argument must be a positive time period.
Reimplemented from frepple::Demand.
Definition at line 450 of file forecast.cpp.
void module_forecast::Forecast::setMinShipment | ( | double | m | ) | [virtual] |
Updates the maximum allowed lateness for this demand.
The default value is infinite.
The argument must be a positive time period.
Reimplemented from frepple::Demand.
Definition at line 459 of file forecast.cpp.
static void module_forecast::Forecast::setNetEarly | ( | TimePeriod | t | ) | [inline, static] |
Updates the value of the Net_Early module parameter.
Definition at line 984 of file forecast.h.
static void module_forecast::Forecast::setNetLate | ( | TimePeriod | t | ) | [inline, static] |
Updates the value of the Net_Late module parameter.
Definition at line 990 of file forecast.h.
void module_forecast::Forecast::setOperation | ( | Operation * | o | ) | [virtual] |
Updates the operation being used to plan the demands.
Reimplemented from frepple::Demand.
Definition at line 477 of file forecast.cpp.
void module_forecast::Forecast::setPriority | ( | int | i | ) | [virtual] |
Updates the due date of the demand. Lower numbers indicate a higher priority level. The method also updates the priority in all buckets.
Reimplemented from frepple::Demand.
Definition at line 468 of file forecast.cpp.
virtual void module_forecast::Forecast::setQuantity | ( | double | f | ) | [inline, virtual] |
Updates the quantity of the forecast. This method is empty.
Reimplemented from frepple::Demand.
Definition at line 878 of file forecast.h.
void module_forecast::Forecast::setTotalQuantity | ( | const DateRange & | d, | |
double | f | |||
) | [virtual] |
Update the forecast quantity.
The forecast quantity will be distributed equally among the buckets available between the two dates, taking into account also the bucket weights.
The logic applied is briefly summarized as follows:
- If the daterange has its start and end dates equal, we find the matching forecast bucket and update the quantity.
- Otherwise the quantity is distributed among all intersecting forecast buckets. This distribution is considering the weigth of the bucket and the time duration of the bucket.
The bucket weight is the value specified on the calendar.
If a forecast bucket only partially overlaps with the daterange only the overlapping time is used as the duration. - If only buckets with zero weigth are found in the daterange a dataexception is thrown. It indicates a situation where forecast is specified for a date where no values are allowed.
Definition at line 201 of file forecast.cpp.
PyObject * module_forecast::Forecast::timeseries | ( | PyObject * | self, | |
PyObject * | args | |||
) | [static] |
Definition at line 64 of file pythonforecast.cpp.
void module_forecast::Forecast::writeElement | ( | XMLOutput * | o, | |
const Keyword & | tag, | |||
mode | m = DEFAULT | |||
) | const [virtual] |
Reimplemented from frepple::Demand.
Definition at line 270 of file forecast.cpp.
Friends And Related Function Documentation
friend class ForecastSolver [friend] |
Definition at line 294 of file forecast.h.
Member Data Documentation
const MetaClass * module_forecast::Forecast::metadata [static] |
Reimplemented from frepple::Demand.
Definition at line 956 of file forecast.h.
const Keyword module_forecast::Forecast::tag_consumed [static] |
Definition at line 299 of file forecast.h.
const Keyword module_forecast::Forecast::tag_net [static] |
Definition at line 298 of file forecast.h.
const Keyword module_forecast::Forecast::tag_total [static] |
Definition at line 297 of file forecast.h.
The documentation for this class was generated from the following files:
Documentation generated for frePPLe by
