frepple::Operation Class Reference
An operation represents an activity: these consume and produce material, take time and also require capacity. More...
#include <model.h>

Public Types | |
| typedef Association< Operation, Buffer, Flow >::ListA | flowlist |
| typedef Association< Operation, Resource, Load >::ListA | loadlist |
| typedef list< Operation * > | Operationlist |
Public Member Functions | |
| void | addSuperOperation (Operation *o) |
| void | beginElement (XMLInput &, const Attribute &) |
| virtual OperationPlan * | createOperationPlan (double, Date, Date, Demand *=NULL, OperationPlan *=NULL, unsigned long=0, bool makeflowsloads=true) const |
| void | deleteOperationPlans (bool deleteLockedOpplans=false) |
| void | endElement (XMLInput &, const Attribute &, const DataElement &) |
| size_t | extrasize () const |
| Flow * | findFlow (const Buffer *b, Date d) const |
| Load * | findLoad (const Resource *r, Date d) const |
| double | getCost () const |
| TimePeriod | getFence () const |
| OperationPlan * | getFirstOpPlan () const |
| const flowlist & | getFlows () const |
| bool | getHidden () const |
| const loadlist & | getLoads () const |
| Location * | getLocation () const |
| TimePeriod | getPostTime () const |
| TimePeriod | getPreTime () const |
| double | getSizeMinimum () const |
| double | getSizeMultiple () const |
| virtual const Operationlist & | getSubOperations () const |
| const Operationlist & | getSuperOperations () |
| virtual void | removeSubOperation (Operation *o) |
| void | removeSuperOperation (Operation *o) |
| void | setCost (const double c) |
| void | setFence (TimePeriod t) |
| void | setHidden (bool b) |
| void | setLocation (Location *l) |
| virtual void | setOperationPlanParameters (OperationPlan *, double, Date, Date, bool=true) const =0 |
| void | setPostTime (TimePeriod t) |
| void | setPreTime (TimePeriod t) |
| void | setSizeMinimum (double f) |
| void | setSizeMultiple (double f) |
| virtual void | solve (Solver &s, void *v=NULL) const |
| virtual void | updateProblems () |
| virtual void | writeElement (XMLOutput *, const Keyword &, mode=DEFAULT) const |
| virtual | ~Operation () |
Static Public Attributes | |
| static const MetaCategory | metadata |
Protected Member Functions | |
| void | initOperationPlan (OperationPlan *, double, const Date &, const Date &, Demand *, OperationPlan *, unsigned long, bool=true) const |
| Operation (const string &str) | |
Friends | |
| class | Flow |
| class | Load |
| class | OperationAlternate |
| class | OperationPlan |
| class | OperationRouting |
Detailed Description
An operation represents an activity: these consume and produce material, take time and also require capacity.
An operation consumes and produces material, modeled through flows.
An operation requires capacity, modeled through loads.
This is an abstract base class for all different operation types.
Definition at line 1363 of file model.h.
Member Typedef Documentation
| typedef Association<Operation,Buffer,Flow>::ListA frepple::Operation::flowlist |
| typedef Association<Operation,Resource,Load>::ListA frepple::Operation::loadlist |
| typedef list<Operation*> frepple::Operation::Operationlist |
Constructor & Destructor Documentation
| frepple::Operation::Operation | ( | const string & | str | ) | [inline, explicit, protected] |
| frepple::Operation::~Operation | ( | ) | [virtual] |
Destructor.
Definition at line 38 of file operation.cpp.
Member Function Documentation
| void frepple::Operation::addSuperOperation | ( | Operation * | o | ) | [inline] |
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.
Reimplemented in frepple::OperationRouting, and frepple::OperationAlternate.
Definition at line 163 of file operation.cpp.
| OperationPlan * frepple::Operation::createOperationPlan | ( | double | q, | |
| Date | s, | |||
| Date | e, | |||
| Demand * | l = NULL, |
|||
| OperationPlan * | ow = NULL, |
|||
| unsigned long | i = 0, |
|||
| bool | makeflowsloads = true | |||
| ) | const [virtual] |
This is the factory method which creates all operationplans of the operation.
Reimplemented in frepple::OperationRouting, and frepple::OperationAlternate.
Definition at line 88 of file operation.cpp.
| void frepple::Operation::deleteOperationPlans | ( | bool | deleteLockedOpplans = false |
) |
Deletes all operationplans of this operation. The boolean parameter controls whether we delete also locked operationplans or not.
Definition at line 121 of file operation.cpp.
| void frepple::Operation::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 also valid. NOTE: each object receives both its own beginElement so it can process its own element tag attributes, and its own endElement so it can process its own character data.
Reimplemented from frepple::Plannable.
Reimplemented in frepple::OperationFixedTime, frepple::OperationTimePer, frepple::OperationRouting, and frepple::OperationAlternate.
Definition at line 187 of file operation.cpp.
| size_t frepple::Operation::extrasize | ( | ) | const [inline] |
Returns the memory size in bytes.
Reimplemented from frepple::utils::HasDescription.
| double frepple::Operation::getCost | ( | ) | const [inline] |
| TimePeriod frepple::Operation::getFence | ( | ) | const [inline] |
| OperationPlan* frepple::Operation::getFirstOpPlan | ( | ) | const [inline] |
| const flowlist& frepple::Operation::getFlows | ( | ) | const [inline] |
| bool frepple::Operation::getHidden | ( | ) | const [inline, virtual] |
Returns whether an entity is real or dummy.
Reimplemented from frepple::utils::Object.
| const loadlist& frepple::Operation::getLoads | ( | ) | const [inline] |
| Location* frepple::Operation::getLocation | ( | ) | const [inline] |
| TimePeriod frepple::Operation::getPostTime | ( | ) | const [inline] |
Returns the delay after this operation.
- See also:
- setPostTime
| TimePeriod frepple::Operation::getPreTime | ( | ) | const [inline] |
Returns the delay before this operation.
- See also:
- setPreTime
| double frepple::Operation::getSizeMinimum | ( | ) | const [inline] |
| double frepple::Operation::getSizeMultiple | ( | ) | const [inline] |
| virtual const Operationlist& frepple::Operation::getSubOperations | ( | ) | const [inline, virtual] |
Returns a reference to the list of sub operations of this operation.
Reimplemented in frepple::OperationRouting, and frepple::OperationAlternate.
| const Operationlist& frepple::Operation::getSuperOperations | ( | ) | [inline] |
| void frepple::Operation::initOperationPlan | ( | OperationPlan * | opplan, | |
| double | q, | |||
| const Date & | s, | |||
| const Date & | e, | |||
| Demand * | l, | |||
| OperationPlan * | ow, | |||
| unsigned long | i, | |||
| bool | makeflowsloads = true | |||
| ) | const [protected] |
Definition at line 98 of file operation.cpp.
| virtual void frepple::Operation::removeSubOperation | ( | Operation * | o | ) | [inline, virtual] |
Removes a sub-operation from the list. This method will need to be overridden by all operation types that acts as a super-operation.
Reimplemented in frepple::OperationRouting, and frepple::OperationAlternate.
| void frepple::Operation::removeSuperOperation | ( | Operation * | o | ) | [inline] |
| void frepple::Operation::setCost | ( | const double | c | ) | [inline] |
| void frepple::Operation::setFence | ( | TimePeriod | t | ) | [inline] |
| void frepple::Operation::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::Operation::setLocation | ( | Location * | l | ) | [inline] |
| virtual void frepple::Operation::setOperationPlanParameters | ( | OperationPlan * | , | |
| double | , | |||
| Date | , | |||
| Date | , | |||
| bool | = true | |||
| ) | const [pure virtual] |
This method stores ALL logic the operation needs to compute the correct relationship between the quantity, startdate and enddate of an operationplan.
The parameters "startdate", "enddate" and "quantity" can be conflicting if all are specified together. Typically, one would use one of the following combinations:
- specify quantity and start date, and let the operation compute the end date.
- specify quantity and end date, and let the operation compute the start date.
- specify both the start and end date, and let the operation compute the quantity.
- specify quantity, start and end date. In this case, you need to be aware that the operationplan that is created can be different from the parameters you requested.
The following priority rules apply upon conflicts.
- respecting the end date has the first priority.
- respecting the start date has second priority.
- respecting the quantity should be done if the specified dates can be respected.
- if the quantity is being computed to meet the specified dates, the quantity being passed as argument is to be treated as a maximum limit. The created operationplan can have a smaller quantity, but not bigger...
- at all times, we expect to have an operationplan that is respecting the constraints set by the operation. If required, some of the specified parameters may need to be violated. In case of such a violation we expect the operationplan quantity to be 0.
The pre- and post-operation times are NOT considered in this method. This method only enforces "hard" constraints. "Soft" constraints are considered as 'hints' by the solver.
Subclasses need to override this method to implement the correct logic.
Implemented in frepple::OperationFixedTime, frepple::OperationTimePer, frepple::OperationRouting, and frepple::OperationAlternate.
| void frepple::Operation::setPostTime | ( | TimePeriod | t | ) | [inline] |
Updates the delay after this operation.
This delay is a soft constraint. This means that solvers should try to respect this waiting time but can choose to leave a shorter time delay if required.
- See also:
- setPreTime
| void frepple::Operation::setPreTime | ( | TimePeriod | t | ) | [inline] |
Updates the delay before this operation.
This delay is a soft constraint. This means that solvers should try to respect this waiting time but can choose to leave a shorter time delay if required.
- See also:
- setPostTime
| void frepple::Operation::setSizeMinimum | ( | double | f | ) | [inline] |
| void frepple::Operation::setSizeMultiple | ( | double | f | ) | [inline] |
| virtual void frepple::Operation::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::OperationFixedTime, frepple::OperationTimePer, frepple::OperationRouting, and frepple::OperationAlternate.
| void frepple::Operation::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 34 of file problems_operationplan.cpp.
| void frepple::Operation::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::OperationFixedTime, frepple::OperationTimePer, frepple::OperationRouting, and frepple::OperationAlternate.
Definition at line 127 of file operation.cpp.
Friends And Related Function Documentation
friend class OperationAlternate [friend] |
friend class OperationPlan [friend] |
friend class OperationRouting [friend] |
Member Data Documentation
const MetaCategory frepple::Operation::metadata [static] |
Reimplemented in frepple::OperationFixedTime, frepple::OperationTimePer, frepple::OperationRouting, and frepple::OperationAlternate.
The documentation for this class was generated from the following files:
Documentation generated by
