-
大小: 4.2MB文件類型: .rar金幣: 2下載: 0 次發(fā)布日期: 2023-09-18
- 語言: 其他
- 標簽: 仿真??排隊系統(tǒng)??
資源簡介
包含源代碼和實驗報告
排隊系統(tǒng)仿真實驗報告
一個聯(lián)通營業(yè)廳,9:00到18:00營業(yè)。客戶首先要通過取票系統(tǒng)拿到自己的號,先在等待區(qū)等待叫號系統(tǒng)報自己的號。一共有2個服務(wù)臺,2個服務(wù)臺同時工作,哪個服務(wù)臺叫到幾號,拿這個號碼的人就去哪個服務(wù)臺,叫號系統(tǒng)按順序叫號,2個服務(wù)臺叫號不會發(fā)生重復(fù)現(xiàn)象。............................

代碼片段和文件信息
package?fangzhen;
import?java.util.ArrayList;
import?java.util.List;
//控制臺表格形式輸出
public?class?ConsoleTable?{
private?List?rows?=?new?ArrayList();
private?int?colum;
private?int[]?columLen;
private?static?int?margin?=?2;
public?ConsoleTable(int?colum)?{
this.colum?=?colum;
this.columLen?=?new?int[colum];
}
public?void?appendRow()?{
List?row?=?new?ArrayList(colum);
rows.add(row);
}
public?ConsoleTable?appendColum(object?value)?{
if?(value?==?null)?{
value?=?“NULL“;
}
List?row?=?rows.get(rows.size()?-?1);
row.add(value);
int?len?=?value.toString().getBytes().length;
if?(columLen[row.size()?-?1]? columLen[row.size()?-?1]?=?len;
return?this;
}
public?String?toString()?{
StringBuilder?buf?=?new?StringBuilder();
int?sumlen?=?0;
for?(int?len?:?columLen)?{
sumlen?+=?len;
}
for?(int?ii?=?0;?ii? List?row?=?rows.get(ii);
for?(int?i?=?0;?i? String?o?=?““;
if?(i? o?=?row.get(i).toString();
buf.append(‘|‘).append(printChar(‘?‘?margin)).append(o);
buf.append(printChar(‘?‘?8?-?o.getBytes().length));
}
buf.append(“|\n“);
buf.append(“|“).append(printChar(‘-‘?76)).append(“|“);
}
return?buf.toString();
}
private?String?printChar(char?c?int?len)?{
StringBuilder?buf?=?new?StringBuilder();
for?(int?i?=?0;?i? buf.append(c);
}
return?buf.toString();
}
}
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????文件??????65815??2017-09-18?17:32??排隊系統(tǒng)\實驗報告.docx
?????文件????????232??2017-05-22?20:30??排隊系統(tǒng)\代碼實現(xiàn)\.classpath
?????文件??????????0??2017-05-24?22:09??排隊系統(tǒng)\代碼實現(xiàn)\.me
?????文件???????4714??2017-05-24?22:09??排隊系統(tǒng)\代碼實現(xiàn)\.me
?????文件?????????20??2017-05-24?22:11??排隊系統(tǒng)\代碼實現(xiàn)\.me
?????文件?????????32??2017-05-24?22:11??排隊系統(tǒng)\代碼實現(xiàn)\.me
?????文件????????560??2017-05-24?22:11??排隊系統(tǒng)\代碼實現(xiàn)\.me
?????文件????????235??2017-05-24?22:13??排隊系統(tǒng)\代碼實現(xiàn)\.me
?????文件??????????1??2017-05-24?22:14??排隊系統(tǒng)\代碼實現(xiàn)\.me
?????文件????????151??2017-05-24?22:14??排隊系統(tǒng)\代碼實現(xiàn)\.me
?????文件??????????1??2017-05-24?22:14??排隊系統(tǒng)\代碼實現(xiàn)\.me
?????文件????????185??2017-05-24?22:14??排隊系統(tǒng)\代碼實現(xiàn)\.me
?????文件????????865??2017-05-24?22:14??排隊系統(tǒng)\代碼實現(xiàn)\.me
?????文件?????????42??2017-05-24?22:10??排隊系統(tǒng)\代碼實現(xiàn)\.me
?????文件?????????87??2017-05-24?22:09??排隊系統(tǒng)\代碼實現(xiàn)\.me
?????文件????????517??2017-05-24?22:14??排隊系統(tǒng)\代碼實現(xiàn)\.me
?????文件?????????58??2017-05-24?22:09??排隊系統(tǒng)\代碼實現(xiàn)\.me
?????文件?????????73??2017-05-24?22:14??排隊系統(tǒng)\代碼實現(xiàn)\.me
?????文件?????????62??2017-05-24?22:09??排隊系統(tǒng)\代碼實現(xiàn)\.me
?????文件?????????97??2017-05-24?22:09??排隊系統(tǒng)\代碼實現(xiàn)\.me
?????文件????????243??2017-05-24?22:14??排隊系統(tǒng)\代碼實現(xiàn)\.me
?????文件????????145??2017-05-24?22:10??排隊系統(tǒng)\代碼實現(xiàn)\.me
?????文件????????100??2017-05-24?22:10??排隊系統(tǒng)\代碼實現(xiàn)\.me
?????文件?????????69??2017-05-24?22:14??排隊系統(tǒng)\代碼實現(xiàn)\.me
?????文件?????????69??2017-05-24?22:14??排隊系統(tǒng)\代碼實現(xiàn)\.me
?????文件????????129??2017-05-24?22:14??排隊系統(tǒng)\代碼實現(xiàn)\.me
?????文件????????371??2017-05-24?22:14??排隊系統(tǒng)\代碼實現(xiàn)\.me
?????文件?????????97??2017-05-24?22:14??排隊系統(tǒng)\代碼實現(xiàn)\.me
?????文件?????????83??2017-05-24?22:09??排隊系統(tǒng)\代碼實現(xiàn)\.me
?????文件????????110??2017-05-24?22:14??排隊系統(tǒng)\代碼實現(xiàn)\.me
............此處省略138個文件信息
評論
共有 條評論