0

I am trying to do a job shop scheduling resorting to anylogic. I have 20 jobs(Agent 'jobs') that have to go through 5 machines(each one a unit capacity resource). I have two database tables, one having the specific order of each job through the machines and the other one has the processing times of the jobs in the respectives machines.

This is what I have right now. The source creates the 20 jobs and I want that the exit blocks sent the jobs through their sequence. I made the 'nextmachine' function that I put in the On Exit section in each one of the exit blocks.

This is my 'nextmachine' function and the error I keep getting and don't know how to solve. Enterblocks is a collection of class ArrayList and element class Agent that have the 5 enter blocks and the col_machineSequence is a collection with each job machine sequence.

The 'nextmachine' code was based in this post How to store routings in job shop production in Anylogic.

I made a question previously Routing agents through specific resources in anylogic. Here you can see some of my previous doubts and some of the suggestions.

Thank you in advance

The enterblocks collection is in the jobs agent, and is defined in this way.

-New Error:I have this error, I think it is related with collection col_machineSequence.I have that code onStartup section.

1 Answers1

0

Here the Elements class property of enterblocks collections needs to be changed to Enter. To do this, select 'Other' in the dropdown and type Enter into the field that will appear to the right of the dropdown.

Artem P.
  • 816
  • 1
  • 6
  • 8
  • It worked, but now I am getting one big error. Please see my latest edition. – Rodrigo Lemos Jun 29 '21 at 22:42
  • ok, you have to populate `col_machineSequence` inside the job agent as it should be referring to op1, op2, etc parameters that are loaded from the jobs table into each job agent. – Artem P. Jun 29 '21 at 22:55
  • Isn't it already inside the job agent? I think I didn't understand I am sorry – Rodrigo Lemos Jun 29 '21 at 23:09
  • Ah yes it is, apologies for confusion. The error is occurring in `findFirst` call. This can happen when no match is found for which there can be 2 reasons: `col_machineSequence` is empty or contains wrong values. Hence, first test is to check what is populated in `col_machineSequence`, for that add a 'traceln' to see what values are being added. Second test is to check what name it is looking for, so do add `traceln` in `findFirst` call. – Artem P. Jun 30 '21 at 11:31