frepple::OperationAlternate Class Reference

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:
frepple::Operation frepple::utils::HasName< Operation > frepple::HasLevel frepple::Plannable frepple::utils::HasDescription frepple::utils::NonCopyable frepple::utils::Tree::TreeNode frepple::utils::Object frepple::HasProblems frepple::Solvable frepple::utils::PythonExtensionBase

List of all members.

Public Types

typedef pair< int, DateRangealternateProperty

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 ()

Static Public Member Functions

static PyObject * addAlternate (PyObject *, PyObject *, PyObject *)
static int initialize ()

Static Public Attributes

static const MetaClassmetadata

Protected Member Functions

virtual bool extraInstantiate (OperationPlan *o)

Detailed Description

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

Definition at line 2659 of file model.h.


Member Typedef Documentation

Definition at line 2662 of file model.h.


Constructor & Destructor Documentation

frepple::OperationAlternate::OperationAlternate ( const string &  c  )  [inline, explicit]

Constructor.

Definition at line 2665 of file model.h.

frepple::OperationAlternate::~OperationAlternate (  ) 

Destructor.

Definition at line 157 of file operation.cpp.


Member Function Documentation

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 1547 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 1051 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 1165 of file operation.cpp.

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

Reimplemented from frepple::Operation.

Definition at line 1174 of file operation.cpp.

bool frepple::OperationAlternate::extraInstantiate ( OperationPlan o  )  [protected, virtual]

Extra logic to be used when instantiating an operationplan.

Reimplemented from frepple::Operation.

Definition at line 1247 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 1517 of file operation.cpp.

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

Returns the properties of a certain suboperation.

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

Definition at line 1068 of file operation.cpp.

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

Return the search mode.

Definition at line 2699 of file model.h.

virtual size_t frepple::OperationAlternate::getSize (  )  const [inline, virtual]

Return the memory size of the object in bytes.

Implements frepple::utils::Object.

Definition at line 2730 of file model.h.

virtual const Operationlist& frepple::OperationAlternate::getSubOperations (  )  const [inline, virtual]

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

Reimplemented from frepple::Operation.

Definition at line 2719 of file model.h.

virtual const MetaClass& frepple::OperationAlternate::getType (  )  const [inline, virtual]

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

Implements frepple::utils::Object.

Definition at line 2728 of file model.h.

int frepple::OperationAlternate::initialize (  )  [static]

Reimplemented from frepple::Operation.

Definition at line 77 of file operation.cpp.

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

Removes an alternate from the list.

Definition at line 1272 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 1537 of file operation.cpp.

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

Updates the effective daterange of a certain suboperation.

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

Definition at line 1104 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 1216 of file operation.cpp.

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

Updates the priority of a certain suboperation.

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

Definition at line 1086 of file operation.cpp.

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

Update the search mode.

Definition at line 2702 of file model.h.

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

Definition at line 2718 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 1123 of file operation.cpp.


Member Data Documentation

Reimplemented from frepple::Operation.

Definition at line 2729 of file model.h.


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

Generated on 16 Apr 2010 for frePPLe by  doxygen 1.6.1