machine.h

来自「data structures, algorithms and Applicat」· C头文件 代码 · 共 25 行

H
25
字号
//Machine class used in machine shop simulation
#ifndef Machine_
#define Machine_

class Machine {
   friend Job* ChangeState(int);
   public:
      Machine() {TotalWait = NumTasks = 0;
                 Active = 0;}
      bool IsEmpty() {return JobQ.IsEmpty();}
      void AddJob(Job* x) {JobQ.Add(x);}
      void SetChange(long w) {ChangeTime = w;}
      void Stats(long& tw, long& nt)
              {tw = TotalWait;
               nt = NumTasks;}
   private:
      LinkedQueue<Job*> JobQ; // queue of waiting jobs
      long ChangeTime;  // machine changeover time
      long TotalWait;   // total delay at this machine
      long  NumTasks;   // number of tasks processed
      Job *Active;      // pointer to current job
};

#endif

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?