0

I am solving a job shop scheduling problem resorting to anylogic. I have 20 jobs (agents) and 5 machines(resources) and each job as a specific order to visit the machines. My question is: how can I make sure that each job follows its order.

This is what I have done. One agent called 'jobs' and 5 agents, each one corresponding to a machine. One resource pool associated to each one of the service blocks. In the collection enterblocks I selected the 5 enter blocks.

In the agent 'jobs' I have this. The parameters associated to each job, read from the database file, and the collection 'enternames' where I selected the machine(1,2,3,4,5) parameters and the collection 'ptimes' where I put the processing times of the job (This two colletions is where I am not sure I have done it correctly)

My database file

I am not sure how to use the counter used here How to store routings in job shop production in Anylogic. In the previous link the getNextService function is used in the exit blocks but I am also not sure how to use it in my case due to the counter.

  • Hi, this place works best for you if you ask very specific questions, show exactly what you tried already and where you are stuck. Your question if far too broad and would need a full lecture to tell you all about it. I suggest you read up here to learn how to ask great questions: Use https://stackoverflow.com/help/how-to-ask and this article focussed on AnyLogic: https://www.benjamin-schumann.com/blog/2021/4/1/how-to-win-at-anylogic-on-stackoverflow Treat us as very busy colleagues that are happy to help. The more effort you put into your question, the more likely you will get a reply :) – Benjamin Jun 28 '21 at 17:41
  • I have a database that consists in 20 lines (each one corresponds to a job) and 10 columns (machine sequence and the processing time corresponding to each machine). I want to do the job shop scheduling but I don't know how to assign each job to the machines in the order given in the file. I am doing what is in this post https://stackoverflow.com/questions/60158916/how-to-store-routings-in-job-shop-production-in-anylogic but i have some question about how using the collections. – Rodrigo Lemos Jun 28 '21 at 18:27
  • I made some editions to the original post – Rodrigo Lemos Jun 28 '21 at 18:56

1 Answers1

0

Firstly, to confirm that based on the Job agent and database view, the first line in the database will result in a Job agent with values such as:

  1. machine1 = 1 and process1=23
  2. machine2 = 0 and process2=82 and so on

If that is the intent, then a better way is to restructure the database, so there are two tables:

  1. Table of jobs to machine sequence looking something like this:
job op1 op2 op3 op4 op5
1 machine2 machine1 machine4 machine5 machine3
2 machine4 machine3 machine5 machine1 machine2
3 ... ... ... ... ...
  1. Table of jobs to processing time

Then, add a collection of type ArrayList of String to Job (let's call this collection col_machineSequence) and when the Job agents get created their on startup code should be:

   for (String param : List.of("op1","op2","op3","op4","op5")) {
       col_machineSequence.add(getParameter(param));
   }

As a result, col_machineSequence will contain sequence of machines each job should visit in the order defined in the database.

NOTE: Please see help on getParameter() here.

Also:

  1. Putting a Queue in front of the Service isn't necessary
  2. Repeating Enter-Queue-Service-Exit isn't necessary, this can be simplified using this method

Follow-up clarifications:

  1. Collections - these will be enclosed in each Job agent
  2. Queue sorting - Service block has Priorities / preemption which governs the ordering on the queue
  3. Create another agent for the second table (call the agent ProcessingTime and table processing_time) and add it to the Job agent and then load it from database filtering on p_jobid as shown in the picture

enter image description here

Artem P.
  • 816
  • 1
  • 6
  • 8
  • Ok I think I got it mas I still have some questions. I should create 2 collection like you suggested, one for the sequences and the other for the processing times right? Another question is, i am going to have as many colletions as the number of agent I have right? Or it is just one that includes everything? For last, I have a queue in front of service because I will order the jobs in relation to their processing times, or I can do that in the service block? Thank you for your answer – Rodrigo Lemos Jun 28 '21 at 22:38
  • Oh another question :) i should still use the collection enterblocks in the way I am currenty using it? – Rodrigo Lemos Jun 28 '21 at 22:40
  • I am so sorry, using to DB tables I can only associate one of them to the agent Jobs... – Rodrigo Lemos Jun 28 '21 at 23:09
  • @RodrigoLemos, please always open new questions if you have ... new questions. Check how StackOverflow works, it is not a forum (back'n'forth comms) but a pure Q&A place :) – Benjamin Jun 29 '21 at 06:42
  • I will add clarification to my answer, but it is better if you add a separate question if it is still unclear and you need more help. – Artem P. Jun 29 '21 at 08:33
  • I add a new question, hope it is understandable – Rodrigo Lemos Jun 29 '21 at 11:12
  • Ok, please could you mark this question as 'answered'? – Artem P. Jun 29 '21 at 12:05