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>
List of all members.
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 1197 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 1239 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 1245 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 1250 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 47 of file leveled.cpp.
unsigned short frepple::HasLevel::getCluster |
( |
|
) |
const [inline] |
Return the cluster number (and recompute first if required).
Definition at line 1300 of file model.h.
short frepple::HasLevel::getLevel |
( |
|
) |
const [inline] |
Return the level (and recompute first if required).
Definition at line 1293 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 1275 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 1286 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 1311 of file model.h.
The documentation for this class was generated from the following files: