This class represents a choice between multiple operations. The alternates are sorted in order of priority. More...
#include <model.h>
Public Types | |
typedef pair< int, DateRange > | alternateProperty |
![]() | |
typedef Association< Operation, Buffer, Flow >::ListA | flowlist |
typedef Association< Operation, Resource, Load >::ListA | loadlist |
typedef list< Operation * > | Operationlist |
Public Member Functions | |
void | addAlternate (Operation *, int=1, DateRange=DateRange()) |
void | beginElement (XMLInput &, const Attribute &) |
void | endElement (XMLInput &, const Attribute &, const DataElement &) |
virtual PyObject * | getattro (const Attribute &) |
const alternateProperty & | getProperties (Operation *o) const |
SearchMode | getSearch () const |
virtual size_t | getSize () const |
virtual const Operationlist & | getSubOperations () const |
virtual const MetaClass & | getType () const |
OperationAlternate (const string &c) | |
void | removeSubOperation (Operation *) |
virtual int | setattro (const Attribute &, const PythonObject &) |
void | setEffective (Operation *, DateRange) |
OperationPlanState | setOperationPlanParameters (OperationPlan *, double, Date, Date, bool=true, bool=true) const |
void | setPriority (Operation *, int) |
void | setSearch (const string a) |
virtual void | solve (Solver &s, void *v=NULL) const |
void | writeElement (XMLOutput *, const Keyword &, mode=DEFAULT) const |
~OperationAlternate () | |
![]() | |
void | addSuperOperation (Operation *o) |
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) |
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 | getSizeMaximum () const |
double | getSizeMinimum () const |
double | getSizeMultiple () const |
const Operationlist & | getSuperOperations () const |
void | removeSuperOperation (Operation *o) |
void | setCost (const double c) |
void | setFence (TimePeriod t) |
void | setHidden (bool b) |
void | setLocation (Location *l) |
void | setPostTime (TimePeriod t) |
void | setPreTime (TimePeriod t) |
void | setSizeMaximum (double f) |
void | setSizeMinimum (double f) |
void | setSizeMultiple (double f) |
virtual void | updateProblems () |
virtual | ~Operation () |
![]() | |
int | compare (const PyObject *other) const |
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 () |
![]() | |
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 () |
![]() | |
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 PyObject * | addAlternate (PyObject *, PyObject *, PyObject *) |
static int | initialize () |
Static Public Attributes | |
static const MetaClass * | 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 () |
This class represents a choice between multiple operations. The alternates are sorted in order of priority.
typedef pair<int,DateRange> frepple::OperationAlternate::alternateProperty |
|
inlineexplicit |
frepple::OperationAlternate::~OperationAlternate | ( | ) |
Destructor.
Definition at line 150 of file operation.cpp.
void frepple::OperationAlternate::addAlternate | ( | Operation * | o, |
int | prio = 1 , |
||
DateRange | eff = DateRange() |
||
) |
Add a new alternate operation.
The lower the priority value, the more important this alternate operation is.
Definition at line 1047 of file operation.cpp.
|
static |
Add an alternate to the operation.
The keyword arguments are "operation", "priority", "effective_start" and "effective_end"
Definition at line 1543 of file operation.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::Operation.
Definition at line 1161 of file operation.cpp.
|
virtual |
Reimplemented from frepple::Operation.
Definition at line 1170 of file operation.cpp.
|
protectedvirtual |
Extra logic to be used when instantiating an operationplan.
Reimplemented from frepple::Operation.
Definition at line 1243 of file operation.cpp.
|
virtual |
Default getattro method.
Subclasses are expected to implement an override if the type supports gettattro.
Reimplemented from frepple::Operation.
Definition at line 1513 of file operation.cpp.
const OperationAlternate::alternateProperty & frepple::OperationAlternate::getProperties | ( | Operation * | o | ) | const |
Returns the properties of a certain suboperation.
LogicException | Generated when the argument operation is null or when it is not a sub-operation of this alternate. |
Definition at line 1064 of file operation.cpp.
|
inline |
|
inlinevirtual |
Return the memory size of the object in bytes.
Implements frepple::utils::Object.
|
inlinevirtual |
Returns a reference to the list of sub operations of this operation.
Reimplemented from frepple::Operation.
|
inlinevirtual |
This returns the type information on the object, a bit similar to the standard type_info information.
Implements frepple::utils::Object.
|
static |
Reimplemented from frepple::Operation.
Definition at line 70 of file operation.cpp.
|
virtual |
Removes an alternate from the list.
Reimplemented from frepple::Operation.
Definition at line 1268 of file operation.cpp.
|
virtual |
Default setattro method.
Subclasses are expected to implement an override if the type supports settattro.
Reimplemented from frepple::Operation.
Definition at line 1533 of file operation.cpp.
Updates the effective daterange of a certain suboperation.
DataException | Generated when the argument operation is not null and not a sub-operation of this alternate. |
Definition at line 1100 of file operation.cpp.
|
virtual |
A operation of this type enforces the following rules on its operationplans:
Implements frepple::Operation.
Definition at line 1212 of file operation.cpp.
void frepple::OperationAlternate::setPriority | ( | Operation * | o, |
int | f | ||
) |
Updates the priority of a certain suboperation.
DataException | Generated when the argument operation is not null and not a sub-operation of this alternate. |
Definition at line 1082 of file operation.cpp.
|
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::Operation.
|
virtual |
Reimplemented from frepple::Operation.
Definition at line 1119 of file operation.cpp.
|
static |
Reimplemented from frepple::Operation.