frepple::HasLevel Class Reference

The purpose of this class is to compute the levels of all buffers, operations and resources in the model, and to categorize them in clusters. More...

#include <model.h>

Inheritance diagram for frepple::HasLevel:
frepple::Buffer frepple::Operation frepple::Resource frepple::BufferDefault frepple::BufferInfinite frepple::BufferProcure frepple::OperationAlternate frepple::OperationFixedTime frepple::OperationRouting frepple::OperationSetup frepple::OperationTimePer frepple::ResourceDefault frepple::ResourceInfinite

List of all members.

Public Member Functions

unsigned short getCluster () const
short getLevel () const

Static Public Member Functions

static unsigned short getNumberOfClusters ()
static unsigned short getNumberOfHangingClusters ()
static void triggerLazyRecomputation ()

Protected Member Functions

 HasLevel (const HasLevel &o)
 HasLevel ()
 ~HasLevel ()

Static Protected Member Functions

static void computeLevels ()

Detailed Description

The purpose of this class is to compute the levels of all buffers, operations and resources in the model, and to categorize them in clusters.

Resources and buffers linked to the delivery operations of the demand are assigned level 1. buffers one level upstream have level 2, and so on...

A cluster is group of planning entities (buffers, resources and operations) that are linked together using loads and/or flows. Each cluster can be seen as a completely independent part of the model and the planning problem. There is no interaction possible between clusters. Clusters are helpful is multi-threading the planning problem, partial replanning of the model, etc...

Definition at line 1230 of file model.h.


Constructor & Destructor Documentation

frepple::HasLevel::HasLevel (  )  [inline, protected]

Default constructor. The initial level is -1 and basically indicates that this HasHierarchy (either Operation, Buffer or Resource) is not being used at all...

Definition at line 1272 of file model.h.

frepple::HasLevel::HasLevel ( const HasLevel o  )  [inline, protected]

Copy constructor. Since the characterictics of the new object are the same as the original, the level and cluster are also the same. No recomputation is required.

Definition at line 1278 of file model.h.

frepple::HasLevel::~HasLevel (  )  [inline, protected]

Destructor. Deleting a HasLevel object triggers recomputation of the level and cluster computation, since the network now has changed.

Definition at line 1283 of file model.h.


Member Function Documentation

void frepple::HasLevel::computeLevels (  )  [static, protected]

This function recomputes all levels in the model. It is called automatically when the getLevel or getCluster() function on a Buffer, Resource or Operation are called while the "recomputeLevels" flag is set. Right, this is an example of a 'lazy' algorithm: only compute the information when it is required. Note however that the computation is triggered over the complete model, not a subset... The runtime of the algorithm is pretty much linear with the total number of operations in the model. The cluster size also has some (limited) impact on the performance: a network with larger cluster size will take longer to analyze.

Exceptions:
LogicException Generated when there are too many clusters in your model. The maximum limit is USHRT_MAX, i.e. the greatest number that can be stored in a variable of type "unsigned short". The limit is platform dependent. On 32-bit platforms it will typically be 65535.

Definition at line 48 of file leveled.cpp.

unsigned short frepple::HasLevel::getCluster (  )  const [inline]

Return the cluster number (and recompute first if required).

Definition at line 1333 of file model.h.

short frepple::HasLevel::getLevel (  )  const [inline]

Return the level (and recompute first if required).

Definition at line 1326 of file model.h.

static unsigned short frepple::HasLevel::getNumberOfClusters (  )  [inline, static]

Returns the total number of clusters.
If not up to date the recomputation will be triggered.

Definition at line 1308 of file model.h.

static unsigned short frepple::HasLevel::getNumberOfHangingClusters (  )  [inline, static]

Returns the total number of hanging clusters. A hanging cluster is a cluster that consists of a single entity that isn't connected to any other entity.
If not up to date the recomputation will be triggered.

Definition at line 1319 of file model.h.

static void frepple::HasLevel::triggerLazyRecomputation (  )  [inline, static]

This function should be called when something is changed in the network structure. The notification sets a flag, but does not immediately trigger the recomputation.

See also:
computeLevels

Definition at line 1344 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