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 Answer 1

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.

Sign up to request clarification or add additional context in comments.

4 Comments

Ok I removed the choice condition and I assumed that collection 'col_jobProcTimes' is created in mais correct? If yes, that is what I have done. I updated the question with my iteration through the agent population code because I don't think I am doing it correctly. Thank you
i've modified the answer
Thank you so much, it worked. I think I finished what I wanted to do, thanks to you!
Cool, can you please close the question?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.