This class links a resource to a certain operation. More...

#include <model.h>

Inheritance diagram for frepple::Load:

Public Member Functions

void beginElement (XMLInput &, const Attribute &)
 
void endElement (XMLInput &, const Attribute &, const DataElement &)
 
LoadgetAlternate () const
 
PyObject * getattro (const Attribute &)
 
bool getHidden () const
 
virtual Date getLoadplanDate (const LoadPlan *) const
 
virtual double getLoadplanQuantity (const LoadPlan *) const
 
OperationgetOperation () const
 
double getQuantity () const
 
ResourcegetResource () const
 
SearchMode getSearch () const
 
const string & getSetup () const
 
virtual size_t getSize () const
 
SkillgetSkill () const
 
virtual const MetaClassgetType () const
 
bool hasAlternates () const
 
 Load (Operation *o, Resource *r, double u)
 
 Load (Operation *o, Resource *r, double u, DateRange e)
 
 Load ()
 
void setAlternate (Load *)
 
void setAlternate (const string &n)
 
int setattro (const Attribute &, const PythonObject &)
 
void setOperation (Operation *o)
 
void setQuantity (double f)
 
void setResource (Resource *r)
 
void setSearch (const string a)
 
void setSetup (const string)
 
void setSkill (Skill *s)
 
virtual void solve (Solver &s, void *v=NULL) const
 
virtual void writeElement (XMLOutput *, const Keyword &, mode=DEFAULT) const
 
 ~Load ()
 
- Public Member Functions inherited from frepple::utils::Object
 Object ()
 
virtual void setHidden (bool b)
 
virtual ~Object ()
 
- Public Member Functions inherited from frepple::utils::PythonExtensionBase
virtual PyObject * call (const PythonObject &args, const PythonObject &kwds)
 
virtual int compare (const PyObject *other) const
 
Py_ssize_t getReferenceCount () const
 
void initType (const MetaClass *t)
 
void initType (PyTypeObject *t)
 
virtual PyObject * iternext ()
 
 PythonExtensionBase ()
 
void resetReferenceCount ()
 
virtual PyObject * str () const
 
virtual ~PythonExtensionBase ()
 
- Public Member Functions inherited from frepple::utils::Association< A, B, C >::Node
DateRange getEffective () const
 
const string & getName () const
 
int getPriority () const
 
A * getPtrA () const
 
B * getPtrB () const
 
 Node ()
 
 Node (A *a, B *b, const ListA &al, const ListB &bl)
 
void setEffective (DateRange dr)
 
void setEffectiveEnd (Date d)
 
void setEffectiveStart (Date d)
 
void setName (const string x)
 
void setPriority (int i)
 
void setPtrA (A *a, const ListA &al)
 
void setPtrAB (A *a, B *b, const ListA &al, const ListB &bl)
 
void setPtrB (B *b, const ListB &bl)
 
- Public Member Functions inherited from frepple::Solvable
virtual ~Solvable ()
 

Static Public Member Functions

static int initialize ()
 
static void writer (const MetaCategory *, XMLOutput *)
 
- 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 Attributes

static const MetaCategorymetadata
 

Friends

class Operation
 
class Resource
 

Additional Inherited Members

- Public Attributes inherited from frepple::utils::Association< A, B, C >::Node
DateRange effectivity
 
string name
 
C * nextA
 
C * nextB
 
int priority
 
A * ptrA
 
B * ptrB
 
- Static Protected Member Functions inherited from frepple::utils::PythonExtensionBase
static PythonTyperegisterPythonType (int, const type_info *)
 
- Static Protected Attributes inherited from frepple::utils::PythonExtensionBase
static vector< PythonType * > table
 

Detailed Description

This class links a resource to a certain operation.

Definition at line 4164 of file model.h.

Constructor & Destructor Documentation

frepple::Load::Load ( Operation o,
Resource r,
double  u 
)
inlineexplicit

Constructor.

Definition at line 4173 of file model.h.

frepple::Load::Load ( Operation o,
Resource r,
double  u,
DateRange  e 
)
inlineexplicit

Constructor.

Definition at line 4191 of file model.h.

frepple::Load::~Load ( )

Destructor.

Definition at line 133 of file load.cpp.

frepple::Load::Load ( )
inline

Default constructor.

Definition at line 4292 of file model.h.

Member Function Documentation

void frepple::Load::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::utils::Object.

Definition at line 297 of file load.cpp.

void frepple::Load::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 valid.

Implements frepple::utils::Object.

Definition at line 308 of file load.cpp.

Load* frepple::Load::getAlternate ( ) const
inline

Returns the load of which this one is an alternate.
NULL is return where there is none.

Definition at line 4245 of file model.h.

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

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

Reimplemented from frepple::utils::PythonExtensionBase.

Definition at line 368 of file load.cpp.

bool frepple::Load::getHidden ( ) const
inlinevirtual

Returns whether an entity is real or dummy.

Reimplemented from frepple::utils::Object.

Definition at line 4279 of file model.h.

Date frepple::Load::getLoadplanDate ( const LoadPlan lp) const
inlinevirtual

This method holds the logic the compute the date of a loadplan.

Definition at line 4763 of file model.h.

double frepple::Load::getLoadplanQuantity ( const LoadPlan lp) const
inlinevirtual

This method holds the logic the compute the quantity of a loadplan.

Definition at line 4777 of file model.h.

Operation* frepple::Load::getOperation ( ) const
inline

Returns the operation consuming the resource capacity.

Definition at line 4213 of file model.h.

double frepple::Load::getQuantity ( ) const
inline

Returns how much capacity is consumed during the duration of the operationplan.

Definition at line 4228 of file model.h.

Resource* frepple::Load::getResource ( ) const
inline

Returns the capacity resource being consumed.

Definition at line 4220 of file model.h.

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

Return the search mode.

Definition at line 4296 of file model.h.

const string& frepple::Load::getSetup ( ) const
inline

Return the required resource setup.

Definition at line 4257 of file model.h.

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

Return the memory size of the object in bytes.

Implements frepple::utils::Object.

Definition at line 4288 of file model.h.

Skill* frepple::Load::getSkill ( ) const
inline

Return the required skill.

Definition at line 4263 of file model.h.

virtual const MetaClass& frepple::Load::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 4286 of file model.h.

bool frepple::Load::hasAlternates ( ) const
inline

Returns true if there are alternates for this load.

Definition at line 4240 of file model.h.

int frepple::Load::initialize ( )
static

Definition at line 29 of file load.cpp.

void frepple::Load::setAlternate ( Load f)

Define the load of which this one is an alternate.

Definition at line 206 of file load.cpp.

void frepple::Load::setAlternate ( const string &  n)

Define the load of which this one is an alternate.

Definition at line 220 of file load.cpp.

int frepple::Load::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::utils::PythonExtensionBase.

Definition at line 402 of file load.cpp.

void frepple::Load::setOperation ( Operation o)
inline

Updates the operation being loaded. This method can only be called once for a load.

Definition at line 4217 of file model.h.

void frepple::Load::setQuantity ( double  f)
inline

Updates the quantity of the load.

Exceptions
DataExceptionWhen a negative number is passed.

Definition at line 4233 of file model.h.

void frepple::Load::setResource ( Resource r)
inline

Updates the capacity being consumed. This method can only be called once on a resource.

Definition at line 4224 of file model.h.

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

Update the search mode.

Definition at line 4299 of file model.h.

void frepple::Load::setSetup ( const string  n)

Update the required resource setup.

Definition at line 230 of file load.cpp.

void frepple::Load::setSkill ( Skill s)
inline

Update the required skill.

Definition at line 4260 of file model.h.

virtual void frepple::Load::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::Solvable.

Definition at line 4284 of file model.h.

void frepple::Load::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::utils::Object.

Definition at line 248 of file load.cpp.

void frepple::Load::writer ( const MetaCategory c,
XMLOutput o 
)
static

Definition at line 51 of file load.cpp.

Friends And Related Function Documentation

friend class Operation
friend

Definition at line 4169 of file model.h.

friend class Resource
friend

Definition at line 4168 of file model.h.

Member Data Documentation

const MetaCategory * frepple::Load::metadata
static

Definition at line 4287 of file model.h.


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