立體化停車場設(shè)計書

上傳人:E**** 文檔編號:44751619 上傳時間:2021-12-05 格式:DOC 頁數(shù):56 大?。?,003.50KB
收藏 版權(quán)申訴 舉報 下載
立體化停車場設(shè)計書_第1頁
第1頁 / 共56頁
立體化停車場設(shè)計書_第2頁
第2頁 / 共56頁
立體化停車場設(shè)計書_第3頁
第3頁 / 共56頁

下載文檔到電腦,查找使用更方便

118 積分

下載資源

還剩頁未讀,繼續(xù)閱讀

資源描述:

《立體化停車場設(shè)計書》由會員分享,可在線閱讀,更多相關(guān)《立體化停車場設(shè)計書(56頁珍藏版)》請在裝配圖網(wǎng)上搜索。

1、立體化停車場設(shè)計書1.1課題任務(wù)設(shè)停車場有地下和地面兩層, 統(tǒng)一管理。 地下停車場采用單入口和單出口。 地上停車場采用南北方向的雙口,每個口都有一個入口和出口。停車順序先地面,后地下。地面入口處各有一個單車道的等候通道, 并允許等候的車輛因急事從等候通道直接開走。 具體的設(shè)計任務(wù)如下:( 1)采用棧、隊列和有序表等數(shù)據(jù)結(jié)構(gòu)。( 2)等候車輛的管理。( 3)地下、地上停車位的管理。( 4)停車計費功能 。1.2課題原理針對本次課程設(shè)計的具體要求, 我們設(shè)計了如下方案: 停車場部選擇棧作為基本數(shù)據(jù)結(jié)構(gòu),充分利用棧后進先出的數(shù)據(jù)結(jié)構(gòu)特點,停車場外部的等候區(qū)域,針對其“先到先出”的工作特點,選擇隊列作

2、為基本數(shù)據(jù)結(jié)構(gòu)。同時設(shè)計了計時計費功能,會員制度,針對不同型號,是否為會員的車輛進行分類收費。2 需求分析2.1課題調(diào)研為了完成本次課程設(shè)計任務(wù), 我們對校園周邊的停車場運作狀況進行了一系列的前期調(diào)研,包括停車場的管理系統(tǒng)的運行原理, 收費標(biāo)準(zhǔn)等等, 為本次課程設(shè)計任務(wù)的完成打下了良好的基礎(chǔ)。2.2功能需求此次設(shè)計任務(wù),要求停車場分為上下兩層,上層為南北雙向入口和出口,下層為單向入口出口,并要求我們設(shè)計等待區(qū)域。對于收費標(biāo)準(zhǔn),我們將不同型號的車分類收費,同時增加會員管理制度,對于多次在本停車場停車的會員給予優(yōu)惠。3 方案設(shè)計3.1總體功能設(shè)計本次課程設(shè)計共分為四個主要功能:( 1)進入停車場(

3、 2)離開停車場( 3)查看停車場現(xiàn)狀( 4)計費功能針對進入停車場的功能,我們設(shè)計了“先地上,后地下” ,的停放順序,當(dāng)?shù)厣夏媳彪p向任一停車場停滿后,再向該停車場進車,會顯示“停車場已滿”等提示信息,并將車輛停入有剩余車位的其他停車場。 當(dāng)所有停車場均無停車位時, 到來車輛將會進入等待區(qū)域, 一旦有車輛離開停車場,最先到達等待的區(qū)域的車輛將會進入停車場。針對離開停車場的功能,可選擇任一停車場出車,并會根據(jù)停車時長,車輛類型,以及是否為會員等信息給出本次停車的費用。針對查看停車場現(xiàn)狀的功能,將顯示車牌號,何處停車等相關(guān)信息。此外,我們還設(shè)計了計費功能, 利用 windows 系統(tǒng)自帶函數(shù)獲取時

4、間, 免去了人工手動輸入時間的繁瑣步驟, 同時,針對不同車型, 是否享受會員優(yōu)惠等差異制定了不同的收費標(biāo)準(zhǔn),使停車場的運行更為規(guī)化,合理化。3.2數(shù)據(jù)結(jié)構(gòu)設(shè)計本次課程設(shè)計主要使用了棧和隊列兩種數(shù)據(jù)結(jié)構(gòu), 具體的設(shè)計方案和操作過程將在個人報告中給出,在此不再贅述。3.3函數(shù)原型設(shè)計int main()system(color E1);coutendl;coutendl;cout endl;cout ” endl; coutendl;coutendl;coutendl;coutendl;coutendl;Car w;int t = 1;s1.sInitStack();s2.sInitStack()

5、;temt1.sInitStack();s3.InitStack(&s3);temp1.InitStack(&temp1);shortcut.InitQueue();while (t)cout= endl;cout*1. 進入停車場*endl;cout* 2. 離開停車場*endl;cout*3. 查看停車場現(xiàn)狀*endl;cout* 0. 退 出*endl;cout=endl;coutendl;coutt;switch (t)case 1: CarIn(&s3,&s1,&s2, &shortcut); break;case 2: CarOut(&s3,&temp1,&s1,&s2,&temt

6、1 ,&shortcut); break;case 3: LookNow(&s3, &temp1, &s1, &s2, &temt1, &shortcut,&w); break;case 0: break;return 0;3.4用戶界面設(shè)計運行時為DOS界面,通過增加字符畫,更換背景顏色等方法增加界面的美觀度。4 方案實現(xiàn)4.1開發(fā)環(huán)境與工具開發(fā)環(huán)境: VisualC+6.04.2個人設(shè)計實現(xiàn)(按組員分小節(jié))奕設(shè)計實現(xiàn)隊列類的實現(xiàn):typedef struct QueueNode/隊列結(jié)構(gòu)Car data;struct QueueNode *next;QueueNode;class Queu

7、e/定義隊列類public:QueueNode *front, *rear;Queue()cout構(gòu)造函數(shù) endl;Queue();int InitQueue();int DestroyQueue(Queue *Q);int EnterQueue(Queue *Q, Car c);int EmptyQueue(Queue*Q);int DeleteQueue(Queue *Q,Car *c);int QueueLength(Queue *Q);Queue:Queue()cout析構(gòu)函數(shù) endl;int Queue:EmptyQueue(Queue *Q)if (front=rear)cou

8、t 隊列為空 endl;return (TRUE);elsecout 隊列不為空 next = NULL;cout 構(gòu)造了一個空隊列next;free(front);front=rear;cout 銷毀隊列成功next = (QueueNode *)malloc(sizeof(QueueNode);if (rear-next = NULL)cout車輛入隊失敗 next;rear-data = c;/rear-data.licence= rear-data.leaved;cout車輛入隊成功 countnext = NULL;count+;return (TRUE);int Queue:Del

9、eteQueue(Queue *Q,Car *c)/ 刪除隊列元素QueueNode *t;if (EmptyQueue( Q)cout 要查找車輛不存在!next;if (rear = t)rear = front;(*c)= t-data;front-next = t-next;free(t);cout 車輛刪除成功endl;count-;return (TRUE);int Queue:QueueLength(Queue *Q)if (front!=rear)cout 此時隊列長隊為count-1endl;return 1;else return 0;王卓君設(shè)計實現(xiàn)Time 類:#incl

10、ude #include #include #include#include #include #include using namespace std;class Time/時間類private:SYSTEMTIME LocalTime;int month;int day;int hour;int minuet;int second;public:Time()GetLocalTime(&LocalTime);/取系統(tǒng)時間void OutputTime();/輸出時間函數(shù)int getmonth() return LocalTime.wMonth;int getday() return Loc

11、alTime.wDay;int gethour() return LocalTime.wHour;int getminute() return LocalTime.wMinute;int getsecond() return LocalTime.wSecond;void save()month=getmonth();day=getday();hour=gethour();minuet=getminute();second=getsecond();Time();void Time:OutputTime()/輸出當(dāng)前系統(tǒng)時間cout 當(dāng) 前 時 間 為 : getmonth()月 getday()

12、getminute()分 getsecond()秒 endl;日gethour()時/ 主函數(shù)void main()Time t;t.OutputTime();cout現(xiàn) 在 是t.getminute()t.getmonth()分 t.getsecond()月t.getday()秒 endl;日t.gethour()時Guest 類:#include #include #include #include#include #include #include static int carfre100=0;/static int carid=0;using namespace std;class T

13、ime/時間類private:SYSTEMTIME LocalTime;int month;int day;int hour;int minuet;int second;public:Time()GetLocalTime(&LocalTime);/取系統(tǒng)時間void OutputTime();/輸出時間函數(shù)int getmonth() return LocalTime.wMonth;int getday() return LocalTime.wDay;int gethour() return LocalTime.wHour;int getminute() return LocalTime.wM

14、inute;int getsecond() return LocalTime.wSecond;void save()month=getmonth();day=getday();hour=gethour();minuet=getminute();second=getsecond();Time();void Time:OutputTime()/輸出當(dāng)前系統(tǒng)時間cout 當(dāng) 前 時 間 為 : getmonth()getminute()分 endl;月 getday()日gethour()時#define MAXSIZE 100 typedef struct /鏈表的最大長度線性表的靜態(tài)單鏈表的存儲

15、結(jié)構(gòu)/char data10;int data;int cur;component,SLinkListMAXSIZE;typedef struct Carint leaved;char licenceLICENCESIZE;Time arrive;Time leave;Car;class Guest:public Time/客戶類,繼承Time 類public:Time t1,t2;SLinkList carid;/該數(shù)組存車牌號/char e10;int e;int j,k,v;int cartype;/車輛類型:1 客車2貨車3轎車4 越野車5 跑車float price;public:G

16、uest()for(int i=1,m=0;i=100,m100;i+,m+)caridm.cur=i;/caridi.data = 0000000;/j=0;Guest()intLocateElem(SLinkListcarid,int*e);/線性表定位函數(shù),查找值為e 的元素void saveid(Car *c,int v); float fee(Time t1,Time t2);/該函數(shù)儲存會員的車牌號和停車次數(shù)計算價格函float cutprice(float price,int v);/計算打折價格函數(shù);int Guest:LocateElem(SLinkList carid,in

17、t *e)/在靜態(tài)單鏈線性表中查找第個值為 i 的元素若找到,則返回它在表中的位序,否則返回下一1位k=0;/while(k&strcmp(caridk.data,e)!=0)/在表中順鏈查找while(caridk.data != *e)k=caridk.cur;if(!caridk.data)j=k;k=0;return j+1;return k+1;/LocateElemfloat Guest:fee(Time t1,Time t2)/計算普通價格if(t1.getmonth()!=t2.getmonth()price=(t2.getmonth()-t1.getmonth()*3000;

18、else if(t1.getday()!=t2.getday()price=(t2.getday()-t1.getday()*500;elseprice=(t2.gethour()-t1.gethour()*3600+(t2.getsecond()-t1.getsecond()*60+ (t2.getsecond()-t1.getsecond()*CHARGE;cout 您的車是什么類型? 1 客車 2 貨車 3 轎車 4 越野車 5 跑車 cartype;switch(cartype)/1case 1:case 2:price=price*2;break;case 3:price=price

19、;break;case 4:price=price*1.5;break;case 5:price=price*1.2;break;客車2貨車3轎車4 越野車5 跑車return price;float Guest:cutprice(float price,int v)/計算會員打折后的價格/int i = LocateElem(carid,*e);/調(diào)用線性表定位函數(shù)if(carfrev-1=100)price=price*0.55;else if(carfrev-1=50)price=price*0.7;else if(carfrev-1=20)price=price*0.85;elsepr

20、ice=price*0.95;return price;/LocateElem函數(shù)的測試函數(shù)void main()Guest guest;int e;SLinkList carid;for(int n=0,x=1111;n5,x=5555;n+,x=x+1111)caridn.data=x;for(int i=1,m=0;i=100,m100;i+,m+)caridm.cur=i;for(int y=5;y100;y+)caridy.data=0;coute;cout 結(jié)果是存在第guest.LocateElem(carid,&e)位endl;小玉設(shè)計實現(xiàn)voidCarOut1(SqStack

21、*parking1,SqStack*parking2,SqStack*temt,Queue *shortcutt)int a;char licenceLICENCESIZE;Car c;Time t2;t2.save();Guest guest;t2.OutputTime();cout 請輸入車牌號:;gets(licence);printf(南停車場出車請輸入0,北停車場出車請輸入1.n);scanf(%d%*c, &a);if(!(a=1)int i = 0;s1.sPop(&s1, &c);while (strcmp(c.licence, licence) != 0 & s1.top!=

22、0)temt1.sPush(&temt1, c);s1.sPop(&s1, &c);i+;c.leave=t2;int x;float price;coutx;if(x=1)price=guest.fee(c.arrive,c.leave);price=guest.cutprice();elseprice=guest.fee(guest.t1,guest.t2);cout 該車應(yīng)付 fabs(price) 元endl; while (!s1.sEmpty(&s1)temt1.sPop(&temt1, &c);s1.sPush(&s1, c);if (!shortcut.EmptyQueue(

23、&shortcut)shortcut.DeleteQueue(&shortcut,& c);s1.sPush(&s1, c);c.leave=t2;printf(n);elses2.sPop(&s2,&c);while (strcmp(c.licence, licence) != 0)temt1.sPush(&temt1, c);s2.sPop(&s2, &c);c.leave=t2;int x;float price;coutx;if(x=1)price=guest.fee(c.arrive,c.leave);price=guest.cutprice();elseprice=guest.fe

24、e(guest.t1,guest.t2);cout 該車應(yīng)付 fabs(price) 元endl; while (!temt1.sEmpty(&temt1)temt1.sPop(&temt1, &c);s2.sPush(&s2, c);if (!shortcut.EmptyQueue(&shortcut)shortcut.DeleteQueue(&shortcut,& c);s2.sPush(&s2, c);printf(n);void CarOut2(Stack *park, Stack *temp,Queue *Q)char licenceLICENCESIZE;Car c;Time t2

25、;t2.save();Guest guest;t2.OutputTime();cout 請輸入車牌號:;gets(licence);s3.Pop(&s3, &c);while (strcmp(c.licence, licence) != 0)temp1.Push(&temp1, c);s3.Pop(&s3, &c);c.leave=t2;int x;float price;coutx;if(x=1)price=guest.fee(c.arrive,c.leave);price=guest.cutprice();elseprice=guest.fee(guest.t1,guest.t2);cou

26、t 該車應(yīng)付 fabs(price) 元 endl; while (!s3.EmptyStack(&temp1)temp1.Pop(&temp1, &c);s3.Push(&s3, c);if (!shortcut.EmptyQueue( Q)shortcut.DeleteQueue(&shortcut, &c);s3.Push(&s3, c);printf(n);void CarOut(Stack *park, Stack *temp,SqStack *parking1,SqStack *parking2,SqStack *temt ,Queue *shortcut)int P;cout 地

27、上停車場出車請輸入 1,地下停車場出車請輸入 2 ; scanf(%d%*c, &P);switch(P)case 1:CarOut1(parking1, parking2,temt, shortcut );break;case 2:CarOut2(park, temp, shortcut);break;天舒設(shè)計實現(xiàn)typedef struct Carint licence;Car;class SqStackpublic:Car dataSTACKSIZE;int top;int base;SqStack();void InitSqStack(SqStack *s);int EmptySqSt

28、ack(SqStack *s);int FullSqStack(SqStack *S);int SGetTop(SqStack *s,Car c);int SPush(SqStack *s,Car c);int SPop(SqStack *s,Car *c);SqStack:SqStack()/析構(gòu)函數(shù)int SqStack:EmptySqStack(SqStack *s)if (base=top)cout 地上停車場現(xiàn)無車,棧為空!endl;return (TRUE);elsecout 地上停車場現(xiàn)有車,棧不為空!endl;return (FALSE);int SqStack:FullSqS

29、tack(SqStack *S)if (top = STACKSIZE - 1)cout 地上停車場車輛已滿,棧滿!endl;return (TRUE);elsecout 地上停車場還有空位,棧未滿!endl;return (FALSE);int SqStack:SPush(SqStack *S, Car c)if (FullSqStack(S)return (FALSE);elsetop+;datatop = c;cout 車輛已入棧,成功停入地上停車場 !endl; return (TRUE);int SqStack:SPop(SqStack *S, Car *c)if (EmptySqS

30、tack(S)return (FALSE);else(*c) = datatop;top-;cout 車輛已出棧,離開地上停車場,歡迎下次光臨!endl;return (TRUE);int SqStack:SGetTop(SqStack *s,Car c)if(top=base)return FALSE;elsec=datatop-1;top-;return (TRUE);/若棧非空,則返回s 的棧頂元素;否則返回ERRORvoid SqStack:InitSqStack(SqStack *s)top=0;base=0;cout 現(xiàn)構(gòu)造一個空棧!endl;/置棧一個空棧Sclass Stack

31、public:Car dataSTACKSIZE;int top;int base;Stack();void InitStack(Stack *s);int EmptyStack(Stack *s);int FullStack(Stack *S);int GetTop(Stack *s,Car c);int Push(Stack *s,Car c);int Pop(Stack *s,Car *c);Stack:Stack()cout 現(xiàn)已構(gòu)造一個棧類endl;/析構(gòu)函數(shù)int Stack:EmptyStack(Stack *S)if (base=top)cout 地下停車場現(xiàn)無車,棧為空!en

32、dl;return (TRUE);elsecout 地下停車場現(xiàn)有車,棧不為空!endl;return (FALSE);int Stack:FullStack(Stack *S)if (top = STACKSIZE - 1)cout 地下停車場車輛已滿,棧滿!endl;return (TRUE);elsecout 地下停車場還有空位,棧未滿!endl;return (FALSE);int Stack:Push(Stack *S, Car c)if (FullStack(S)return (FALSE);elsetop+;datatop = c;cout 車輛已入棧,成功停入地下停車場 !en

33、dl; return (TRUE);int Stack:Pop(Stack *S, Car *c)if (EmptyStack(S)return (FALSE);else(*c) = datatop;top-;cout 車輛已出棧,離開地下停車場,歡迎下次光臨!endl;return (TRUE);int Stack:GetTop(Stack *s,Car c)if(top=base)return FALSE;elsec=datatop-1;top-;return (TRUE);/若棧非空,則返回s 的棧頂元素;否則返回ERRORvoid Stack:InitStack(Stack *s)to

34、p=0;base=0;cout 現(xiàn)構(gòu)造一個空棧!endl;/置棧一個空棧S嘉文設(shè)計實現(xiàn)void CarIn(Stack *park, SqStack *parking1,SqStack *parking2,Queue *shortcuttt)int q=1;Car c;Time t1;Guest guest;t1.OutputTime();t1.save();c.arrive=t1;coutendl;guest.saveid(&c);if(s3.FullStack(&s3)=1)&(s1.sFullStack(&s1)=1)&(s2.sFullStack(&s2)=1)cout 停車場已滿,新

35、來的車在過道等待 !endl; shortcut.EnterQueue( &shortcut, c);elseif(s1.sFullStack(&s1)=1)&(s2.sFullStack(&s2)=1)cout地上停車場已滿,請停入地下停車場endl;cout 車已在停車場停車,現(xiàn)在開始計時coutendl;s3.Push(&s3, c);system(pause);elseif(s1.sFullStack(&s1)=0)&(s2.sFullStack(&s2)=0)cout 南北停車場均有車位coutendl;endl;cout請選擇車輛進口編號,南:1,北:2endl;cout 請輸入入

36、口方向:;scanf(%d%*c, &q);switch(q)case 1:s1.sPush(&s1,c);break;case 2:s2.sPush(&s2, c);break;else if(s1.sFullStack(& s1)=0)&(s2.sFullStack(& s2)=1)cout 北入口已滿,車輛進入南入口endl;s1.sPush(&s1,c);system(pause);else if(s1.sFullStack(parking1)=1)&(s2.sFullStack(parking2)=0)cout南入口已滿,車輛進入北入口endl;s2.sPush(&s2, c);sy

37、stem(pause);cout車已在停車場停車,現(xiàn)在開始計時!endl;cout 請按任意鍵繼續(xù)操作 ! ; getchar();system(cls);system(color b0);printf(n);voidLookNow(Stack *park,Stack *temp,SqStack*parking1,SqStack*parking2,SqStack*temt,Queue *shortcut,Car *c)QueueNode *p;while (!s1.sEmpty(&s1)s1.sPop(&s1,c);temt1.sPush(&temt1,* c);while (!temt1.s

38、Empty(&temt1)temt1.sPop(&temt1, c);cout車輛停車信息licence:地上南停車場停車 endl;s1.sPush(&s1,* c);while (!s2.sEmpty(&s2)s2.sPop(&temt1, c);temt1.sPush(&temt1, *c);while (!temt1.sEmpty(&temt1)temt1.sPop(&temt1, c);cout車輛停車信息licence:地上北停車場停車 endl;s2.sPush(&s2, *c);while (!s3.EmptyStack(&s3)s3.Pop(&s3, c);temp1.Pus

39、h(&temp1, *c);while (!temp1.EmptyStack(&temp1)temp1.Pop(&temp1, c);cout車輛停車信息licence:地下停車場停車 front-next;while (p != NULL)cout 車 輛 停 車 信 息licence: 排 隊 等 待中 .next;printf(n);int main()system(color E1);coutendl;cout endl;cout endl;cout endl; coutendl;coutend l;coutendl;coutendl;coutendl;Car w;int t = 1;

40、s1.sInitStack();s2.sInitStack();temt1.sInitStack();s3.InitStack(&s3);temp1.InitStack(&temp1);shortcut.InitQueue();while (t)cout= endl;cout* 1.進入停車場*endl;coutcout* 2. 離開停車場 * 3.查看停車場現(xiàn)狀endl;*endl;cout* 0.退 出*endl;cout=endl;coutendl;coutt;switch (t)case 1: CarIn(&s3,&s1,&s2, &shortcut); break;case 2: C

41、arOut(&s3,&temp1,&s1,&s2,&temt1 ,&shortcut); break;case 3: LookNow(&s3, &temp1, &s1, &s2, &temt1, &shortcut,&w); break;case 0: break;return 0;5 測試與調(diào)試5.1個人測試(按組員分小節(jié))奕測試#include #include #include #include#include #include #include #include #define STACKSIZE 3 / #define LICENCESIZE 10/ static int count=1;設(shè)置地下停車場容量設(shè)置車牌號#define TRUE 1#define FALSE 0using namespace std;typedef struct Carint leaved;char licenceLICENCESIZE;Car;typedef struct QueueNode/隊列結(jié)構(gòu)

展開閱讀全文
溫馨提示:
1: 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
2: 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
3.本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
5. 裝配圖網(wǎng)僅提供信息存儲空間,僅對用戶上傳內(nèi)容的表現(xiàn)方式做保護處理,對用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對任何下載內(nèi)容負(fù)責(zé)。
6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請與我們聯(lián)系,我們立即糾正。
7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時也不承擔(dān)用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。

相關(guān)資源

更多
正為您匹配相似的精品文檔
關(guān)于我們 - 網(wǎng)站聲明 - 網(wǎng)站地圖 - 資源地圖 - 友情鏈接 - 網(wǎng)站客服 - 聯(lián)系我們

copyright@ 2023-2025  zhuangpeitu.com 裝配圖網(wǎng)版權(quán)所有   聯(lián)系電話:18123376007

備案號:ICP2024067431-1 川公網(wǎng)安備51140202000466號


本站為文檔C2C交易模式,即用戶上傳的文檔直接被用戶下載,本站只是中間服務(wù)平臺,本站所有文檔下載所得的收益歸上傳人(含作者)所有。裝配圖網(wǎng)僅提供信息存儲空間,僅對用戶上傳內(nèi)容的表現(xiàn)方式做保護處理,對上載內(nèi)容本身不做任何修改或編輯。若文檔所含內(nèi)容侵犯了您的版權(quán)或隱私,請立即通知裝配圖網(wǎng),我們立即給予刪除!