微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

Anylogic - 基于处理时间的队列 DB

如何解决Anylogic - 基于处理时间的队列 DB

我正在使用 anylogic 进行作业车间调度。我有 20 个作业(具有每个作业的机器序列数据库的代理)和 5 台机器(资源)。

This is what I have right now. Source creates the 20 jobs and in the exit block i have the 'nextmachine' function,that sends each job to the correct machine of its sequence.

现在我想使用其他数据库表,该表包含每个作业序列的机器中每个作业的处理时间。我想对所有队列进行排序以缩短处理时间。我使用新的数据库表创建了一个新代理“processingTimes”,并尝试将作业 ID 与 processingTimes 相关联,以便正确关联处理时间。

Processing times table.

I created this collection,inside my new agent,containing the processing times of each job.

Did this,trying to associate both agents id but I think it is not correct.

Finally,this is the condition I put so that I can order my jobs in relation to their processing times. I also think the code is not correct.

关于我做错了什么的任何提示

新:

This is my iterator but gives me the errors showed

New collection properties.

解决方法

需要进行以下更改:

  1. 从数据库加载processingTimes时删除选择条件
  2. 创建一个int->ProcessingTime的LinkedHashMap类型的集合,我们称之为col_jobProcTimes
  3. Main->启动时 - 遍历 processingTimes[] 人口并将它们放入 col_jobProcTimes 地图以供以后查找
  4. 队列“agent1 优先于 agent2”字段中的两个代理是 作业,因此对于每个作业,您需要执行:col_jobProcTimes.get((job)agent.jobpt).col_processSequence.get((job)agent.counter) 以获得延迟和比较两者

更新。

关于 pt. 3、上面的代码应该是:

for (ProcessingTimes pt : processingTimes) {
    col_jobProcTimes.put(pt.jobpt,pt);
}

AnyLogic 帮助网站有一个很好的使用 java here 的参考。

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。