#include #include #include #include "simulation.h" #include "random.h" #define t_piti negexp(1/(30.0f*60.0f)) #define t_obsluha real()*60+60 #define t_sim 10*60*60 #define pocet_hostu 15 #define pocet_stamgastu 5 using namespace std; class THost : public CProcess { private: int id; virtual void Run(); public: THost(int n) {id = n;}; int getID() {return id;}; }; class TStamgast : public CProcess { private: int id; virtual void Run(); public: TStamgast(int n) {id = n;}; int getID() {return id;}; }; class THostinsky : public CProcess { virtual void Run(); }; template class Stat { private: T suma; T max; int pocet; public: Stat() {suma=0; max=0; pocet=0;}; void addItem(T item) {pocet++; suma+=item; if(item > max) max=item;}; T getMax() {return max;}; double getAvg() {return suma/(double) pocet;}; }; CHead *Hosti; // Fronta hostu CHead *Stamgasti; // Fronta stamgastu THostinsky *Hostinsky; // Obsluha Stat