This class represents a choice between multiple operations. The alternates are sorted in order of priority. More...

#include <model.h>

Inheritance diagram for frepple::OperationAlternate:

Public Types

typedef pair< int, DateRangealternateProperty
 
- Public Types inherited from frepple::Operation
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 alternatePropertygetProperties (Operation *o) const
 
SearchMode getSearch () const
 
virtual size_t getSize () const
 
virtual const OperationlistgetSubOperations () const
 
virtual const MetaClassgetType () 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 ()
 
- Public Member Functions inherited from frepple::Operation
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
 
OperationPlancreateOperationPlan (double, Date, Date, Demand *=NULL, OperationPlan *=NULL, unsigned long=0, bool makeflowsloads=true) const
 
void deleteOperationPlans (bool deleteLockedOpplans=false)
 
size_t extrasize () const
 
FlowfindFlow (const Buffer *b, Date d) const
 
LoadfindLoad (const Resource *r, Date d) const
 
double getCost () const
 
TimePeriod getFence () const
 
OperationPlangetFirstOpPlan () const
 
const flowlistgetFlows () const
 
bool getHidden () const
 
const loadlistgetLoads () const
 
LocationgetLocation () const
 
TimePeriod getPostTime () const
 
TimePeriod getPreTime () const
 
double getSizeMaximum () const
 
double getSizeMinimum () const
 
double getSizeMultiple () const
 
const OperationlistgetSuperOperations () 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 ()
 
- Public Member Functions inherited from frepple::utils::HasName< 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 ()
 
- Public Member Functions inherited from frepple::utils::Tree::TreeNode
TreeNodedecrement () const
 
const string & getName () const
 
TreeNodeincrement () const
 
bool operator< (const TreeNode &o)
 
 TreeNode (const string &n)
 
virtual ~TreeNode ()
 
- Public Member Functions inherited from frepple::utils::Object
 Object ()
 
virtual ~Object ()
 
- Public Member Functions inherited from frepple::utils::PythonExtensionBase
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 ()
 
- Public Member Functions inherited from frepple::HasLevel
unsigned short getCluster () const
 
short getLevel () const
 
- Public Member Functions inherited from frepple::Plannable
bool getChanged () const
 
bool getDetectProblems () const
 
PlannablegetEntity () const
 
 Plannable ()
 
void setChanged (bool b=true)
 
void setDetectProblems (bool b)
 
- Public Member Functions inherited from frepple::HasProblems
 HasProblems ()
 
virtual ~HasProblems ()
 
- Public Member Functions inherited from frepple::Solvable
virtual ~Solvable ()
 
- Public Member Functions inherited from frepple::utils::HasDescription
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 PyObject * addAlternate (PyObject *, PyObject *, PyObject *)
 
static int initialize ()
 
- Static Public Member Functions inherited from frepple::Operation
static int initialize ()
 
- Static Public Member Functions inherited from frepple::utils::HasName< Operation >
static Operationadd (const string &k, const MetaClass &cls)
 
static Operationadd (Operation *t)
 
static Operationadd (Operation *t, Operation *hint)
 
static iterator begin ()
 
static void clear ()
 
static bool empty ()
 
static iterator end ()
 
static Operationfind (const string &k)
 
static OperationfindLowerBound (const string &k, bool *f=NULL)
 
static Objectreader (const MetaClass *cat, const AttributeList &in)
 
static size_t size ()
 
static void verify ()
 
static void writer (const MetaCategory *c, XMLOutput *o)
 
- Static Public Member Functions inherited from frepple::utils::Object
template<class T >
static PyObject * create (PyTypeObject *pytype, PyObject *args, PyObject *kwds)
 
template<class T >
static ObjectcreateDefault ()
 
template<class T >
static ObjectcreateString (const string &n)
 
static PyObject * toXML (PyObject *, PyObject *)
 
- Static Public Member Functions inherited from frepple::HasLevel
static unsigned short getNumberOfClusters ()
 
static unsigned short getNumberOfHangingClusters ()
 
static void triggerLazyRecomputation ()
 
- Static Public Member Functions inherited from frepple::Plannable
static void computeProblems ()
 
- Static Public Member Functions inherited from frepple::HasProblems
static EntityIterator beginEntity ()
 
static EntityIterator endEntity ()
 

Static Public Attributes

static const MetaClassmetadata
 
- Static Public Attributes inherited from frepple::Operation
static const MetaCategorymetadata
 

Protected Member Functions

virtual bool extraInstantiate (OperationPlan *o)
 
- Protected Member Functions inherited from frepple::Operation
void initOperationPlan (OperationPlan *, double, const Date &, const Date &, Demand *, OperationPlan *, unsigned long, bool=true) const
 
 Operation (const string &str)
 
- Protected Member Functions inherited from frepple::HasLevel
 HasLevel ()
 
 HasLevel (const HasLevel &o)
 
 ~HasLevel ()
 
- Protected Member Functions inherited from frepple::utils::HasDescription
size_t extrasize () const
 

Additional Inherited Members

- Static Protected Member Functions inherited from frepple::utils::PythonExtensionBase
static PythonTyperegisterPythonType (int, const type_info *)
 
- Static Protected Member Functions inherited from frepple::HasLevel
static void computeLevels ()
 
- Static Protected Attributes inherited from frepple::utils::PythonExtensionBase
static vector< PythonType * > table
 

Detailed Description

This class represents a choice between multiple operations. The alternates are sorted in order of priority.

Definition at line 2485 of file model.h.

Member Typedef Documentation

Definition at line 2488 of file model.h.

Constructor & Destructor Documentation

frepple::OperationAlternate::OperationAlternate ( const string &  c)
inlineexplicit

Constructor.

Definition at line 2491 of file model.h.

frepple::OperationAlternate::~OperationAlternate ( )

Destructor.

Definition at line 153 of file operation.cpp.

Member Function Documentation

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 1060 of file operation.cpp.

PyObject * frepple::OperationAlternate::addAlternate ( PyObject *  self,
PyObject *  args,
PyObject *  kwdict 
)
static

Add an alternate to the operation.
The keyword arguments are "operation", "priority", "effective_start" and "effective_end"

Definition at line 1556 of file operation.cpp.

void frepple::OperationAlternate::beginElement ( XMLInput ,
const Attribute  
)
virtual

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 1174 of file operation.cpp.

void frepple::OperationAlternate::endElement ( XMLInput pIn,
const Attribute pAttr,
const DataElement pElement 
)
virtual

Reimplemented from frepple::Operation.

Definition at line 1183 of file operation.cpp.

bool frepple::OperationAlternate::extraInstantiate ( OperationPlan o)
protectedvirtual

Extra logic to be used when instantiating an operationplan.

Reimplemented from frepple::Operation.

Definition at line 1256 of file operation.cpp.

PyObject * frepple::OperationAlternate::getattro ( const Attribute attr)
virtual

Default getattro method.
Subclasses are expected to implement an override if the type supports gettattro.

Reimplemented from frepple::Operation.

Definition at line 1526 of file operation.cpp.

const OperationAlternate::alternateProperty & frepple::OperationAlternate::getProperties ( Operation o) const

Returns the properties of a certain suboperation.

Exceptions
LogicExceptionGenerated when the argument operation is null or when it is not a sub-operation of this alternate.

Definition at line 1077 of file operation.cpp.

SearchMode frepple::OperationAlternate::getSearch ( ) const
inline

Return the search mode.

Definition at line 2525 of file model.h.

virtual size_t frepple::OperationAlternate::getSize ( ) const
inlinevirtual

Return the memory size of the object in bytes.

Implements frepple::utils::Object.

Definition at line 2556 of file model.h.

virtual const Operationlist& frepple::OperationAlternate::getSubOperations ( ) const
inlinevirtual

Returns a reference to the list of sub operations of this operation.

Reimplemented from frepple::Operation.

Definition at line 2545 of file model.h.

virtual const MetaClass& frepple::OperationAlternate::getType ( ) const
inlinevirtual

This returns the type information on the object, a bit similar to the standard type_info information.

Implements frepple::utils::Object.

Definition at line 2554 of file model.h.

int frepple::OperationAlternate::initialize ( )
static

Definition at line 70 of file operation.cpp.

void frepple::OperationAlternate::removeSubOperation ( Operation o)
virtual

Removes an alternate from the list.

Reimplemented from frepple::Operation.

Definition at line 1281 of file operation.cpp.

int frepple::OperationAlternate::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::Operation.

Definition at line 1546 of file operation.cpp.

void frepple::OperationAlternate::setEffective ( Operation o,
DateRange  dr 
)

Updates the effective daterange of a certain suboperation.

Exceptions
DataExceptionGenerated when the argument operation is not null and not a sub-operation of this alternate.

Definition at line 1113 of file operation.cpp.

OperationPlanState frepple::OperationAlternate::setOperationPlanParameters ( OperationPlan opplan,
double  q,
Date  s,
Date  e,
bool  preferEnd = true,
bool  execute = true 
) const
virtual

A operation of this type enforces the following rules on its operationplans:

Implements frepple::Operation.

Definition at line 1225 of file operation.cpp.

void frepple::OperationAlternate::setPriority ( Operation o,
int  f 
)

Updates the priority of a certain suboperation.

Exceptions
DataExceptionGenerated when the argument operation is not null and not a sub-operation of this alternate.

Definition at line 1095 of file operation.cpp.

void frepple::OperationAlternate::setSearch ( const string  a)
inline

Update the search mode.

Definition at line 2528 of file model.h.

virtual void frepple::OperationAlternate::solve ( Solver s,
void *  v = NULL 
) const
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.

Definition at line 2544 of file model.h.

void frepple::OperationAlternate::writeElement ( XMLOutput o,
const Keyword tag,
mode  m = DEFAULT 
) const
virtual

Reimplemented from frepple::Operation.

Definition at line 1132 of file operation.cpp.

Member Data Documentation

const MetaClass * frepple::OperationAlternate::metadata
static

Definition at line 2555 of file model.h.


The documentation for this class was generated from the following files: