0
votes

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.

1
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 stackoverflow.com/help/how-to-ask and this article focussed on AnyLogic: benjamin-schumann.com/blog/2021/4/1/… 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
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 stackoverflow.com/questions/60158916/… but i have some question about how using the collections. - Rodrigo Lemos
I made some editions to the original post - Rodrigo Lemos

1 Answers

0
votes

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