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 &) |
DateRange | calculateOperationTime (Date thedate, TimePeriod duration, bool forward, TimePeriod *actualduration=NULL) const |
DateRange | calculateOperationTime (Date start, Date end, TimePeriod *actualduration=NULL) const |
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 |
virtual PyObject * | getattro (const Attribute &) |
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 | getSizeMaximum () const |
double | getSizeMinimum () const |
double | getSizeMultiple () const |
virtual const Operationlist & | getSubOperations () const |
const Operationlist & | getSuperOperations () const |
virtual void | removeSubOperation (Operation *o) |
void | removeSuperOperation (Operation *o) |
virtual int | setattro (const Attribute &, const PythonObject &) |
void | setCost (const double c) |
void | setFence (TimePeriod t) |
void | setHidden (bool b) |
void | setLocation (Location *l) |
virtual OperationPlanState | setOperationPlanParameters (OperationPlan *, double, Date, Date, bool=true, bool=true) const =0 |
void | setPostTime (TimePeriod t) |
void | setPreTime (TimePeriod t) |
void | setSizeMaximum (double f) |
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 () |
![]() | |
int | compare (const PyObject *other) const |
void | endElement (XMLInput &pIn, const Attribute &pAttr, const DataElement &pElement) |
HasName (const string &n) | |
HasName (const char *n) | |
void | setName (const string &newname) |
virtual PyObject * | str () const |
~HasName () | |
![]() | |
TreeNode * | decrement () const |
const string & | getName () const |
TreeNode * | increment () const |
bool | operator< (const TreeNode &o) |
TreeNode (const string &n) | |
virtual | ~TreeNode () |
![]() | |
virtual size_t | getSize () const =0 |
virtual const MetaClass & | getType () const =0 |
Object () | |
virtual | ~Object () |
![]() | |
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 () |
![]() | |
unsigned short | getCluster () const |
short | getLevel () const |
![]() | |
bool | getChanged () const |
bool | getDetectProblems () const |
Plannable * | getEntity () const |
Plannable () | |
void | setChanged (bool b=true) |
void | setDetectProblems (bool b) |
![]() | |
HasProblems () | |
virtual | ~HasProblems () |
![]() | |
virtual | ~Solvable () |
![]() | |
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 Operation * | add (const string &k, const MetaClass &cls) |
static Operation * | add (Operation *t) |
static Operation * | add (Operation *t, Operation *hint) |
static iterator | begin () |
static void | clear () |
static bool | empty () |
static iterator | end () |
static Operation * | find (const string &k) |
static Operation * | findLowerBound (const string &k, bool *f=NULL) |
static Object * | reader (const MetaClass *cat, const AttributeList &in) |
static size_t | size () |
static void | verify () |
static void | writer (const MetaCategory *c, XMLOutput *o) |
![]() | |
template<class T > | |
static PyObject * | create (PyTypeObject *pytype, PyObject *args, PyObject *kwds) |
template<class T > | |
static Object * | createDefault () |
template<class T > | |
static Object * | createString (const string &n) |
static PyObject * | toXML (PyObject *, PyObject *) |
![]() | |
static unsigned short | getNumberOfClusters () |
static unsigned short | getNumberOfHangingClusters () |
static void | triggerLazyRecomputation () |
![]() | |
static void | computeProblems () |
![]() | |
static EntityIterator | beginEntity () |
static EntityIterator | endEntity () |
Static Public Attributes | |
static const MetaCategory * | metadata |
Protected Member Functions | |
virtual bool | extraInstantiate (OperationPlan *o) |
void | initOperationPlan (OperationPlan *, double, const Date &, const Date &, Demand *, OperationPlan *, unsigned long, bool=true) const |
Operation (const string &str) | |
![]() | |
HasLevel () | |
HasLevel (const HasLevel &o) | |
~HasLevel () | |
![]() | |
size_t | extrasize () const |
Friends | |
class | Flow |
class | Load |
class | OperationAlternate |
class | OperationPlan |
class | OperationRouting |
Additional Inherited Members | |
![]() | |
static PythonType * | registerPythonType (int, const type_info *) |
![]() | |
static void | computeLevels () |
![]() | |
static vector< PythonType * > | table |
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.
typedef Association<Operation,Buffer,Flow>::ListA frepple::Operation::flowlist |
typedef Association<Operation,Resource,Load>::ListA frepple::Operation::loadlist |
typedef list<Operation*> frepple::Operation::Operationlist |
|
inlineexplicitprotected |
|
virtual |
Destructor.
Definition at line 114 of file operation.cpp.
|
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::OperationAlternate, and frepple::OperationRouting.
Definition at line 524 of file operation.cpp.
DateRange frepple::Operation::calculateOperationTime | ( | Date | thedate, |
TimePeriod | duration, | ||
bool | forward, | ||
TimePeriod * | actualduration = NULL |
||
) | const |
Calculates the daterange starting from (or ending at) a certain date and using a certain amount of effective available time on the operation.
This calculation considers the availability calendars of:
[in] | thedate | The date from which to start searching. |
[in] | duration | The amount of available time we are looking for. |
[in] | forward | The search direction |
[out] | actualduration | This variable is updated with the actual amount of available time found. |
Definition at line 174 of file operation.cpp.
DateRange frepple::Operation::calculateOperationTime | ( | Date | start, |
Date | end, | ||
TimePeriod * | actualduration = NULL |
||
) | const |
Calculates the effective, available time between two dates.
This calculation considers the availability calendars of:
[in] | start | The date from which to start searching. |
[in] | end | The date where to stop searching. |
[out] | actualduration | This variable is updated with the actual amount of available time found. |
Definition at line 328 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 |
This is the factory method which creates all operationplans of the operation.
Definition at line 163 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 480 of file operation.cpp.
|
virtual |
Reimplemented from frepple::Plannable.
Reimplemented in frepple::OperationAlternate, frepple::OperationRouting, frepple::OperationTimePer, and frepple::OperationFixedTime.
Definition at line 548 of file operation.cpp.
|
inlineprotectedvirtual |
Extra logic called when instantiating an operationplan.
When the function returns false the creation of the operationplan is denied and it is deleted.
Reimplemented in frepple::OperationAlternate, frepple::OperationRouting, and frepple::OperationFixedTime.
|
virtual |
Default getattro method.
Subclasses are expected to implement an override if the type supports gettattro.
Reimplemented from frepple::utils::PythonExtensionBase.
Reimplemented in frepple::OperationAlternate, frepple::OperationRouting, frepple::OperationTimePer, and frepple::OperationFixedTime.
Definition at line 1402 of file operation.cpp.
|
inline |
|
inline |
|
inline |
|
inline |
|
inlinevirtual |
Returns whether an entity is real or dummy.
Reimplemented from frepple::utils::Object.
|
inline |
|
inline |
|
inline |
Returns the delay after this operation.
|
inline |
Returns the delay before this operation. TODO CURRENTLY NOT USED!
|
inline |
|
inline |
|
inline |
|
inlinevirtual |
Returns a reference to the list of sub operations of this operation.
Reimplemented in frepple::OperationAlternate, and frepple::OperationRouting.
|
inline |
|
static |
Definition at line 38 of file operation.cpp.
|
protected |
Definition at line 457 of file operation.cpp.
|
inlinevirtual |
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::OperationAlternate, and frepple::OperationRouting.
|
inline |
|
virtual |
Default setattro method.
Subclasses are expected to implement an override if the type supports settattro.
Reimplemented from frepple::utils::PythonExtensionBase.
Reimplemented in frepple::OperationAlternate, frepple::OperationTimePer, and frepple::OperationFixedTime.
Definition at line 1444 of file operation.cpp.
|
inline |
|
inline |
|
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.
|
inline |
|
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:
The following priority rules apply upon conflicts.
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::OperationAlternate, frepple::OperationRouting, frepple::OperationTimePer, frepple::OperationSetup, and frepple::OperationFixedTime.
|
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.
|
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.
|
inline |
|
inline |
|
inline |
|
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::OperationAlternate, frepple::OperationRouting, frepple::OperationTimePer, frepple::OperationSetup, and frepple::OperationFixedTime.
|
virtual |
Called to update the list of problems. The function will only be called when:
Implements frepple::HasProblems.
Definition at line 27 of file problems_operationplan.cpp.
|
virtual |
Reimplemented from frepple::Plannable.
Reimplemented in frepple::OperationAlternate, frepple::OperationRouting, frepple::OperationTimePer, frepple::OperationSetup, and frepple::OperationFixedTime.
Definition at line 486 of file operation.cpp.
|
friend |
|
friend |
|
friend |
|
static |