0

I am doing a job shop scheduling resorting to anylogic. I have 20 jobs (agent with a database of the machine sequence for each job) and 5 machines (resources).

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.

Now I want to use other DB table, the one with the processing times of each job in the machines of each job sequence. I want to order all queues in order to the shortest processing time. I created a new agent, 'processingTimes', using the new database table, and I am trying to associate the jobs id with the processingTimes ones so that the processing times are correctly associated.

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.

Any tips in what I am doing wrong?

New:

This is my iterator but gives me the errors showed

New collection properties.

1 Answers1

0

Following changes are required:

  1. remove Choice condition when loading processingTimes from database
  2. create a collection of type LinkedHashMap of int->ProcessingTime, let's call it col_jobProcTimes
  3. Main->On startup - iterate through processingTimes[] population and put them into the col_jobProcTimes map for later lookup
  4. the two agents in Queue "agent1 is preferred to agent2" field are Jobs, so for each job you need to do: col_jobProcTimes.get((job)agent.jobpt).col_processSequence.get((job)agent.counter) to get the double value for the delay and compare the two

Update.

Regarding pt. 3 above, the code should be:

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

AnyLogic help website has a good reference for working with java here.

Artem P.
  • 816
  • 1
  • 6
  • 8