⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 main.h

📁 单窗口售票系统仿真程序 运用秒推进法模拟了单窗口售票系统售票员忙、闲
💻 H
字号:
//---------------------------------------------------------------------------

#ifndef MainH
#define MainH
//---------------------------------------------------------------------------
#include <Classes.hpp>
#include <Controls.hpp>
#include <StdCtrls.hpp>
#include <Forms.hpp>
#include <ExtCtrls.hpp>
#include <math.h>
//---------------------------------------------------------------------------
class TForm1 : public TForm
{
__published:	// IDE-managed Components
        TListBox *TicketListBox;
        TTimer *SecondsTimer;
        TListBox *TelephoneListBox;
        TLabel *Label1;
        TLabel *Label2;
        TTimer *TimeOutTimer;
        TLabel *Label3;
        TMemo *Memo1;
        TTimer *ServiceTimer;
        TButton *Button1;
        TListBox *ListBox1;
        TLabel *Label4;
        TListBox *ListBox2;
        TLabel *Label5;
        TLabel *Label6;
        TMemo *Memo2;
        TLabel *Label7;
        void __fastcall SecondsTimerTimer(TObject *Sender);
        void __fastcall TimeOutTimerTimer(TObject *Sender);
        void __fastcall ServiceTimerTimer(TObject *Sender);
        void __fastcall Button1Click(TObject *Sender);
private:	// User declarations

         int SysTime;   //仿真时钟初值
         int BusyTime;  //忙的时间
         int Ticket_Time;//售票服务时间
         int Tele_Time;  //问讯服务时间
         int TimeBeforeService;
         int Service_Time;//单次服务时间
       //  int TeleQueue;//电话队列当前长度
       //  int TicketQueue;//购票队列当前长度
         int Tele_In;//一天中打进的电话数
         int Tele_UnIn;//一天中未打进的电话数
         int Tele_TimeOut;//一天中因超时自动挂断的电话数

         int Ticket_In; //一天中进入购票队列的人数
         int Ticket_Sold;//一天中卖出的票数

         bool ConductorState;//售票员状态 - 闲
         bool FirstComeInLunchTime; //是否为第一次进入午餐时间
         bool FirstComeInAfternoon;
         bool FirstComeInOverTime;
         int Ticket;

         void start(); //主控程序
         //产生第一个购票者和问询者
         //启动秒仿真计时器

         int Gaussian(double mean,double variance);
         int Poisson(double mean);

         void Arrive_LastTicket();//仿真时钟已经推进到最后一个购票者的到达时间
         //此时应该产生下一个购票顾客
         void Arrive_LastTelephone();//仿真时钟预警推进到最后一个问询者到达时间
         //此时应该产生下一个问讯顾客,并判断是否能进入问讯队列
         void Telephone_TimeOut();
         //判断是否有问询者超时
         void Ticket_Count();//得到购票者的购票数
         void report();
public:		// User declarations
        __fastcall TForm1(TComponent* Owner);
};
//---------------------------------------------------------------------------
extern PACKAGE TForm1 *Form1;
//---------------------------------------------------------------------------
#endif

⌨️ 快捷键说明

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