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 的参考。