The class means is derived from the SIM class resource .
class means : public resource { public: means(histogram* h, double c = 1.0); // histogram should be WEIGHTED means(double c = 1.0); // constructor, c = capacity void occupy_frequency(double a, bpgenerator* g = NULL, distribution db = EXACT, double b = 0); // set unavailability frequency void occupy_duration(double a, bpgenerator* g = NULL, distribution db = EXACT, double b = 0); // set unavailability duration };
Objects of class means have a capacity that can be specified when creating the object. Take, for instance, a process where customers are served at counters and there are three counters. To simulate such a process one could create an object counter of class means with capacity three.
If certain means are also used in operations that are not part of the modelled process, one can use the members occupy_frequency and occupy_duration to specify how often -- the frequency -- and how long -- the duration -- the means are not available. The frequency and duration can be generated according to a certain distribution, specified by the parameters of the member functions occupy_frequency and occupy_duration.