This class represents a workcentre, a physical or logical representation of capacity. More...

#include <model.h>

Inheritance diagram for frepple::Resource:

List of all members.

Classes

class  PlanIterator
 This class provides an efficient way to iterate over the plan of a resource aggregated in time buckets. More...

Public Types

typedef Association< Operation,
Resource, Load >::ListB 
loadlist
typedef TimeLine< LoadPlanloadplanlist
typedef Association< Resource,
Skill, ResourceSkill >::ListA 
skilllist

Public Member Functions

void beginElement (XMLInput &, const Attribute &)
void deleteOperationPlans (bool=false)
void endElement (XMLInput &, const Attribute &, const DataElement &)
size_t extrasize () const
LoadfindLoad (const Operation *o, Date d) const
virtual PyObject * getattro (const Attribute &)
double getCost () const
bool getHidden () const
const loadplanlistgetLoadPlans () const
loadplanlistgetLoadPlans ()
const loadlistgetLoads () const
LocationgetLocation () const
TimePeriod getMaxEarly () const
double getMaximum () const
CalendarDoublegetMaximumCalendar () const
const string & getSetup () const
SetupMatrixgetSetupMatrix () const
const skilllistgetSkills () const
virtual const MetaClassgetType () const
 Resource (const string &str)
virtual int setattro (const Attribute &, const PythonObject &)
void setCost (const double c)
void setHidden (bool b)
void setLocation (Location *i)
void setMaxEarly (TimePeriod c)
void setMaximum (double)
void setMaximumCalendar (CalendarDouble *)
void setSetup (const string s)
void setSetupMatrix (SetupMatrix *s)
virtual void solve (Solver &s, void *v=NULL) const
virtual void updateProblems ()
virtual void updateSetups (const LoadPlan *=NULL)
virtual void writeElement (XMLOutput *, const Keyword &, mode=DEFAULT) const
virtual ~Resource ()
- Public Member Functions inherited from frepple::utils::HasHierarchy< Resource >
memberIterator beginMember () const
unsigned short getHierarchyLevel () const
ResourcegetOwner () const
 HasHierarchy (const string &n)
bool hasOwner () const
bool isGroup () const
void setOwner (Resource *f)
 ~HasHierarchy ()
- Public Member Functions inherited from frepple::utils::HasName< Resource >
int compare (const PyObject *other) const
 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
virtual size_t getSize () const =0
 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
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 int initialize ()
- 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 long defaultMaxEarly = 100*86400L
static const MetaCategorymetadata

Friends

class Load
class LoadPlan
class ResourceSkill

Additional Inherited Members

- Protected Member Functions inherited from frepple::HasLevel
 HasLevel ()
 HasLevel (const HasLevel &o)
 ~HasLevel ()
- Static Protected Member Functions inherited from frepple::HasLevel
static void computeLevels ()

Detailed Description

This class represents a workcentre, a physical or logical representation of capacity.

Definition at line 3768 of file model.h.


Member Typedef Documentation

Definition at line 3814 of file model.h.

Definition at line 3816 of file model.h.

Definition at line 3815 of file model.h.


Constructor & Destructor Documentation

frepple::Resource::Resource ( const string &  str)
inlineexplicit

Constructor.

Definition at line 3783 of file model.h.

frepple::Resource::~Resource ( )
virtual

Destructor.

Definition at line 289 of file resource.cpp.


Member Function Documentation

void frepple::Resource::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::HasHierarchy< Resource >.

Definition at line 197 of file resource.cpp.

void frepple::Resource::deleteOperationPlans ( bool  deleteLocked = false)

Deletes all operationplans loading this resource. The boolean parameter controls whether we delete also locked operationplans or not.

Definition at line 278 of file resource.cpp.

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

Reimplemented from frepple::Plannable.

Definition at line 230 of file resource.cpp.

size_t frepple::Resource::extrasize ( ) const
inline

Returns the memory size in bytes.

Reimplemented from frepple::utils::HasDescription.

Definition at line 3846 of file model.h.

Load* frepple::Resource::findLoad ( const Operation o,
Date  d 
) const
inline

Return the load that is associates a given operation with this resource. Returns NULL is no such load exists.

Definition at line 3834 of file model.h.

PyObject * frepple::Resource::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 363 of file resource.cpp.

double frepple::Resource::getCost ( ) const
inline

Returns the cost of using 1 unit of this resource for 1 hour.
The default value is 0.0.

Definition at line 3805 of file model.h.

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

Returns whether an entity is real or dummy.

Reimplemented from frepple::utils::Object.

Definition at line 3872 of file model.h.

const loadplanlist& frepple::Resource::getLoadPlans ( ) const
inline

Returns a reference to the list of loadplans.

Definition at line 3819 of file model.h.

loadplanlist& frepple::Resource::getLoadPlans ( )
inline

Returns a reference to the list of loadplans.

Definition at line 3822 of file model.h.

const loadlist& frepple::Resource::getLoads ( ) const
inline

Returns a constant reference to the list of loads. It defines which operations are using the resource.

Definition at line 3827 of file model.h.

Location* frepple::Resource::getLocation ( ) const
inline

Returns the location of this resource.

Definition at line 3853 of file model.h.

TimePeriod frepple::Resource::getMaxEarly ( ) const
inline

Returns the maximum inventory buildup allowed in case of capacity shortages.

Definition at line 3879 of file model.h.

double frepple::Resource::getMaximum ( ) const
inline

Return a pointer to the maximum capacity.

Definition at line 3800 of file model.h.

CalendarDouble* frepple::Resource::getMaximumCalendar ( ) const
inline

Return a pointer to the maximum capacity profile.

Definition at line 3797 of file model.h.

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

Return the current setup.

Definition at line 3896 of file model.h.

SetupMatrix* frepple::Resource::getSetupMatrix ( ) const
inline

Return a pointer to the setup matrix.

Definition at line 3890 of file model.h.

const skilllist& frepple::Resource::getSkills ( ) const
inline

Returns a constant reference to the list of skills.

Definition at line 3830 of file model.h.

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

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

Implements frepple::utils::Object.

Reimplemented in frepple::ResourceInfinite, and frepple::ResourceDefault.

Definition at line 3874 of file model.h.

int frepple::Resource::initialize ( )
static

Initialize the class.

Reimplemented in frepple::ResourceInfinite, and frepple::ResourceDefault.

Definition at line 33 of file resource.cpp.

int frepple::Resource::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 407 of file resource.cpp.

void frepple::Resource::setCost ( const double  c)
inline

Update the cost of using 1 unit of this resource for 1 hour.

Definition at line 3808 of file model.h.

void frepple::Resource::setHidden ( bool  b)
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.

Definition at line 3871 of file model.h.

void frepple::Resource::setLocation ( Location i)
inline

Updates the location of this resource.

Definition at line 3856 of file model.h.

void frepple::Resource::setMaxEarly ( TimePeriod  c)
inline

Updates the maximum inventory buildup allowed in case of capacity shortages.

Definition at line 3883 of file model.h.

void frepple::Resource::setMaximum ( double  m)

Updates the size of a resource.

Definition at line 72 of file resource.cpp.

void frepple::Resource::setMaximumCalendar ( CalendarDouble c)

Updates the size of a resource, when it is time-dependent.

Definition at line 106 of file resource.cpp.

void frepple::Resource::setSetup ( const string  s)
inline

Update the current setup.

Definition at line 3899 of file model.h.

void frepple::Resource::setSetupMatrix ( SetupMatrix s)
inline

Update the reference to the setup matrix.

Definition at line 3893 of file model.h.

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

Reimplemented in frepple::ResourceInfinite.

Definition at line 3858 of file model.h.

void frepple::Resource::updateProblems ( )
virtual

Recompute the problems of this resource.

Implements frepple::HasProblems.

Definition at line 28 of file problems_resource.cpp.

void frepple::Resource::updateSetups ( const LoadPlan ldplan = NULL)
virtual

Scan the setups of this resource.

Definition at line 302 of file resource.cpp.

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

Reimplemented from frepple::Plannable.

Reimplemented in frepple::ResourceInfinite.

Definition at line 144 of file resource.cpp.


Friends And Related Function Documentation

friend class Load
friend

Definition at line 3771 of file model.h.

friend class LoadPlan
friend

Definition at line 3772 of file model.h.

friend class ResourceSkill
friend

Definition at line 3773 of file model.h.


Member Data Documentation

const long frepple::Resource::defaultMaxEarly = 100*86400L
static

The default time window before the ask date where we look for available capacity.

Definition at line 3780 of file model.h.

const MetaCategory * frepple::Resource::metadata
static

Reimplemented in frepple::ResourceInfinite, and frepple::ResourceDefault.

Definition at line 3875 of file model.h.


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