JAVA的不懂,求大神指点

Ten0704 2015-10-02 10:07:25
/**
* TicketCounter demonstrates the use of a queue for simulating a waiting line.
*
* @author Dr. Lewis
* @author Dr. Chase
* @version 1.0, 08/12/08
*/

import jss2.*;

public class TicketCounter
{
final static int PROCESS = 120;
final static int MAX_CASHIERS = 10;
final static int NUM_CUSTOMERS = 100;

public static void main ( String[] args)
{
Customer customer;
LinkedQueue<Customer> customerQueue = new LinkedQueue<Customer>();
int[] cashierTime = new int[MAX_CASHIERS];
int totalTime, averageTime, departs;

/** process the simulation for various number of cashiers */
for (int cashiers=0; cashiers < MAX_CASHIERS; cashiers++)
{
/** set each cashiers time to zero initially*/
for (int count=0; count < cashiers; count++)
cashierTime[count] = 0;

/** load customer queue */
for (int count=1; count <= NUM_CUSTOMERS; count++)
customerQueue.enqueue(new Customer(count*15));

totalTime = 0;

/** process all customers in the queue */
while (!(customerQueue.isEmpty()))
{
for (int count=0; count <= cashiers; count++)
{
if (!(customerQueue.isEmpty()))
{
customer = customerQueue.dequeue();
if (customer.getArrivalTime() > cashierTime[count])
departs = customer.getArrivalTime() + PROCESS;
else
departs = cashierTime[count] + PROCESS;
customer.setDepartureTime (departs);
cashierTime[count] = departs;
totalTime += customer.totalTime();
}
}
}

/** output results for this simulation */
averageTime = totalTime / NUM_CUSTOMERS;
System.out.println ("Number of cashiers: " + (cashiers+1));
System.out.println ("Average time: " + averageTime + "\n");
}
}
}
下面几处不懂,求大神解释一下。
LinkedQueue<Customer> customerQueue = new LinkedQueue<Customer>();
customerQueue.enqueue(new Customer(count*15));
customer = customerQueue.dequeue();
...全文
172 1 打赏 收藏 举报
写回复
用AI写文章
1 条回复
切换为时间正序
请发表友善的回复…
发表回复
异常异长 2015-10-03
  • 打赏
  • 举报
回复
这个就要看 LinkedQueue 这个类的方法都做什么了 所以你要找到LinkedQueue这个类 一切就知道了
附训练好的 YOLO 权重与 PyQt 可视化检测界面,页面底部含可视化效果预览,毕设/课设开箱即用。 【数据集概况】 · 检测类别(中文):[坡道(ramp)] · 训练集:275 张 · 验证集:27 张 · 测试集:0 张 · 总计:302 张 该数据集聚焦于城市环境中各类建筑入口处的坡道设施,涵盖住宅、商铺、公共设施等多种场景,真实反映了无障碍通行设施在实际应用中的多样化形态。数据集中包含金属、橡胶、塑料等多种材质的坡道,以及不同尺寸、结构和安装方式的实例,充分体现了坡道在城市基础设施中的广泛部署与重要性。该数据集为城市智慧化管理、无障碍环境建设及公共安全监控提供了高质量的视觉基础支持。... 【训练曲线与评估图】 【模型训练配置】 参数 | 值 模型 | yolo26n 训练轮数 | 100 epochs 输入尺寸 | 640x640 批次大小 | 24 优化器 | auto 初始学习率 | 0.01 训练设备 【关键指标汇总】 训练了 33 个 epoch,最终轮指标: 指标 | 数值 mAP50 | **0.6372** mAP50-95 | 0.3401 Precision | 0.6603 Recall | 0.6190 train/box_loss | 1.0569 train/cls_loss | 0.7307 val/box_loss | 1.6084 val/cls_loss | 1.9323 【训练过程分析】 33 轮训练后 mAP50 仅 0.6372,模型收敛不充分。Loss 曲线前期下降后进入平台期,mAP 提升缓慢。mAP50-95 为 0.3401,定位精度同样偏低。 【模型性能评估】 Precision 0.6603、Recall 0.6190,精度高于召回,存在一... 使用场景:毕业设计、课程设计、深度学习入门、工业场景落地验证。

23,404

社区成员

发帖
与我相关
我的任务
社区描述
Java 非技术区
社区管理员
  • 非技术区社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧