This class is used to represent a matrix defining the changeover times between setups. More...

#include <model.h>

Inheritance diagram for frepple::SetupMatrix:

Classes

class  Rule
 An specific changeover rule in a setup matrix. More...
 
class  RuleIterator
 An iterator class to go through all rules of a setup matrix. More...
 

Public Member Functions

void beginElement (XMLInput &, const Attribute &)
 
RuleIterator beginRules () const
 
RulecalculateSetup (const string, const string) const
 
RulecreateRule (const AttributeList &)
 
void endElement (XMLInput &, const Attribute &, const DataElement &)
 
RuleIterator endRules () const
 
size_t extrasize () const
 
virtual PyObject * getattro (const Attribute &)
 
virtual size_t getSize () const
 
virtual const MetaClassgetType () const
 
virtual int setattro (const Attribute &, const PythonObject &)
 
 SetupMatrix (const string &n)
 
virtual void writeElement (XMLOutput *, const Keyword &, mode=DEFAULT) const
 
 ~SetupMatrix ()
 
- Public Member Functions inherited from frepple::utils::HasName< SetupMatrix >
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
virtual bool getHidden () const
 
 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)
 
Py_ssize_t getReferenceCount () const
 
void initType (const MetaClass *t)
 
void initType (PyTypeObject *t)
 
virtual PyObject * iternext ()
 
 PythonExtensionBase ()
 
void resetReferenceCount ()
 
virtual ~PythonExtensionBase ()
 

Static Public Member Functions

static PyObject * addPythonRule (PyObject *, PyObject *, PyObject *)
 
static int initialize ()
 
- Static Public Member Functions inherited from frepple::utils::HasName< SetupMatrix >
static SetupMatrixadd (const string &k, const MetaClass &cls)
 
static SetupMatrixadd (SetupMatrix *t)
 
static SetupMatrixadd (SetupMatrix *t, SetupMatrix *hint)
 
static iterator begin ()
 
static void clear ()
 
static bool empty ()
 
static iterator end ()
 
static SetupMatrixfind (const string &k)
 
static SetupMatrixfindLowerBound (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 Attributes

static const MetaCategorymetadata
 

Additional Inherited Members

- Protected Member Functions inherited from frepple::utils::NonCopyable
 NonCopyable ()
 
 ~NonCopyable ()
 
- 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 is used to represent a matrix defining the changeover times between setups.

Definition at line 3583 of file model.h.

Constructor & Destructor Documentation

frepple::SetupMatrix::SetupMatrix ( const string &  n)
inline

Default constructor.

Definition at line 3702 of file model.h.

frepple::SetupMatrix::~SetupMatrix ( )

Destructor.

Definition at line 76 of file setupmatrix.cpp.

Member Function Documentation

PyObject * frepple::SetupMatrix::addPythonRule ( PyObject *  self,
PyObject *  args,
PyObject *  kwdict 
)
static

Python interface to add a new rule.

Definition at line 212 of file setupmatrix.cpp.

void frepple::SetupMatrix::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 115 of file setupmatrix.cpp.

RuleIterator frepple::SetupMatrix::beginRules ( ) const
inline

Returns an iterator to go through the list of rules.

Definition at line 3740 of file model.h.

SetupMatrix::Rule * frepple::SetupMatrix::calculateSetup ( const string  oldsetup,
const string  newsetup 
) const

Computes the changeover time and cost between 2 setup values.

To compute the time of a changeover the algorithm will evaluate all rules in sequence (in order of priority).
For a rule to match the changeover between the original setup X to a new setup Y, two conditions need to be fulfilled:

  • The original setup X must match with the fromsetup of the rule.
    If the fromsetup field is empty, it is considered a match.
  • The new setup Y must match with the tosetup of the rule.
    If the tosetup field is empty, it is considered a match. The wildcard characters * and ? can be used in the fromsetup and tosetup fields.
    As soon as a matching rule is found, it is applied and subsequent rules are not evaluated.
    If no matching rule is found, the changeover is not allowed: a NULL pointer is returned.

Definition at line 416 of file setupmatrix.cpp.

SetupMatrix::Rule * frepple::SetupMatrix::createRule ( const AttributeList atts)

This is a factory method that creates a new rule
This method is intended to be used to create objects when reading XML input data.

Definition at line 124 of file setupmatrix.cpp.

void frepple::SetupMatrix::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 186 of file setupmatrix.cpp.

RuleIterator frepple::SetupMatrix::endRules ( ) const
inline

Returns an iterator to go through the list of rules.

Definition at line 3743 of file model.h.

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

Definition at line 3731 of file model.h.

PyObject * frepple::SetupMatrix::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 192 of file setupmatrix.cpp.

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

Return the memory size of the object in bytes.

Implements frepple::utils::Object.

Reimplemented in frepple::SetupMatrixDefault.

Definition at line 3723 of file model.h.

virtual const MetaClass& frepple::SetupMatrix::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::SetupMatrixDefault.

Definition at line 3720 of file model.h.

int frepple::SetupMatrix::initialize ( )
static

Definition at line 33 of file setupmatrix.cpp.

int frepple::SetupMatrix::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 202 of file setupmatrix.cpp.

void frepple::SetupMatrix::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 88 of file setupmatrix.cpp.

Member Data Documentation

const MetaCategory * frepple::SetupMatrix::metadata
static

Definition at line 3721 of file model.h.


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